An encrypted ID token is an OpenID Connect identity token whose claims are protected so only the intended recipient can read them. The token still carries authentication data for a user or agent, but its contents remain confidential in transit and at rest, reducing exposure of identity details and session context.
What an encrypted ID token is
An encrypted id token is still an OpenID Connect ID token, but its claims are wrapped so only the intended recipient can read them. That distinction matters because the token can carry authentication context while keeping user or agent identity details confidential.
Encryption changes who can inspect the token contents, not what the token is for. The issuer still asserts identity information, but the ciphertext limits disclosure if the token is intercepted, logged, copied, or stored where multiple systems might otherwise be able to read it.
For teams implementing OpenID Connect, the practical question is usually not whether encryption is possible, but whether sensitive claims inside the ID token justify the added complexity compared with signature-only protection. In some environments, especially where claims reveal profile details, tenancy, or session context, confidentiality can be a meaningful requirement.
How encrypted ID tokens fit into OpenID Connect
OpenID Connect uses ID tokens to convey authentication results from the identity provider to the client. An encrypted ID token sits inside that flow as an additional confidentiality layer, while the underlying OIDC semantics still depend on issuer trust, audience targeting, and correct token handling.
Because the token is meant for a specific recipient, encryption helps preserve the token’s privacy boundary even when the surrounding transport, logs, proxies, or debugging tools might otherwise expose claims. That is especially important when the token contains more than a minimal identifier and timestamp set.
The most useful way to think about encrypted ID tokens is that they reduce claim visibility without changing the need for a valid OIDC validation path. The recipient must still verify issuer, audience, nonce or replay protections where applicable, and the integrity of the authentication result.
What encrypted claims protect and what they do not
Encryption primarily protects the confidentiality of token claims. It does not, by itself, make the token better authenticated, more resistant to replay, or less valuable if stolen by a party that can also decrypt or misuse it.
The protected contents can include identity attributes, session-related context, and other information that would be sensitive if exposed outside the relying party. That is why encrypted ID tokens are often discussed where privacy, least disclosure, or sensitive federation relationships matter.
At the same time, an encrypted token still has a lifecycle. It can be copied, stored, forwarded, mishandled, or retained longer than intended. Confidentiality helps, but operational handling still determines whether the token remains a safe authentication artifact.
When encrypted ID tokens are worth using
Encrypted ID tokens are most useful when the token carries claims that should not be broadly readable by intermediaries, log collectors, or adjacent services. They are also useful when organisations want to reduce the blast radius of accidental exposure without redesigning the whole authentication flow.
They are less valuable when the token already contains only minimal claims and the main concern is transport security or endpoint compromise. In those cases, the better control may be limiting claim content, shortening token lifetime, or tightening recipient handling rules rather than adding encryption everywhere.
The decision is therefore architectural as much as cryptographic: use encryption where claim confidentiality materially matters, and keep the token as small and short-lived as the application allows.
Risk and Threat Considerations
Encrypted ID tokens mainly reduce the risk of sensitive identity or session data being exposed through logs, integrations, browser tooling, or accidental forwarding. They do not remove the value of the token to an attacker who can capture both the token and the means to use it, nor do they eliminate the damage from weak recipient handling.
Failure mechanism: If token contents are readable to unintended parties, identity attributes, session context, or other claims can be harvested for reconnaissance, correlation, or follow-on abuse. If the token is mishandled after decryption, the confidentiality benefit is lost at the point of use.
Impact: Exposure can increase privacy risk, aid account targeting, and reveal enough context to support token theft, impersonation, or lateral abuse across relying-party integrations.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5, OWASP ASVS and NIST SP 800-63 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | IA-2 — Identification and Authentication (Organizational Users) | Encrypted ID tokens support authenticated user identity claims in OIDC |
| IA-9 — Service Identification and Authentication | Encrypted ID tokens can also protect authentication claims used by services or agents | |
| IA-5 — Authenticator Management | Token confidentiality and lifecycle handling depend on protecting identity-bearing secret material | |
| Recommendation — Validate OIDC identity assertions before trusting access decisions. Protect machine-to-machine identity assertions with appropriate token handling and confidentiality controls. Manage token issuance, storage, rotation, and revocation as sensitive authenticator lifecycle functions. | ||
| OWASP ASVS | V9 — Self-contained Tokens | Encrypted ID tokens are self-contained identity tokens whose contents and handling need verification |
| V10 — OAuth and OIDC | OpenID Connect ID tokens are defined within the OIDC layer of OAuth-based authentication | |
| Recommendation — Review token structure, confidentiality, and validation requirements for self-contained identity tokens. Apply OIDC-specific validation and token handling checks for identity token processing. | ||
| NIST SP 800-63 | Digital Identity Guidelines | OIDC ID tokens are part of digital identity federation and authentication assurance decisions |
| Recommendation — Use federation assurance guidance when choosing how much identity data to place in an ID token. | ||
| ISO/IEC 27001:2022 | A.8.24 — Use of cryptography | Encrypted ID tokens are a direct application of cryptography to protect sensitive identity claims |
| Recommendation — Specify cryptographic protection for token contents where confidentiality requirements justify it. | ||
Practitioner Guidance
Why practitioners should care: Treat encrypted ID tokens as a confidentiality control for claims, not as a substitute for careful token design. If the token carries sensitive attributes, keep the claim set minimal and confirm that only the intended client can decrypt and use it.
What to watch for: Review where ID tokens are decoded, logged, cached, or forwarded during debugging, middleware processing, and federation flows. The goal is to prevent encrypted content from becoming plain text again through operational shortcuts.
Practitioner takeaway: Encrypt the token when claim confidentiality matters, but still govern claim minimisation, recipient handling, and token lifetime as separate controls.
Related resources from NHI Mgmt Group
- Guide: OAuth 2.0 and OpenID Connect Guide for Identity Teams
- What is the difference between an ID token and an access token in OpenID Connect?
- What breaks when an OIDC connection assumes all profile claims are in the ID token?
- How do you configure access token lifetimes in Microsoft Entra ID?
- How do you customise token claims for applications in Microsoft Entra ID?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 24, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org