How do you get the username for a Windows Azure Mobile Services user?

Once the user has authenticated, how do I get the username of my account? I could not see anything in MSUser.h that would help. Do I have to do this differently for each of the 4 different identity providers?

+4
source share
1 answer

Do you mean on the client or server side? In server code, you can use getIdentities() for the user object, which is always a parameter in server scripts. The properties for each vendor are distinguished as follows:

 { "facebook":{ "userId":"Facebook:my-actual-user-id", "accessToken":"the-actual-access-token" } } 

And for Twitter:

 { "twitter":{ "userId":"Twitter:my-actual-user-id", "accessToken":"the-actual-access-token", "accessTokenSecret":"the-actual-access-token-secret" } } 

Microsoft:

 { "microsoft":{ "userId":"MicrosoftAccount:my-actual-user-id", "accessToken":"the-actual-access-token" } } 

Google:

 { "google":{ "userId":"Google:my-actual-user-id", "accessToken":"the-actual-access-token" } } 

( Taken from Carlos Figueira excellent blog post , which is described in more detail)

On the client side, I did not use the IOS SDK, but in JavaScript it is client.currentUser.userId

+3
source

Source: https://habr.com/ru/post/1482920/


All Articles