Prerequisites
@dynamic-labs-sdk/clientinitialized- External auth (BYOA) configured with a JWKS URL in your dashboard
- The user is already signed in via external auth
How it works
- Your backend creates an assertion JWT signed with the same key registered in your environment’s JWKS URL.
- The SDK sends this JWT to Dynamic’s backend, which validates the signature and issues an elevated access token.
- The elevated token is automatically stored in SDK state and attached to subsequent API calls — no manual token handling is needed.
Assertion JWT requirements
Your backend must sign a JWT with the following claims:| Claim | Required | Description |
|---|---|---|
sub | Yes | The user’s external user ID (must match the signed-in user) |
scope | Yes | Space-delimited scopes to request (e.g., "wallet:export") |
jti | Yes | A unique token identifier (prevents replay attacks) |
exp | Yes | Expiration time (Unix timestamp in seconds) |
Usage
Combining with checkStepUpAuth
You can use checkStepUpAuth to determine whether step-up is required before calling your backend:
When to use external auth vs. other methods
| Approach | Best for |
|---|---|
| External auth | BYOA setups where your backend controls identity verification. No user interaction needed on the client. |
| Re-auth / MFA | When you want Dynamic to handle user verification (OTP, passkey, TOTP, etc.) |
Related
- Step-Up Authentication Overview — Concepts, scopes, token lifecycle
- Bring Your Own Auth — Configuring external auth
- JavaScript SDK Step-Up Guide — Re-auth and MFA methods