user object
Updated: June 3, 2015
Represents a Microsoft Azure Mobile Services user.
This object contains the following members:
getIdentities
Syntax | Return Type | Description | ||
|---|---|---|---|---|
user.getIdentities(options) | undefined | Asynchronously accesses identity information for the logged-in user. This function takes an options parameter, which is used to supply a success and error callback functions, as follows:
{
success: function(identities) {
…
},
error: function(e) {
…
}
}
After a user has been authenticated, Mobile Services passes to the success function an identities object, which contains the following fields:
{
"providerName": {
"userId": "ProviderName:user_id_value",
"accessToken": "access_token_value"
}
}
An error object is supplied to the error callback function when an error occurs. The error callback function is optional.
| ||
user.getIdentities() | object |
Synchronously requests a JavaScript Object Notation (JSON) object that contains identity information, in the following format:
{ "providerName": {
"userId": "user_id_value",
"accessToken": "access_token_value",
"accessTokenSecret": "access_token_secret_value"
}
}
The access_token_secret_value may not be available for all identity providers. |
Property name | Type | Description |
|---|---|---|
accessTokens | object | A JavaScript Object Notation (JSON) object that contains the access token, in the following format:
{ providerName: "access_token_value" }
|
level | string | The level of authentication, which can be one of the following:
|
userId | string | The user ID of an authenticated user. When a user is not authenticated, this property returns undefined. |
Scripts registered to table operations are always passed an instance of the user object, regardless of whether the operation is authenticated.
In a custom API, the user object is accessed from the request object supplied to the function.

