Global

Methods

authorize(parameters, callback)

Opens the OS browser and redirects to {domain}/authorize url in order to initialize a new authN/authZ transaction

Source:
See:
Parameters:
Name Type Description
parameters Object
Name Type Attributes Description
state String <optional>

value used to mitigate XSRF attacks. https://auth0.com/docs/protocols/oauth2/oauth-state

nonce String <optional>

value used to mitigate replay attacks when using Implicit Grant. https://auth0.com/docs/api-auth/tutorials/nonce

scope String <optional>

scopes to be requested during Auth. e.g. openid email

audience String <optional>

identifier of the resource server who will consume the access token issued after Auth

callback authorizeCallback

onRedirectUri(url)

Handler that must be called with the redirect url the browser tries to open after the OAuth flow is done. To listen to that event, using cordova-plugin-customurlscheme, you need to register a callback in the method window.handleOpenURL

var Auth0Cordova = require('@auth0/cordova');
window.handleOpenURL = Auth0Cordova.onRedirectUri(url);
Source:
Parameters:
Name Type Description
url String

with a custom scheme relied to the application

Type Definitions

authorizeCallback(erropt, resultopt)

Source:
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

Name Type Attributes Description
accessToken String <optional>

token that allows access to the specified resource server (identified by the audience parameter or by default Auth0's /userinfo endpoint)

expiresIn Number <optional>

number of seconds until the access token expires

idToken String <optional>

token that identifies the user

refreshToken String <optional>

token that can be used to get new access tokens from Auth0. Note that not all clients can request them or the resource server might not allow them.