Back to Node Auth0

Interface ICustomTokenExchange

docs/interfaces/auth.SDK.ICustomTokenExchange.html

5.9.11.7 KB
Original Source

Interface ICustomTokenExchange

Interface defining Custom Token Exchange operations

See

Auth0 Custom Token Exchange Docs

interface ICustomTokenExchange {
exchangeToken(
options: CustomTokenExchangeOptions,
): Promise<TokenResponse>;
}

Index

Methods

exchangeToken

Methods

exchangeToken

exchangeToken(options: CustomTokenExchangeOptions): Promise<TokenResponse>

Executes RFC 8693-compliant token exchange flow

Parameters

Returns Promise<TokenResponse>

Throws

For structured error responses

Throws

For generic errors with these codes:

  • invalid_request: Invalid parameters
  • consent_required: Enable "Allow Skipping User Consent" in API settings
  • too_many_attempts: Suspicious IP throttling triggered

Example

// External IdP migration scenarioconst tokens = await auth0.customTokenExchange.exchangeToken({ subject_token_type: 'urn:external-idp:legacy', subject_token: externalIdPToken, audience: 'https://api.your-service.com', scope: 'openid profile'});Copy

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Methods exchangeToken