You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: main/docs/secure/call-apis-on-users-behalf/token-vault/privileged-worker-token-exchange-with-token-vault.mdx
Privileged Worker Token Exchange with Token Vault is currently in Beta. To learn more about Auth0’s product release cycle, read [Product Release Stages](/docs/troubleshoot/product-lifecycle/product-release-stages). To participate in this program, contact [Auth0 Support](https://support.auth0.com/) or your Technical Account Manager.
7
+
Privileged Worker Token Exchange with Token Vault is currently in Beta. To learn more about Auth0's product release cycle, read [Product Release Stages](/docs/troubleshoot/product-lifecycle/product-release-stages). To participate in this program, contact [Auth0 Support](https://support.auth0.com/) or your Technical Account Manager.
8
8
</Callout>
9
9
10
-
Token Vault supports the Privileged Worker Token Exchange, which enables a client application to exchange a signed JWT (subject token) for an external provider’s access or refresh token (requested token).
10
+
Token Vault supports the Privileged Worker Token Exchange, which enables a client application to exchange a signed JWT (subject token) for an external provider's access or refresh token (requested token).
11
11
12
-
After successful user authentication and authorization, a client application typically passes the user context, which contains the user's identity, permissions, and session state, as an access or refresh token to perform the token exchange with Token Vault. In service-to-service flows, a client application, such as a backend application or service worker, may need to access resources on the user’s behalf, but because the “user is not present” in an interactive session, the client application doesn’t have access to the user context.
12
+
After successful user authentication and authorization, a client application typically passes the user context, which contains the user's identity, permissions, and session state, as an access or refresh token to perform the token exchange with Token Vault. In service-to-service flows, a client application, such as a backend application or service worker, may need to access resources on the user's behalf, but because the "user is not present" in an interactive session, the client application doesn't have access to the user context.
13
13
14
-
In these service-to-service scenarios, the client application can generate a signed JWT bearer token and use it as the subject token to perform the token exchange and receive the necessary tokens to call external APIs. This means the client application can perform actions on the user’s behalf without an active user interaction or session.
14
+
In these service-to-service scenarios, the client application can generate a signed JWT bearer token and use it as the subject token to perform the token exchange and receive the necessary tokens to call external APIs. This means the client application can perform actions on the user's behalf without an active user interaction or session.
15
15
16
16
To use the Privileged Worker Token Exchange with Token Vault, the client application must be a highly privileged client that can also request refresh tokens from external providers via Token Vault. It should authenticate with Token Vault using asymmetric cryptographic methods such as [Private Key JWT](/docs/get-started/authentication-and-authorization-flow/authenticate-with-private-key-jwt) assertion or [mutual TLS authentication](/docs/get-started/authentication-and-authorization-flow/authenticate-with-mtls).
17
17
@@ -28,7 +28,18 @@ Before configuring Privileged Worker Token Exchange for your client application:
28
28
29
29
## Configure client application
30
30
31
-
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.
31
+
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.
32
+
33
+
<Tabs><Tabtitle="Auth0 Dashboard">
34
+
35
+
1. Navigate to **Applications > Applications** and select your application.
36
+
2. Select the **Settings** tab, scroll to the **Privileged Worker** section, and toggle **Enable Privileged Worker** on. In the modal that appears, select an existing public key credential or upload a new one, then select **Save**.
37
+
3. Once the credential is saved, enter at least one IP address or CIDR range in the **IP Allowlist** field that now appears.
Similar to [configuring JAR](/docs/get-started/applications/configure-jar#configure-jwt-secured-authorization-requests-jar), you can set the Token Vault privileged access public key when creating a new client:
Once you set an `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.
108
+
</Tab></Tabs>
109
+
110
+
<Callouttype="info">
111
+
Configuring an `ip_allowlist` is required as part of the client configuration. Any Privileged Worker token exchange request from an IP not in the list will be rejected.
112
+
</Callout>
98
113
99
114
## Create signed JWT subject token
100
115
101
116
After [configuring your client application with the public key](#configure-client-application), 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.
102
117
103
118
The JWT has a standard format and claims, where:
104
-
- Header’s `typ` is `token-vault-req+jwt`
105
-
- Header’s `kid` is optional if you have only one public key configured
106
-
- Payload’s `sub` is the user ID for whom you want to get the token for
107
-
- Payload’s `aud` is your tenant host
108
-
- Payload’s `iss` is your client ID making the request
109
-
- Payload’s `jti` is a unique identifier for this JWT (UUID v4 recommended) — required for replay protection
110
-
- Payload’s `audit_context` is a human-readable string (1–256 characters) describing the business reason for this privileged access — required for audit trail purposes
119
+
- Header's `typ` is `token-vault-req+jwt`
120
+
- Header's `kid` is optional if you have only one public key configured
121
+
- Payload's `sub` is the user ID for whom you want to get the token for
122
+
- Payload's `aud` is your tenant host
123
+
- Payload's `iss` is your client ID making the request
124
+
- Payload's `jti` is a unique identifier for this JWT (UUID v4 recommended) — required for replay protection
125
+
- Payload's `audit_context` is a human-readable string (1–256 characters) describing the business reason for this privileged access — required for audit trail purposes
111
126
112
127
The following is an example JWT:
113
128
@@ -136,23 +151,23 @@ Do not include personally identifiable information (PII) in `audit_context`. Thi
136
151
The following code sample is a script that generates a signed JWT subject token:
0 commit comments