Auth0 Authentication API Client
Provides access to Auth0's authentication endpoints for login, signup, passwordless authentication, and token exchange operations.
import { AuthenticationClient } from 'auth0';const auth0 = new AuthenticationClient({ domain: 'your-tenant.auth0.com', clientId: 'your-client-id'}); Copy
import { AuthenticationClient } from 'auth0';const auth0 = new AuthenticationClient({ domain: 'your-tenant.auth0.com', clientId: 'your-client-id'});
// Exchange authorization code for tokensconst tokenSet = await auth0.oauth.authorizationCodeGrant({ code: 'auth-code', redirect_uri: 'https://app.example.com/callback'}); Copy
// Exchange authorization code for tokensconst tokenSet = await auth0.oauth.authorizationCodeGrant({ code: 'auth-code', redirect_uri: 'https://app.example.com/callback'});
// Create userconst user = await auth0.database.signUp({ connection: 'Username-Password-Authentication', username: 'john@example.com', password: 'secure-password123'}); Copy
// Create userconst user = await auth0.database.signUp({ connection: 'Username-Password-Authentication', username: 'john@example.com', password: 'secure-password123'});
Create a new Authentication API client
Configuration options for the client
Database connection operations (signup, change password)
OAuth 2.0 and OIDC operations (authorization, token exchange)
Passwordless authentication (email/SMS)
Back-channel authentication (CIBA)
Custom token exchange operations
Auth0 Authentication API Client
Provides access to Auth0's authentication endpoints for login, signup, passwordless authentication, and token exchange operations.
Example: Basic setup
Example: OAuth login
Example: Database operations