Overview
TheAuth0ClientOptions interface defines all configuration options available when creating an Auth0Client instance. These options control authentication behavior, session management, token handling, and security features.
Type Definition
Required Configuration
These options must be provided either through the constructor or environment variables:string
The Auth0 domain for your tenant (e.g.,
example.us.auth0.com).Environment variable: AUTH0_DOMAINstring
The Auth0 application client ID.Environment variable:
AUTH0_CLIENT_IDstring
The Auth0 application client secret. Either this or
clientAssertionSigningKey must be provided.Environment variable: AUTH0_CLIENT_SECRETstring
A 32-byte, hex-encoded secret used for encrypting session cookies.Environment variable:
AUTH0_SECRETGenerate with: openssl rand -hex 32Authorization Server Options
AuthorizationParameters
Additional parameters to send to the
/authorize endpoint. See AuthorizationParameters below.boolean
default:false
Enable Pushed Authorization Requests (PAR) for enhanced security.
string | CryptoKey
Private key for use with
private_key_jwt client authentication. Can be a PEM string or CryptoKey.Environment variable: AUTH0_CLIENT_ASSERTION_SIGNING_KEYstring
Algorithm used to sign client assertion JWT (e.g., “RS256”, “ES256”).Environment variable:
AUTH0_CLIENT_ASSERTION_SIGNING_ALGApplication Options
string | string[]
The base URL(s) of your application (e.g.,
http://localhost:3000).- Single URL:
"https://app.example.com" - Multiple URLs:
["https://app.example.com", "https://myapp.vercel.app"] - Environment variable:
APP_BASE_URL(comma-separated for multiple)
string
default:"/"
Path to redirect users to after successful authentication.
Session Options
SessionConfiguration
Configure session timeouts and behavior.
SessionDataStore
Custom session store implementation for database-backed sessions.
Logout Options
'auto' | 'oidc' | 'v2'
default:"auto"
Logout endpoint selection strategy:
auto- Try OIDC RP-Initiated Logout, fallback to/v2/logoutoidc- Always use OIDC RP-Initiated Logoutv2- Always use Auth0/v2/logoutendpoint
boolean
default:true
Include
id_token_hint parameter in OIDC logout URLs. Recommended for security.Hooks
BeforeSessionSavedHook
Callback to modify the session before it’s persisted.Example:
OnCallbackHook
Callback to handle post-authentication logic or customize redirects.Example:
Token Options
number
default:0
Number of seconds before token expiration to trigger automatic refresh.Example: With
tokenRefreshBuffer: 60, tokens expiring within 60 seconds will be proactively refreshed.boolean
default:true
Enable the
/auth/access-token endpoint for client-side token access.DPoP Configuration
boolean
default:false
Enable DPoP (Demonstrating Proof-of-Possession) for cryptographically bound tokens.Example:
DpopKeyPair
ES256 key pair for DPoP proof generation.Can be loaded from environment variables:
AUTH0_DPOP_PUBLIC_KEYAUTH0_DPOP_PRIVATE_KEY
DpopOptions
DPoP timing and retry configuration.
MFA Configuration
number
default:300
MFA context TTL in seconds. Controls how long encrypted
mfa_token remains valid.Environment variable: AUTH0_MFA_TOKEN_TTLRoute Configuration
RoutesOptions
Customize authentication route paths.Environment variables:
NEXT_PUBLIC_LOGIN_ROUTENEXT_PUBLIC_PROFILE_ROUTENEXT_PUBLIC_ACCESS_TOKEN_ROUTE
boolean
default:false
Enable the
/auth/connect endpoint for connecting additional accounts.Network and Security
boolean
default:false
Allow HTTP requests to authorization server. Only for testing with mock OIDC providers. Cannot be used in production.
number
default:5000
HTTP timeout in milliseconds for authentication requests.
boolean
default:true
Send library name and version to Auth0 via
Auth0-Client header.boolean
default:true
Allow multiple concurrent authentication transactions.
boolean
default:false
Return 204 No Content instead of 401 Unauthorized for unauthenticated profile endpoint requests.
AuthorizationParameters
string
default:"openid profile email offline_access"
OAuth scopes to request. Space-delimited string.
string
API identifier for the target resource server.
string
Override the redirect URI for the callback.
number
Maximum authentication age in seconds. Forces re-authentication if exceeded.
string
Organization ID for organization-specific login.
Usage Example
See Also
- SessionData - Session data structure
- User - User profile interface
- TokenSet - Token structure