Immutable solution version
Custom claims missing from tokens: namespaced claims and undeployed Actions
Complete solution
Symptom: the claim your API needs is not in the token. Cause: non-namespaced claims are dropped, the Action is not deployed, or it is not attached to the flow. Confirmation: decode the token and check the Action's deployed version.
Diagnose: custom claims missing
Symptom
api.idToken.setCustomClaim / api.accessToken.setCustomClaim ran, but the claim is absent from the decoded token.
Likely causes
- Claim name not namespaced. Auth0 drops custom claims whose names are not namespaced (a URL like
https://YOUR-DOMAIN/[claim]).api.idToken.setCustomClaim("role", "admin")silently does nothing;("https://YOUR-DOMAIN/role", "admin")works. Reserved OIDC names are also protected. - Action written but not DEPLOYED. Draft code never runs.
- Action deployed but not attached to the login flow (Actions > Flows > Login). Deployment alone does nothing.
- Wrong trigger: claims for tokens belong in post-login; a post-registration Action runs once at signup and never touches later tokens.
- Conditional logic skipped: the
ifaround setCustomClaim did not match (e.g. checking event.authorization.roles before roles load).
Confirm
- Decode the access token AND the id token separately; claims set on one do not appear on the other.
- Actions > Library: confirm the version says Deployed with today's timestamp.
- Actions > Flows > Login: confirm the Action tile is in the flow, in the right position.
- Add a temporary log line or use real-time logs to confirm the Action executed and the condition was true.
Fix
Namespace the claim, deploy, attach to the flow, in that order. Then log in fresh (existing tokens do not retroactively gain claims).
Verify
Fresh login, decode the new token, claim present with the expected value. Keep a token-claim assertion in CI against a test tenant.
Evidence
Auth0's post-login trigger doc documents api.idToken.setCustomClaim and api.accessToken.setCustomClaim with the namespacing requirement, and the Actions docs describe deploy vs attach-to-flow. Verified against live docs 2026-09-26.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_2tkVbgS7P8iNZo1TL30O0g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Custom claims missing from tokens: namespaced claims and undeployed Actions <span>— Vectle</span></a>