Constructor
new PasswordlessAuthenticator(options, oauth)
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Authenticator options.
|
||||||||||||
oauth |
OAuthAuthenticator
|
OAuthAuthenticator instance. |
Members
(inner) clientOptions :Object
Options object for the Rest Client instace.
- Source:
Type:
-
Object
Methods
sendEmail(userData, cbopt) → {Promise|undefined}
Start passwordless flow sending an email.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
userData |
Object
|
User account data.
|
||||||||||
cb |
function
|
<optional> |
Method callback. |
Returns:
- Type:
-
Promise
|undefined
Example
- A link (default, `send:"link"`). You can then authenticate with this user opening the link and he will be automatically logged in to the application. Optionally, you can append/override parameters to the link (like `scope`, `redirect_uri`, `protocol`, `response_type`, etc.) using `authParams` object.
- A verification code (`send:"code"`). You can then authenticate with this user using the `/oauth/ro` endpoint specifying `email` as `username` and `code` as `password`.
var data = {
email: '{EMAIL}',
send: 'link',
authParams: {} // Optional auth params.
};
auth0.passwordless.sendEmail(data, function (err) {
if (err) {
// Handle error.
}
});
sendSMS(userData, cbopt) → {Promise|undefined}
Start passwordless flow sending an SMS.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userData |
Object
|
User account data.
|
|||||||||||||
cb |
function
|
<optional> |
Method callback. |
Returns:
- Type:
-
Promise
|undefined
Example
var data = {
phone_number: '{PHONE}'
};
auth0.passwordless.sendSMS(data, function (err) {
if (err) {
// Handle error.
}
});
signIn(userData, cbopt) → {Promise|undefined}
Sign in with the given user credentials.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userData |
Object
|
User credentials object.
|
|||||||||||||||||
cb |
function
|
<optional> |
Method callback. |
Returns:
- Type:
-
Promise
|undefined
Examples
var data = {
username: '{PHONE_NUMBER}',
password: '{VERIFICATION_CODE}'
};
auth0.passwordless.signIn(data, function (err) {
if (err) {
// Handle error.
}
});
{
id_token: String,
access_token: String,
token_type: String
}