OAuth Flows
LoginWithPassword
Performs the Resource Owner Password grant (not recommended for new applications).The context for the request
The login request parameters
ID token validation options
Optional request options (use Header() to set auth0-forwarded-for for brute force protection)
LoginWithPasswordRequest
The user’s username
The user’s password
Space-delimited list of scopes
The unique identifier of the target API
The realm the user belongs to (for password-realm grant)
Client ID (uses default if not provided)
Client Secret (uses default if not provided)
Extra parameters to merge into request
Example
LoginWithAuthCode
Performs the Authorization Code grant exchange.The context for the request
The authorization code exchange parameters
ID token validation options
Optional request options
LoginWithAuthCodeRequest
The authorization code from the /authorize endpoint
Must match the redirect_uri from the /authorize call
Client ID (uses default if not provided)
Client Secret (required for confidential clients)
Extra parameters to merge into request
Example
LoginWithAuthCodeWithPKCE
Performs the Authorization Code with PKCE grant exchange.The context for the request
The authorization code with PKCE parameters
ID token validation options
Optional request options
LoginWithAuthCodeWithPKCERequest
The authorization code from the /authorize endpoint
The cryptographically random key that generated the code_challenge
Must match the redirect_uri from the /authorize call
Client ID (uses default if not provided)
Extra parameters to merge into request
Example
LoginWithClientCredentials
Performs the Client Credentials grant (M2M).The context for the request
The client credentials request parameters
ID token validation options
Optional request options
LoginWithClientCredentialsRequest
The unique identifier of the target API
Organization name or ID (adds org_id or org_name claim)
Client ID (uses default if not provided)
Client Secret (required)
Extra parameters to merge into request
Example
LoginWithGrant
Generic method for any OAuth 2.0 grant type.The context for the request
The OAuth 2.0 grant type
The request body parameters
ID token validation options
Optional request options
Token Management
RefreshToken
Refreshes an access token using a refresh token.The context for the request
The refresh token request parameters
ID token validation options
Optional request options
RefreshTokenRequest
The refresh token to use
Requested scopes (can be reduced from original)
Client ID (uses default if not provided)
Client Secret (uses default if not provided)
Extra parameters to merge into request
Example
RevokeRefreshToken
Invalidates a refresh token.The context for the request
The revoke token request parameters
Optional request options
RevokeRefreshTokenRequest
The refresh token to revoke
Client ID (uses default if not provided)
Client Secret (uses default if not provided)
Extra parameters to merge into request
Example
Pushed Authorization Request (PAR)
PushedAuthorization
Performs a Pushed Authorization Request to initiate an OAuth flow from the backend.The context for the request
The PAR request parameters
Optional request options
PushedAuthorizationRequest
The response type the client expects (e.g., “code”)
The URI to redirect to
Scopes to request
The unique identifier of the target API
The nonce value
The response mode to use
The organization to log into
The ID of an invitation to accept
Name of the connection
Base64-encoded SHA-256 hash of the code_verifier (for PKCE)
Client ID (uses default if not provided)
Client Secret (required)
Extra parameters to add to request
Example
Response
The request URI to use in the /authorize call
The number of seconds the request URI is valid for
Types
TokenSet
Response from OAuth token endpoints:The access token
The user’s ID token (if openid scope was requested)
The refresh token (if offline_access scope was requested)
The type of the access token (typically “Bearer”)
The duration in seconds that the access token is valid for
Space-separated list of scopes granted
IDTokenValidationOptions
Optional validation parameters:Maximum allowed age of the authentication
Expected nonce value
Expected organization ID or name