Back to Node Auth0

Type Alias CustomTokenExchangeOptions

docs/types/auth.SDK.CustomTokenExchangeOptions.html

5.9.12.5 KB
Original Source
  • auth
  • SDK
  • CustomTokenExchangeOptions

Type Alias CustomTokenExchangeOptions

Represents the configuration options required for initiating a Custom Token Exchange request following RFC 8693 specifications.

See

RFC 8693: OAuth 2.0 Token Exchange

type CustomTokenExchangeOptions = {
subject_token_type: string;
subject_token: string;
audience: string;
scope?: string;
key: string: unknown;
}

Indexable

Additional custom parameters for Auth0 Action processing

Remarks

Accessible in Action code via event.request.body

Example

{ custom_parameter: "session_context", device_fingerprint: "a3d8f7...",}Copy

Index

Properties

subject_token_typesubject_tokenaudiencescope?

Properties

Patternsubject_token_type

subject_token_type: string

The type identifier for the subject token being exchanged

  • Must be a namespaced URI under your organization's control
  • Forbidden patterns:
    • ^urn:ietf:params:oauth:* (IETF reserved)
    • ^https://auth0\.com/* (Auth0 reserved)
    • ^urn:auth0:* (Auth0 reserved)

Example

"urn:acme:legacy-system-token""https://api.yourcompany.com/token-type/v1"Copy

Securitysubject_token

subject_token: string

The opaque token value being exchanged for Auth0 tokens

  • Must be validated in Auth0 Actions using strong cryptographic verification
  • Implement replay attack protection
  • Recommended validation libraries: jose, jsonwebtoken

Example

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"Copy

audience

audience: string

The target audience for the requested Auth0 token

Remarks

Must match exactly with an API identifier configured in your Auth0 tenant

Example

"https://api.your-service.com/v1"Copy

Optionalscope

scope?: string

Space-separated list of OAuth 2.0 scopes being requested

Remarks

Subject to API authorization policies configured in Auth0

Example

"openid profile email read:data write:data"Copy

Settings

Member Visibility

  • Protected
  • Inherited

ThemeOSLightDark

On This Page

Properties subject_token_typesubject_tokenaudiencescope