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
docs: add delegation and impersonation example for CTE (#1111)
Adds a delegation and impersonation example to the CTE section in
EXAMPLES.md, showing how to use `customTokenExchange` with `actor_token`
and `actor_token_type`.
Mirrors
[auth0-spa-js#1611](auth0/auth0-spa-js#1611),
adapted for the React hook-based API.
- The audience and scope can be provided directly in the options or will fall back to SDK defaults
216
216
-**State Management:** This method triggers the `GET_ACCESS_TOKEN_COMPLETE` action internally upon completion. This ensures that the SDK's `isLoading` and `isAuthenticated` states behave identically to the standard `getAccessTokenSilently` flow.
217
217
218
+
### Delegation and Impersonation
219
+
220
+
Use `customTokenExchange` when one principal needs to act on behalf of another — for example, an AI agent acting on behalf of a user. Unlike `loginWithCustomTokenExchange`, this method has no side effects: it does not update the session or affect `isAuthenticated` / `user`.
221
+
222
+
Pass `actor_token` and `actor_token_type` alongside the subject token to identify the acting party per [RFC 8693](https://tools.ietf.org/html/rfc8693):
0 commit comments