Constructor
new UsersManager(options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Manager options.
|
Methods
getInfo(accessToken, cbopt) → {Promise|undefined}
Given an access token get the user profile linked to it.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
accessToken |
String
|
User access token. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
auth0.users.getInfo(accessToken, function (err, userInfo) {
if (err) {
// Handle error.
}
console.log(userInfo);
});
impersonate(userId, settings, cbopt) → {Promise|undefined}
Impersonate the user with the given user ID.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userId |
String
|
User ID token. |
|||||||||||||||||||||
settings |
Object
|
Impersonation settings.
|
|||||||||||||||||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var settings = {
impersonator_id: '{IMPERSONATOR_ID}',
protocol: 'oauth2',
additionalParameters: {} // Optional aditional params.
};
auth0.users.impersonate(userId, settings, function (err, link) {
if (err) {
// Handle error.
}
console.log(link);
});