new Authentication(options)
Creates a new Auth0 Authentication API client
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Methods
buildAuthorizeUrl(options)
Builds and returns the /authorize
url in order to initialize a new authN/authZ transaction
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
- See:
buildLogoutUrl(options)
Builds and returns the Logout url in order to initialize a new authN/authZ transaction
If you want to navigate the user to a specific URL after the logout, set that URL at the returnTo parameter. The URL should be included in any the appropriate Allowed Logout URLs list:
- If the client_id parameter is included, the returnTo URL must be listed in the Allowed Logout URLs set at the Auth0 Application level (see Setting Allowed Logout URLs at the App Level).
- If the client_id parameter is NOT included, the returnTo URL must be listed in the Allowed Logout URLs set at the account level (see Setting Allowed Logout URLs at the Account Level).
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
delegation(options, cb)
Makes a call to the /delegation
endpoint with either an id_token
or refresh_token
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
||||||||||||||||||||||||||||||||
cb |
delegationCallback |
- Source:
- See:
-
- https://auth0.com/docs/api/authentication#delegation
Requires http://auth0.com/oauth/grant-type/password-realm. For more information, read https://auth0.com/docs/clients/client-grant-types.
getChallenge(cb)
Makes a call to the /usernamepassword/challenge
endpoint
and returns the challenge (captcha) if necessary.
Parameters:
Name | Type | Description |
---|---|---|
cb |
callback |
- Source:
getSSOData(withActiveDirectories, cb)
Uses checkSession
and localStorage to return data from the last successful authentication request.
Parameters:
Name | Type | Description |
---|---|---|
withActiveDirectories |
Boolean | this parameter is not used anymore. It's here to be backward compatible |
cb |
function |
- Source:
login(options, cb)
Makes a call to the oauth/token
endpoint with password-realm
grant type
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
||||||||||||||||||||||||
cb |
tokenCallback | function called with the result of the request |
- Source:
- See:
-
Requires
http://auth0.com/oauth/grant-type/password-realm
grant. For more information, read https://auth0.com/docs/clients/client-grant-types.
loginWithDefaultDirectory(options, cb)
Makes a call to the oauth/token
endpoint with password
grant type to login to the default directory.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
||||||||||||||||||||
cb |
tokenCallback | function called with the result of the request |
- Source:
- See:
-
Requires
password
grant. For more information, read https://auth0.com/docs/clients/client-grant-types.
loginWithResourceOwner(options, cb)
Performs authentication calling /oauth/ro
endpoint with username
and password for a given connection name.
This method is not compatible with API Auth so if you need to fetch API tokens with audience
you should use login
or loginWithDefaultDirectory
.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
||||||||||||||||||||||||
cb |
tokenCallback | function called with the result of the request |
- Source:
userInfo(accessToken, cb)
Makes a call to the /userinfo
endpoint and returns the user profile
Parameters:
Name | Type | Description |
---|---|---|
accessToken |
String | token issued to a user after Auth |
cb |
userInfoCallback |
- Source:
- See:
Type Definitions
authorizeCallback(erropt, resultopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
err |
Error |
<optional> |
error returned by Auth0 with the reason of the Auth failure |
||||||||||||||||||||||||
result |
Object |
<optional> |
result of the Auth request. If there is no token available, this value will be null. Properties
|
- Source:
delegationCallback(erropt, resultopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<optional> |
error returned by Auth0 with the reason why the delegation failed |
result |
Object |
<optional> |
result of the delegation request. The payload depends on what ai type was used |
- Source:
tokenCallback(erropt, resultopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
err |
Error |
<optional> |
error returned by Auth0 with the reason of the Auth failure |
||||||||||||||||||||
result |
Object |
<optional> |
result of the Auth request Properties
|
- Source:
userInfoCallback(erropt, userInfoopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error |
<optional> |
error returned by Auth0 |
userInfo |
Object |
<optional> |
user information |
- Source: