@types/auth0-js
- Version 9.21.6
- Published
- 41.5 kB
- No dependencies
- MIT license
Install
npm i @types/auth0-js
yarn add @types/auth0-js
pnpm add @types/auth0-js
Overview
TypeScript definitions for auth0-js
Index
Variables
variable version
const version: { raw: string };
Classes
class Authentication
class Authentication {}
constructor
constructor(options: AuthOptions);
property dbConnection
dbConnection: DBConnection;
property passwordless
passwordless: PasswordlessAuthentication;
method buildAuthorizeUrl
buildAuthorizeUrl: (options: AuthorizeUrlOptions) => string;
Builds and returns the
/authorize
url in order to initialize a new authN/authZ transactionParameter options
: https://auth0.github.io/auth0.js/global.html#buildAuthorizeUrl
See Also
method buildLogoutUrl
buildLogoutUrl: (options?: LogoutOptions) => string;
Builds and returns the Logout url in order to initialize a new authN/authZ transaction
Parameter options
: https://auth0.com/docs/api/authentication#!#get--v2-logout
method delegation
delegation: ( options: DelegationOptions, callback: Auth0Callback<Auth0DelegationToken>) => any;
Makes a call to the
/delegation
endpointParameter options
: https://auth0.com/docs/api/authentication#!#post--delegation
method getSSOData
getSSOData: { (callback?: Auth0Callback<SsoDataResult | undefined>): void; ( withActiveDirectories: boolean, callback?: Auth0Callback<SsoDataResult, Auth0Error> ): void;};
Makes a call to the
/ssodata
endpoint
method getUserCountry
getUserCountry: (callback: Auth0Callback<{ countryCode: string }>) => void;
Fetches the user country based on the ip.
method login
login: (options: DefaultLoginOptions, callback: Auth0Callback<any>) => void;
Makes a call to the
oauth/token
endpoint withpassword-realm
grant type
method loginWithDefaultDirectory
loginWithDefaultDirectory: ( options: DefaultDirectoryLoginOptions, callback: Auth0Callback<any>) => void;
Makes a call to the
oauth/token
endpoint withpassword
grant typeParameter options
: https://auth0.com/docs/api-auth/grant/password
method loginWithResourceOwner
loginWithResourceOwner: ( options: ResourceOwnerLoginOptions, callback: Auth0Callback<any>) => void;
Makes a call to the
/ro
endpointDeprecated
loginWithResourceOwner
will be soon deprecated, userlogin
instead.
method oauthToken
oauthToken: (options: any, callback: Auth0Callback<any>) => void;
Makes a call to the
oauth/token
endpoint
method userInfo
userInfo: ( accessToken: string, callback: Auth0Callback<Auth0UserProfile>) => void;
Makes a call to the
/userinfo
endpoint and returns the user profile
class CrossOriginAuthentication
class CrossOriginAuthentication {}
constructor
constructor(webAuth: any, options: any);
method callback
callback: () => void;
Runs the callback code for the cross origin authentication call. This method is meant to be called by the cross origin authentication callback url.
method login
login: (options: CrossOriginLoginOptions, callback: Auth0Callback<any>) => void;
Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. You can use either
username
oremail
to identify the user, butusername
will take precedence overemail
. This only works when 3rd party cookies are enabled in the browser. After the /co/authenticate call, you'll have to use the parseHash function at theredirectUri
specified in the constructor.Parameter options
options used in the authorize call after the login_ticket is acquired
Parameter cb
Callback function called only when an authentication error, like invalid username or password, occurs. For other types of errors, there will be a redirect to the
redirectUri
.
class DBConnection
class DBConnection {}
constructor
constructor(request: any, option: any);
method changePassword
changePassword: ( options: ChangePasswordOptions, callback: Auth0Callback<any>) => void;
Initializes the change password flow
Parameter options
: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
method signup
signup: ( options: DbSignUpOptions, callback: Auth0Callback<DbSignUpResults>) => void;
Creates a new user in a Auth0 Database connection
Parameter options
https://auth0.com/docs/api/authentication#signup
class Management
class Management {}
constructor
constructor(options: ManagementOptions);
Initialize your client class, by using a Non Interactive Client to fetch an access_token via the Client Credentials Grant.
method getUser
getUser: (userId: string, callback: Auth0Callback<Auth0UserProfile>) => void;
Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id
method linkUser
linkUser: ( userId: string, secondaryUserToken: string, callback: Auth0Callback<any>) => void;
Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities
method patchUserAttributes
patchUserAttributes: ( userId: string, user: Auth0UserProfile, callback: Auth0Callback<Auth0UserProfile>) => void;
Updates the user attributes. It will patch the root attributes that the server allows it. https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
method patchUserMetadata
patchUserMetadata: ( userId: string, userMetadata: any, callback: Auth0Callback<Auth0UserProfile>) => void;
Updates the user metadata. It will patch the user metadata with the attributes sent. https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
class PasswordlessAuthentication
class PasswordlessAuthentication {}
constructor
constructor(request: any, option: any);
method buildVerifyUrl
buildVerifyUrl: (options: PasswordlessVerifyOptions) => string;
Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction
method start
start: (options: PasswordlessStartOptions, callback: Auth0Callback<any>) => void;
Initializes a new passwordless authN/authZ transaction
Parameter options
: https://auth0.com/docs/api/authentication#passwordless
method verify
verify: ( options: PasswordlessVerifyOptions, callback: Auth0Callback<any>) => void;
Verifies the passwordless TOTP and returns an error if any.
class Popup
class Popup {}
constructor
constructor(client: any, options: any);
method authorize
authorize: ( options: { domain: string; clientId?: string | undefined; connection?: string | undefined; redirectUri: string; responseType: string; responseMode?: 'query' | 'fragment' | 'form_post' | undefined; state?: string | undefined; nonce?: string | undefined; scope?: string | undefined; audience?: string | undefined; owp?: boolean | undefined; }, callback: Auth0Callback<Auth0Result>) => void;
Shows inside a new window the hosted login page (
/authorize
) in order to start a new authN/authZ transaction and post its result usingpostMessage
.See Also
method callback
callback: (options: { hash: string; state?: string | undefined; nonce?: string | undefined; _idTokenVerification?: string | undefined;}) => void;
Handles the popup logic for the callback page.
See Also
method loginWithCredentials
loginWithCredentials: ( options: { redirectUri?: string | undefined; responseType?: 'code' | 'token' | undefined; responseMode?: 'query' | 'fragment' | undefined; scope?: string | undefined; }, callback: Auth0Callback<any>) => void;
method passwordlessVerify
passwordlessVerify: ( options: { type: 'sms' | 'email'; phoneNumber?: string | undefined; email?: string | undefined; connection: string; verificationCode: string; }, callback: Auth0Callback<any>) => void;
Verifies the passwordless TOTP and returns the requested token
method preload
preload: (options: any) => any;
Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.
Parameter options
: receives the window height and width and any other window feature to be sent to window.open
method signupAndLogin
signupAndLogin: ( options: { email: string; password: string; connection: string; userMetadata?: unknown | undefined; }, callback: Auth0Callback<any>) => void;
Signs up a new user and automatically logs the user in after the signup.
This method is not compatible with API Auth so if you need to fetch API tokens with audience you should use authorize or signupAndAuthorize.
class Redirect
class Redirect {}
constructor
constructor(client: any, options: any);
method loginWithCredentials
loginWithCredentials: ( options: { redirectUri?: string | undefined; responseType?: string | undefined; responseMode?: 'query' | 'fragment' | undefined; scope: string; }, callback: Auth0Callback<any>) => void;
method signupAndLogin
signupAndLogin: ( options: { email: string; password: string; connection: string; userMetadata?: unknown | undefined; } & CrossOriginLoginOptions, callback: Auth0Callback<any>) => void;
Signs up a new user and automatically logs the user in after the signup.
class WebAuth
class WebAuth {}
constructor
constructor(options: AuthOptions);
property client
client: Authentication;
property crossOriginAuthentication
crossOriginAuthentication: CrossOriginAuthentication;
property popup
popup: Popup;
property redirect
redirect: Redirect;
method authorize
authorize: (options?: AuthorizeOptions) => void;
Redirects to the hosted login page (
/authorize
) in order to initialize a new authN/authZ transactionParameter options
: https://auth0.com/docs/api/authentication#!#get--authorize_db
method changePassword
changePassword: ( options: ChangePasswordOptions, callback: Auth0Callback<any>) => void;
Initialices a change password transaction
Parameter options
: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
method checkSession
checkSession: (options: CheckSessionOptions, cb: Auth0Callback<any>) => void;
Renews an existing session on Auth0's servers using
response_mode=web_message
(i.e. Auth0's hosted login page)Parameter options
options used in authorize call
Parameter cb
See Also
method crossOriginAuthenticationCallback
crossOriginAuthenticationCallback: () => void;
Runs the callback code for the cross origin authentication call. This method is meant to be called by the cross origin authentication callback url.
Deprecated
Use crossOriginVerification instead.
method crossOriginVerification
crossOriginVerification: () => void;
Runs the callback code for the cross origin authentication call. This method is meant to be called by the cross origin authentication callback url.
method login
login: (options: CrossOriginLoginOptions, callback: Auth0Callback<any>) => void;
Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow. You can use either
username
oremail
to identify the user, butusername
will take precedence overemail
.This only works when 3rd party cookies are enabled in the browser. After the /co/authenticate call, you'll have to use the parseHash function at the
redirectUri
specified in the constructor.Parameter options
options used in the authorize call after the login_ticket is acquired
Parameter cb
Callback function called only when an authentication error, like invalid username or password, occurs. For other types of errors, there will be a redirect to the
redirectUri
.
method logout
logout: (options: LogoutOptions) => void;
Redirects to the auth0 logout endpoint
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 client 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).
See Also
method parseHash
parseHash: { ( callback: Auth0Callback<Auth0DecodedHash | null, Auth0ParseHashError> ): void; ( options: ParseHashOptions, callback: Auth0Callback<Auth0DecodedHash, Auth0ParseHashError> ): void;};
Parse the url hash and extract the returned tokens depending on the transaction.
Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed by the
/.well-known/jwks.json
endpoint. Id tokens signed with other algorithms will not be accepted.Parameter callback
: any(err, token_payload)
method passwordlessLogin
passwordlessLogin: ( options: PasswordlessLoginOptions, callback: Auth0Callback<any>) => void;
Logs in a user with the verification code sent to the user
Parameter options
Parameter callback
method passwordlessStart
passwordlessStart: ( options: PasswordlessStartOptions, callback: Auth0Callback<any>) => void;
Initialices a passwordless authentication transaction
Parameter options
: https://auth0.com/docs/api/authentication#passwordless
method passwordlessVerify
passwordlessVerify: ( options: PasswordlessVerifyOptions, callback: Auth0Callback<any>) => void;
Verifies the passwordless TOTP and redirects to finish the passwordless transaction
Parameter options
:
method renderCaptcha
renderCaptcha: ( element: HTMLElement, options?: CatpchaConfiguration, callback?: Auth0Callback<any>) => Captcha;
Renders the captcha challenge in the provided element. This function can only be used in the context of a Classic Universal Login Page.
Parameter element
The element where the captcha needs to be rendered
Parameter options
The configuration options for the captcha
Parameter callback
An optional completion callback
See Also
method renewAuth
renewAuth: (options: RenewAuthOptions, callback: Auth0Callback<any>) => void;
Executes a silent authentication transaction under the hood in order to fetch a new tokens for the current session. This method requires that all Auth is performed with authorize Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social). If you use Auth0's dev keys, you'll always get
login_required
as an error when calling this method.Parameter options
: any valid oauth2 parameter to be sent to the
/authorize
endpoint
method signup
signup: (options: DbSignUpOptions, callback: Auth0Callback<any>) => void;
Signs up a new user
Parameter options
: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
method signupAndAuthorize
signupAndAuthorize: ( options: DbSignUpOptions, callback: Auth0Callback<any>) => void;
Signs up a new user, automatically logs the user in after the signup and returns the user token. The login will be done using /oauth/token with password-realm grant type.
Parameter options
: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup
method validateToken
validateToken: ( token: string, nonce: string, callback: Auth0Callback<any>) => void;
Decodes the id_token and verifies the nonce.
Parameter callback
: function(err, {payload, transaction})
Interfaces
interface AdfsUserProfile
interface AdfsUserProfile extends Auth0UserProfile {}
property issuer
issuer?: string | undefined;
interface Auth0Challenge
interface Auth0Challenge {}
property image
image: string;
property provider
provider: 'auth0' | 'recaptcha_v2';
property required
required: boolean;
property type
type: 'code';
index signature
[other: string]: unknown;
interface Auth0DecodedHash
interface Auth0DecodedHash {}
The contents of the authResult object returned by WebAuth#parseHash
property accessToken
accessToken?: string | undefined;
property appState
appState?: any;
property expiresIn
expiresIn?: number | undefined;
property idToken
idToken?: string | undefined;
property idTokenPayload
idTokenPayload?: any;
property refreshToken
refreshToken?: string | undefined;
property scope
scope?: string | undefined;
property state
state?: string | undefined;
property tokenType
tokenType?: string | undefined;
interface Auth0DelegationToken
interface Auth0DelegationToken {}
Represents the response from an API Token Delegation request.
interface Auth0Error
interface Auth0Error {}
property code
code?: string | undefined;
property description
description?: string | undefined;
property error
error: LibErrorCodes | SpecErrorCodes | string;
property error_description
error_description?: string | undefined;
property errorDescription
errorDescription?: string | undefined;
property name
name?: string | undefined;
property original
original?: any;
property policy
policy?: string | undefined;
property statusCode
statusCode?: number | undefined;
property statusText
statusText?: string | undefined;
interface Auth0Identity
interface Auth0Identity {}
property connection
connection: string;
property isSocial
isSocial: boolean;
property provider
provider: string;
property user_id
user_id: string;
interface Auth0Result
interface Auth0Result {}
result of the Auth request. If there is no token available, this value will be null.
property accessToken
accessToken?: string | undefined;
token that allows access to the specified resource server (identified by the audience parameter or by default Auth0's /userinfo endpoint)
property appState
appState?: any;
values that you receive back on the authentication response
property expiresIn
expiresIn?: number | undefined;
number of seconds until the access token expires
property idToken
idToken?: string | undefined;
token that identifies the user
property refreshToken
refreshToken?: string | undefined;
token that can be used to get new access tokens from Auth0. Note that not all Auth0 Applications can request them or the resource server might not allow them.
interface Auth0UserProfile
interface Auth0UserProfile {}
property app_metadata
app_metadata?: any;
property clientID
clientID: string;
property created_at
created_at: string;
property email
email?: string | undefined;
property email_verified
email_verified?: boolean | undefined;
property family_name
family_name?: string | undefined;
property gender
gender?: string | undefined;
property given_name
given_name?: string | undefined;
property identities
identities: Auth0Identity[];
property locale
locale?: string | undefined;
property name
name: string;
property nickname
nickname: string;
property picture
picture: string;
property sub
sub: string;
property updated_at
updated_at: string;
property user_id
user_id: string;
property user_metadata
user_metadata?: any;
property username
username?: string | undefined;
interface AuthOptions
interface AuthOptions {}
property audience
audience?: string | undefined;
property clientID
clientID: string;
property cookieDomain
cookieDomain?: string | undefined;
The domain the cookie is accessible from. If not set, the cookie is scoped to the current domain, including the subdomain. To keep a user logged in across multiple subdomains set this to your top-level domain and prefixed with a
.
(eg:.example.com
)
property domain
domain: string;
property jwksURI
jwksURI?: string | undefined;
property leeway
leeway?: number | undefined;
property maxAge
maxAge?: number | undefined;
maximum elapsed time in seconds since the last time the user was actively authenticated by the authorization server.
property overrides
overrides?: | { __tenant?: string | undefined; __token_issuer?: string | undefined; __jwks_uri?: string | undefined; } | undefined;
property plugins
plugins?: any;
property popupOrigin
popupOrigin?: string | undefined;
property protocol
protocol?: string | undefined;
property redirectUri
redirectUri?: string | undefined;
property response_type
response_type?: string | undefined;
property responseMode
responseMode?: string | undefined;
property responseType
responseType?: string | undefined;
property scope
scope?: string | undefined;
property state
state?: string | undefined;
property tenant
tenant?: string | undefined;
property universalLoginPage
universalLoginPage?: boolean | undefined;
interface AuthorizeOptions
interface AuthorizeOptions {}
property accessType
accessType?: string | undefined;
property approvalPrompt
approvalPrompt?: string | undefined;
property appState
appState?: any;
property audience
audience?: string | undefined;
property clientID
clientID?: string | undefined;
property connection
connection?: string | undefined;
property connection_scope
connection_scope?: string | string[] | undefined;
property domain
domain?: string | undefined;
property invitation
invitation?: string | undefined;
property language
language?: string | undefined;
property login_hint
login_hint?: string | undefined;
property mode
mode?: 'login' | 'signUp' | undefined;
property nonce
nonce?: string | undefined;
property organization
organization?: string | undefined;
property prompt
prompt?: string | undefined;
property redirectUri
redirectUri?: string | undefined;
property responseMode
responseMode?: string | undefined;
property responseType
responseType?: string | undefined;
property scope
scope?: string | undefined;
property screen_hint
screen_hint?: 'signup' | undefined;
property state
state?: string | undefined;
interface AuthorizeUrlOptions
interface AuthorizeUrlOptions {}
property audience
audience?: string | undefined;
identifier of the resource server who will consume the access token issued after Auth
property clientID
clientID?: string | undefined;
your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard
property nonce
nonce?: string | undefined;
value used to mitigate replay attacks when using Implicit Grant. https://auth0.com/docs/api-auth/tutorials/nonce
property redirectUri
redirectUri: string;
url that the Auth0 will redirect after Auth with the Authorization Response
property responseMode
responseMode?: 'query' | 'fragment' | 'form_post' | undefined;
how the Auth response is encoded and redirected back to the client. Supported values are
query
,fragment
andform_post
https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes
property responseType
responseType: string;
type of the response used by OAuth 2.0 flow. It can be any space separated list of the values
code
,token
,id_token
. https://openid.net/specs/oauth-v2-multiple-response-types-1_0
property scope
scope?: string | undefined;
scopes to be requested during Auth. e.g.
openid email
property state
state?: string | undefined;
value used to mitigate XSRF attacks. https://auth0.com/docs/protocols/oauth2/oauth-state
interface BaseAuthOptions
interface BaseAuthOptions {}
property audience
audience?: string | undefined;
property clientID
clientID?: string | undefined;
property nonce
nonce?: string | undefined;
property redirectUri
redirectUri?: string | undefined;
property responseType
responseType?: string | undefined;
property scope
scope?: string | undefined;
property state
state?: string | undefined;
interface Captcha
interface Captcha {}
interface CaptchaTemplates
interface CaptchaTemplates {}
An object containing templates for a captcha provider
property auth0
auth0?: ((challenge: Auth0Challenge) => string) | undefined;
Template function receiving the challenge and returning an string
property error
error: (error: Error) => string;
property recaptcha_v2
recaptcha_v2?: ((challenge: Auth0Challenge) => string) | undefined;
Template function receiving the challenge and returning an string
interface CatpchaConfiguration
interface CatpchaConfiguration {}
interface ChangePasswordOptions
interface ChangePasswordOptions {}
property connection
connection: string;
property email
email: string;
interface CheckSessionOptions
interface CheckSessionOptions extends AuthorizeOptions {}
property usePostMessage
usePostMessage?: boolean | undefined;
optional parameter for auth0 to use postMessage to communicate between the silent callback and the SPA.
interface CrossOriginLoginOptions
interface CrossOriginLoginOptions {}
property audience
audience?: string | undefined;
property captcha
captcha?: Captcha | undefined;
property clientID
clientID?: string | undefined;
property domain
domain?: string | undefined;
property email
email?: string | undefined;
property nonce
nonce?: string | undefined;
property onRedirecting
onRedirecting?: (done: () => void) => void | undefined;
property password
password: string;
property realm
realm?: string | undefined;
property redirectUri
redirectUri?: string | undefined;
property responseMode
responseMode?: string | undefined;
property responseType
responseType?: string | undefined;
property scope
scope?: string | undefined;
property state
state?: string | undefined;
property username
username?: string | undefined;
interface DbSignUpOptions
interface DbSignUpOptions {}
property connection
connection: string;
name of the connection where the user will be created
property email
email: string;
user email address
property password
password: string;
user password
property scope
scope?: string | undefined;
property userMetadata
userMetadata?: unknown | undefined;
additional signup attributes used for creating the user. Will be stored in
user_metadata
property username
username?: string | undefined;
User desired username. Required if you use a database connection and you have enabled
Requires Username
interface DbSignUpResults
interface DbSignUpResults {}
result of the signup request
property email
email: string;
user's email
property emailVerified
emailVerified: boolean;
if the user's email was verified
interface DefaultDirectoryLoginOptions
interface DefaultDirectoryLoginOptions extends LoginOptions {}
property audience
audience?: string | undefined;
interface DefaultLoginOptions
interface DefaultLoginOptions extends LoginOptions {}
interface DelegationOptions
interface DelegationOptions {}
property api_type
api_type?: string | undefined;
property client_id
client_id?: string | undefined;
property grant_type
grant_type: string;
property id_token
id_token?: string | undefined;
property refresh_token
refresh_token?: string | undefined;
property scope
scope?: string | undefined;
property target
target?: string | undefined;
interface LoginOptions
interface LoginOptions {}
interface LogoutOptions
interface LogoutOptions {}
interface ManagementOptions
interface ManagementOptions {}
property audience
audience?: string | undefined;
property clientId
clientId?: string | undefined;
property clientSecret
clientSecret?: string | undefined;
property domain
domain: string;
property scope
scope?: string | undefined;
property telemetry
telemetry?: boolean | undefined;
property token
token?: string | undefined;
property tokenProvider
tokenProvider?: TokenProvider | undefined;
interface MicrosoftUserProfile
interface MicrosoftUserProfile extends Auth0UserProfile {}
property emails
emails?: string[] | undefined;
interface Office365UserProfile
interface Office365UserProfile extends Auth0UserProfile {}
interface ParseHashOptions
interface ParseHashOptions {}
interface PasswordlessAuthOptions
interface PasswordlessAuthOptions {}
property connection
connection: string;
property email
email: string;
property phoneNumber
phoneNumber: string;
property verificationCode
verificationCode: string;
interface PasswordlessLoginOptions
interface PasswordlessLoginOptions extends BaseAuthOptions {}
property connection
connection: string;
property email
email?: string | undefined;
property phoneNumber
phoneNumber?: string | undefined;
property verificationCode
verificationCode: string;
interface PasswordlessStartAuthParams
interface PasswordlessStartAuthParams extends BaseAuthOptions {}
property responseMode
responseMode?: string | undefined;
interface PasswordlessStartOptions
interface PasswordlessStartOptions {}
property authParams
authParams?: PasswordlessStartAuthParams | undefined;
property connection
connection: string;
property email
email?: string | undefined;
property phoneNumber
phoneNumber?: string | undefined;
property send
send: 'link' | 'code';
interface PasswordlessVerifyOptions
interface PasswordlessVerifyOptions extends BaseAuthOptions {}
property connection
connection: string;
property email
email?: string | undefined;
property phoneNumber
phoneNumber?: string | undefined;
property responseMode
responseMode?: string | undefined;
property send
send?: 'link' | 'code' | undefined;
property verificationCode
verificationCode: string;
interface RenewAuthOptions
interface RenewAuthOptions {}
property audience
audience?: string | undefined;
identifier of the resource server who will consume the access token issued after Auth
property clientID
clientID?: string | undefined;
your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard
property domain
domain?: string | undefined;
your Auth0 domain
property nonce
nonce?: string | undefined;
value used to mitigate replay attacks when using Implicit Grant. https://auth0.com/docs/api-auth/tutorials/nonce
property postMessageDataType
postMessageDataType?: string | undefined;
identifier data type to look for in postMessage event data, where events are initiated from silent callback urls, before accepting a message event is the event expected. A value of false means any postMessage event will trigger a callback.
property postMessageOrigin
postMessageOrigin?: string | undefined;
origin of redirectUri to expect postMessage response from. Defaults to the origin of the receiving window. Only used if usePostMessage is truthy.
property redirectUri
redirectUri?: string | undefined;
url that the Auth0 will redirect after Auth with the Authorization Response
property responseMode
responseMode?: string | undefined;
how the Auth response is encoded and redirected back to the client. Supported values are
query
,fragment
andform_post
. Thequery
value is only supported whenresponseType
iscode
. https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseModes
property responseType
responseType?: string | undefined;
type of the response used by OAuth 2.0 flow. It can be any space separated list of the values
code
,token
,id_token
. https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html
property scope
scope?: string | undefined;
scopes to be requested during Auth. e.g.
openid email
property state
state?: string | undefined;
value used to mitigate XSRF attacks. https://auth0.com/docs/protocols/oauth2/oauth-state
property timeout
timeout?: number | undefined;
value in milliseconds used to timeout when the
/authorize
call is failing as part of the silent authentication with postmessage enabled due to a configuration.
property usePostMessage
usePostMessage?: boolean | undefined;
use postMessage to communicate between the silent callback and the SPA. When false the SDK will attempt to parse the url hash should ignore the url hash and no extra behaviour is needed false
interface ResourceOwnerLoginOptions
interface ResourceOwnerLoginOptions extends LoginOptions {}
property connection
connection: string;
property device
device?: string | undefined;
interface SsoSessionFoundResult
interface SsoSessionFoundResult {}
property lastUsedClientID
lastUsedClientID: string;
property lastUsedConnection
lastUsedConnection: { name: string; strategy?: string | undefined;};
property lastUsedUserID
lastUsedUserID: string;
property lastUsedUsername
lastUsedUsername: string;
property sessionClients
sessionClients: string[];
property sso
sso: true;
interface SsoSessionNotFoundResult
interface SsoSessionNotFoundResult {}
property sso
sso: false;
interface TokenProvider
interface TokenProvider {}
property cacheTTLInSeconds
cacheTTLInSeconds?: number | undefined;
property enableCache
enableCache?: boolean | undefined;
Type Aliases
type Auth0Callback
type Auth0Callback<T, E = Auth0Error> = (error: null | E, result: T) => void;
type Auth0ParseHashError
type Auth0ParseHashError = Auth0Error & { state?: string | undefined;};
type ConsentRequiredErrorCode
type ConsentRequiredErrorCode = 'consent_required';
The user was logged in at Auth0, but needs to give consent to authorize the application.
type DoneCallback
type DoneCallback = (err?: Auth0Error) => void;
type InteractionRequiredErrorCode
type InteractionRequiredErrorCode = 'interaction_required';
The user was logged in at Auth0 and has authorized the application, but needs to be redirected elsewhere before authentication can be completed; for example, when using a redirect rule.
type LibErrorCodes
type LibErrorCodes = 'timeout' | 'request_error' | 'invalid_token';
These are error codes defined by the auth0-js lib.
type LoginRequiredErrorCode
type LoginRequiredErrorCode = 'login_required';
The user was not logged in at Auth0, so silent authentication is not possible.
type SpecErrorCodes
type SpecErrorCodes = | LoginRequiredErrorCode | InteractionRequiredErrorCode | ConsentRequiredErrorCode | 'account_selection_required' | 'invalid_request_uri' | 'invalid_request_object' | 'request_not_supported' | 'request_uri_not_supported' | 'registration_not_supported';
These are error codes defined by the OpenID Connect specification.
type SsoDataResult
type SsoDataResult = SsoSessionFoundResult | SsoSessionNotFoundResult;
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/auth0-js
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/auth0-js)
- HTML<a href="https://www.jsdocs.io/package/@types/auth0-js"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 5813 ms. - Missing or incorrect documentation? Open an issue for this package.