Documentation Index
Fetch the complete documentation index at: https://auth0-docs-update-privilege-worker-ea-rollout.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Privileged Worker Token Exchange with Token Vault is currently in Beta. To learn more about Auth0’s product release cycle, read Product Release Stages. To participate in this program, contact Auth0 Support or your Technical Account Manager.
Prerequisites
Only certain types of clients can use the Privileged Worker Token Exchange with Token Vault:- The client must be a first-party client, i.e. the
is_first_party propertyistrue. - The client must be a confidential client with a valid authentication mechanism, i.e. the
token_endpoint_auth_methodproperty must not be set tonone. - The client must be OIDC conformant, i.e. the
oidc_conformantmust betrue.
- Enable the Token Vault grant type for your client application.
- Configure Private Key JWT or mutual TLS authentication for your client application.
Configure client application
To configure the client application’s privileged access to Token Vault, you need to provide a public key that will be used to verify a signed JWT as the subject token. Similar to configuring JAR, you can set the Token Vault privileged access public key when creating a new client:token_vault_privileged_access.credentials[].id field in the response contains the credential ID.
Configure IP allowlist
To restrict which IP addresses may make Privileged Worker exchange requests, configure anip_allowlist on your client. This binds the client credential to known server egress IPs, so a leaked credential cannot be used from an arbitrary IP address. Both IPv4 and IPv6 addresses and CIDR ranges are supported, with a maximum of 10 entries.
ip_allowlist, any Privileged Worker token exchange request from an IP not in the list is rejected with access_denied. Requests from a client with no ip_allowlist configured are allowed from any IP.
Create signed JWT subject token
After configuring your client application with the public key, you need to create the subject token that will be exchanged for an access token for an external API. The subject token is a JSON Web Token (JWT) with the necessary claims. It is signed with the private key. The JWT has a standard format and claims, where:- Header’s
typistoken-vault-req+jwt - Header’s
kidis optional if you have only one public key configured - Payload’s
subis the user ID for whom you want to get the token for - Payload’s
audis your tenant host - Payload’s
issis your client ID making the request - Payload’s
jtiis a unique identifier for this JWT (UUID v4 recommended) — required for replay protection - Payload’s
audit_contextis a human-readable string (1–256 characters) describing the business reason for this privileged access — required for audit trail purposes
Do not include personally identifiable information (PII) in
audit_context. This value is recorded in tenant logs and may be visible to administrators and log streaming destinations.Request token for external API
Once you have the signed JWT, you can make a request for the access token for the external API:| Parameter | Description |
|---|---|
grant_type | The grant type. For Token Vault, set to urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token |
client_id | Client application ID |
client_secret | Client secret. Note: For Privileged Worker Token Exchange, we recommend using Private Key JWT or mTLS authentication. |
subject_token_type | Type of subject token. For Privileged Worker Token Exchange, set to JWT: urn:ietf:params:oauth:token-type:jwt |
subject_token | The signed JWT bearer token that the Auth0 Authorization Server validates to identify the user. |
requested_token_type | The requested token type. For Privileged Worker Token Exchange, you can request an access or refresh token. |
connection | The connection name, in this case, google-oauth2. |