Constructor
new OAuthAuthenticator(options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Authenticator options.
|
Members
(inner) clientOptions :Object
Options object for the Rest Client instace.
- Source:
Type:
-
Object
Methods
passwordGrant(userData) → {Promise|undefined}
Sign in using a username and password
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userData |
Object
|
User credentials object.
|
Returns:
- Type:
-
Promise
|undefined
Example
var data = {
client_id: '{CLIENT_ID}', // Optional field.
username: '{USERNAME}',
password: '{PASSWORD}'
realm: '{CONNECTION_NAME}', // Optional field.
scope: 'openid' // Optional field.
};
auth0.oauth.token(data, function (err, userData) {
if (err) {
// Handle error.
}
console.log(userData);
});
signIn(userData) → {Promise|undefined}
Sign in using a username and password.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userData |
Object
|
User credentials object.
|
Returns:
- Type:
-
Promise
|undefined
Example
var data = {
client_id: '{CLIENT_ID}', // Optional field.
username: '{USERNAME}',
password: '{PASSWORD}
connection: '{CONNECTION_NAME}',
scope: 'openid' // Optional field.
};
auth0.oauth.signIn(data, function (err, userData) {
if (err) {
// Handle error.
}
console.log(userData);
});
socialSignIn(data) → {Promise|undefined}
Sign in using a social provider access token.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object
|
User credentials object.
|
Returns:
- Type:
-
Promise
|undefined