The /v1.0/me endpoint preferredLanguage property source - azure-active-directory

I was told that the preferredLanguage property of the /me endpoint would reflect the values in the users Delve profile. The user object docs lists it as
The preferred language for the user. Should follow ISO 639-1 Code; for example "en-US".
Although the user has selected languages in their Delve profile at https://nam.delve.office.com/. The /me endpoint does not reflect those changes, some 2 weeks later.
I'm wondering if the source for this value is AD and if so, any plans to update it so that it can reflect the user's selection.

Related

Sending DocuSign PowerForm from Salesforce Account object

I have a Powerform that people sign online. I want users to be able to send that same Powerform from SFDC account object. How do I pass account id to the Powerform. I have added merge field, but it is throwing error saying subject doesn't exist.
Using the PowerForm URL, you can set tab values in the document and meta-data (Envelope Custom Fields) in the envelope.
Example: You have a tab in the template's document with the data name "accountID". The role name for the signer is signer.
Set the tab to be locked. This prevents any of the signers from changing it. (Makes it read-only.)
Create a PowerForm from the template. Receive back the PowerForm URL.
Example: https://demo.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=8883&env=demo&acct=7a9312b8&v=2
Program Salesforce to send the PowerForm with the accountID set to "123":
Example: https://demo.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=8883&env=demo&acct=7a9312b8&v=2&signer_UserName=Larry%20Kluger&signer_Email=larry.kluger#example.com&signer_accountID=123
In step 3, you are programming Salesforce to dynamically create a URL that includes data from the current Account object. If you don't know how to do that, ask a new question in the Salesforce stackOverflow channel.
More information
See the Programming PowerForms video.
This previous question seems similar:
Can we use merge fields(populate data from SFDC) using DocuSign Powerforms?
Does that help?

Custom permissions for different user types django rest framework

For Django-reactjs project, I have a user model in django which has 3 boolean fields (is_admin, is_moderator, is_normal_user), and I also have 3 other models, I want to set permissions for each user type. The user can only create objects for 1 model only, the moderator is the only one that can edit a certain model field, and admins can do everything.
It might be a trivial question but I am a newbie in Django and React so If you could please tell me how can I handle it with custom permissions(some steps to follow) and also how these permissions are handled from React.
Thanks in advance!
You need to check if the user has permission every time he is making an action, so when the React app calls your Django API, it will provide an authentication token right? That tokens corresponds to a unique user, so you can just do an if statement:
if request.user.is_admin:
do_everything()
elif request.user.is_moderator:
do_other_stuff()
While in the react app you would need the information if the logged in user is a moderator, admin or a normal user, so you can display the pages accordingly. To get that info, you may want to implement a '/me' endopoint that returns info about the logged in user, containg his status.
If you have no idea what Im talking about, I strongly recommend you to take a look at this video: https://www.youtube.com/watch?v=0d7cIfiydAc
The whole subject is too long for a stackoverflow answer.
Contact me if you still have any doubts.

Create unique id per computer and use it as identifier when no user is logged in

I am trying to create a web app that would submit ratings to some articles. The backend is django and frontend is angularjs.
A rating is a model with the following properties: rater, value, and article
I would like to let anonymous users to submit ratings, in which case, the rater is null, but a sessionid is attached to the rating object to identify where this rating comes.
Currently, I am using the session module from django, and attaching session_key attribute to each rating object. However, this has issue that the session changed if a valid user is logged in and logged off.
What I would like to have is to have a unique identifier for each computer from which the rating is created, and attach this id to the object. So, as long as no user is logged in, the objects created by one computer, regardless of refreshing, rebooting, loggin+logout, etc., share the same identifier.
By doing this, my ultimate goal is to allow anonymous user using the App as if he/she is always logged in. In another word, each computer is a unique "implicit user" when no real user is logged in.
My question is that, is there a way to achieve this?
Thank you in advance!
LocalStorage
Anonymous users can't be tracked perfectly.
Best you can do in my opinion is using localStorage:
localStorage.setItem('anonymous-key', 'some-key-you-generated');
and then whenever no user is logged in:
var anonymousKey = localStorage.getItem('anonymous-key');
Persistence
Local storage stays saved until the user specifically clears it. Some browsers may also add a expiry date to your data for safety reasons.
See also: https://developer.mozilla.org/nl/docs/Web/API/Window/localStorage

Does exposing a user's uid in the url pose a security threat for Firebase?

I've got a small review system built in AngularJS and Firebase and the only way to identify which review is made by which user is via the uid of the user. The idea is when you then click on the user's name, you should be taken to the profile of that user.
So I would then create a route looking like /profile/{{review.author.uid}} which could translate into /profile/facebook:123234243 for example.
My question is, does it pose a security threat showing the uid in the url like this? Can it be used for any malicious actions against a user's third party account etc?
I've tried looking through their website but I can't find anything on this subject.
EDIT: Note that I need a Firebase specific answer, not a generic one about database id:s.

What is the Mirror API endpoint for account information so I can get a user's account timezone?

When a user authorizes with my Glassware they provide these permissions to my software:
Although it isn't lining up in the image, the more info is from the top "basic information about your account" permission. It mentions timezone which I would like to access to customize global event time stamps for display to people who don't grok GMT.
I am surprised I can't find the endpoint for this anywhere in the docs.
Anyone know where this might be, or is this a UI bug in the permissions dialog and really we can't see that information? Or perhaps is this only available to trusted partners like NYT and CNN, etc, and not to mere explorers.
I already tried variations on the timeline GET endpoint:
https://www.googleapis.com/mirror/v1/timeline
But substituting in various version of user/users and account/accounts and adding in the user id for a registered user, which I can get through this bit of Java code:
String userId = AuthUtil.getUserId(req);
Any help appreciated!
(Note: I won't give credit to anyone suggesting I get the user's location and use a Google API to reverse look up their location's timezone--see the issue tracker for problems with that approach not to mention I want the timezone the user set in their account not where they are)
The more information screen is coming from the https://www.googleapis.com/auth/userinfo.profile scope: with a token approved for this scope, you can send authorized requests to the userinfo endpoint:
GET https://www.googleapis.com/oauth2/v2/userinfo
Authorization: Bearer <OAUTH_2_TOKEN>
However, you will only be able to retrieve the timezone information if the user set it in their profile and allowed sharing.
In Java, retrieving this information is done with the OAuth2 API.

Resources