Provides access to the web-based authentication methods.
Provides access to the credentials management methods.
Provides access to direct authentication methods (e.g., password-realm).
Creates an instance of the Auth0 client.
Configuration options for the client.
Provides access to the Management API (e.g., for user patching).
An access token with the required permissions for the management operations.
OptionaltokenType: TokenTypeOptional token type ('Bearer' or 'DPoP'). Defaults to the client's configured token type.
Generates DPoP headers for making authenticated requests to custom APIs. This method creates the necessary HTTP headers (Authorization and DPoP) to securely bind the access token to a specific API request.
Parameters including the URL, HTTP method, access token, and token type.
A promise that resolves to an object containing the required headers.
const credentials = await auth0.credentialsManager.getCredentials();
if (credentials.tokenType === 'DPoP') {
const headers = await auth0.getDPoPHeaders({
url: 'https://api.example.com/data',
method: 'GET',
accessToken: credentials.accessToken,
tokenType: credentials.tokenType
});
const response = await fetch('https://api.example.com/data', { headers });
}
Performs a Custom Token Exchange using RFC 8693. Exchanges an external identity provider token for Auth0 tokens.
The token exchange parameters.
A promise resolving with Auth0 credentials.
The main Auth0 client class.
This class acts as a facade, creating and delegating to a platform-specific client instance (Native or Web) under the hood.
Example