Most OpenID Connect integration bugs come from trusting a claim for something it was never designed to guarantee, such as using an email address as a user key. OpenID Connect Core defines a small, fixed set of scopes and standard claims, plus the registered claims every ID token carries, and the specification is explicit about which of them are stable, which are optional and which must never be used as identifiers. This reference lists every standard scope and claim with its type and meaning, the ID token claims a relying party must validate, the claims that are unsafe for authorisation, and the privacy rules for requesting only what you need. It is written for developers and IAM engineers integrating OIDC as a relying party or configuring an OpenID Provider. Definitions follow OpenID Connect Core 1.0 incorporating errata set 2 (15 December 2023), checked in November 2026; provider-specific claims are labelled with the provider's name.
Key takeaways
- Key users on iss plus sub, never email. OIDC Core states that the only guaranteed unique identifier for an end-user is the combination of the
issandsubclaims;email,phone_number,preferred_usernameandnamemust not be used as unique identifiers. - Scopes request claims; claims carry data.
openidmakes the request an OIDC request, andprofile,email,addressandphoneare shorthand for fixed claim sets. Requesting a scope does not guarantee the provider returns every claim in it. - Validate the ID token claims every time.
issmust match exactly,audmust contain yourclient_id,expmust be in the future andnoncemust match the value you sent; checkazp,acrandauth_timewhen they apply. - email_verified is a point-in-time statement by one provider. It says the provider took affirmative steps to check control of the address when it verified it, by a method that depends on the provider, so it is not proof of who owns the mailbox today.
- Request the minimum. Each extra scope adds personal data you must protect and justify; ask for
openidalone when all you need is a stable login identifier.
Scopes and claims explained
A claim is a piece of information asserted about an entity, carried as a name and value in a JSON object. A scope is an OAuth 2.0 request parameter; in OIDC, certain scope values ask the provider to release a predefined group of claims. Claims reach the relying party (RP) in two places: the ID token, a signed JWT that proves an authentication event, and the UserInfo endpoint, an OAuth-protected API that returns profile claims. OIDC Core says that when an access token is issued, the claims requested by the profile, email, address and phone scopes are returned from UserInfo; when no access token is issued (response_type=id_token), they are returned in the ID token.
The claims request parameter (Core section 5.5) lets an RP ask for individual claims for the ID token or UserInfo, marking them essential or asking for specific value or values. Providers are not required to support it, so treat it as an optimisation and check the provider's discovery document (claims_parameter_supported). For the wider difference between claims and permissions, see OAuth Claims vs Scopes; for the protocol flows themselves, see the OAuth 2.0 and OpenID Connect Guide.
Standard scopes (openid, profile, email, address, phone)
| Scope | Claims requested (OIDC Core 5.4) | Notes for RPs |
|---|---|---|
openid | None of the profile claims; makes the request an OpenID Connect request and returns an ID token with sub | Must always be present; enough for "log this person in and give me a stable key" |
profile | name, family_name, given_name, middle_name, nickname, preferred_username, profile, picture, website, gender, birthdate, zoneinfo, locale, updated_at | Broad: includes gender and birthdate, which many apps do not need |
email | email, email_verified | Use for contact, not identity |
address | address | JSON object; providers may return only some members |
phone | phone_number, phone_number_verified | Use for contact or as a recovery channel, not as a key |
offline_access | No claims; requests a refresh token for access when the user is not present | Grant only where the use case needs it and the user consents |
Providers decide what to release. Google, for example, lists openid, email and profile as its supported OpenID scopes and requires the scope parameter to begin with openid. Always read scopes_supported and claims_supported from the provider's discovery document rather than assuming the full set.
Standard claims reference table
The 20 standard claims defined in OIDC Core section 5.1. All are optional for the provider to return except sub, which every ID token and UserInfo response carries.
| Claim | Type | Meaning | Safe use |
|---|---|---|---|
sub | string | Identifier for the end-user at the issuer | Primary key, always paired with iss |
name | string | Full name in displayable form | Display only |
given_name | string | Given name or first name(s) | Display, personalisation |
family_name | string | Surname(s) or last name | Display, personalisation |
middle_name | string | Middle name(s) | Display |
nickname | string | Casual name, may differ from given name | Display |
preferred_username | string | Shorthand name the user prefers; not guaranteed unique | Display, never a key |
profile | string (URL) | URL of the user's profile page | Display link; treat as untrusted input |
picture | string (URL) | URL of a profile image | Display; fetch through a proxy or sanitise |
website | string (URL) | User's web page or blog | Display; treat as untrusted input |
email | string | Preferred email, RFC 5322 addr-spec; not guaranteed unique | Contact, never a key |
email_verified | boolean | Whether the provider verified the address | Input to account linking decisions, with care |
gender | string | female and male defined; other values allowed | Request only with a clear purpose |
birthdate | string | YYYY-MM-DD; year may be 0000, or year only | Request only with a clear purpose |
zoneinfo | string | IANA time zone name, such as Europe/Paris | Localisation |
locale | string | BCP47 language tag, such as en-GB | Localisation |
phone_number | string | Preferred phone number, E.164 recommended | Contact, never a key |
phone_number_verified | boolean | Whether the provider verified the number | Same caution as email_verified |
address | JSON object | Postal address: formatted, street_address, locality, region, postal_code, country | Delivery or billing where needed |
updated_at | number | Seconds since 1970-01-01T00:00:00Z when the information last changed | Decide when to refresh cached profile data |
The sub value is case sensitive, at most 255 ASCII characters and never reassigned by the issuer. Under the pairwise subject type (Core section 8) a provider gives each client, or each sector identifier, a different sub so RPs cannot correlate a user across services; under public every client sees the same value. Do not assume a sub from one application will match another.
ID token registered claims
These claims make the ID token a verifiable authentication event. The first seven come from OIDC Core section 2; sid, nbf and jti appear in many deployments and are listed in the IANA JSON Web Token Claims registry with their defining specification.
| Claim | Status in OIDC Core | Meaning | RP validation (Core 3.1.3.7) |
|---|---|---|---|
iss | Required | Issuer identifier, a case-sensitive https URL without query or fragment | Must exactly match the issuer from discovery or configuration |
sub | Required | Subject identifier, unique within the issuer | Store with iss as the user key |
aud | Required | Audience(s); must contain the RP's client_id | Reject if your client_id is absent or an untrusted audience is present |
exp | Required | Time after which the token must not be accepted | Current time must be before exp; unrelated to your session length |
iat | Required | Time the JWT was issued | Optionally reject tokens issued too far from now |
auth_time | Required when max_age is sent or it is requested as essential; otherwise optional | Time the user actually authenticated | Re-authenticate if older than your policy allows |
nonce | Must be included if sent in the request | Value passed unchanged from request to token | Must match the value bound to the user's session; check for replay |
acr | Optional | Authentication context class satisfied | If requested via acr_values, check the value meets your policy |
amr | Optional | Array of authentication method identifiers, values registered in RFC 8176 such as pwd, otp, hwk, mfa | Informational; prefer acr for policy |
azp | Optional | Authorised party, the client the token was issued to | If present, should equal your client_id |
at_hash, c_hash | Conditional by flow | Hashes binding the token to the access token or code | Verify in implicit and hybrid flows |
sid | Defined in OIDC Front-Channel Logout | Session identifier at the provider | Use to process logout requests |
nbf, jti | Defined in RFC 7519 | Not-before time; unique token ID | Honour nbf if present; jti helps replay detection |
The other validation steps in Core 3.1.3.7 matter as much as the claims: verify the signature with the issuer's published keys unless the token came directly from the token endpoint over TLS, use the algorithm you registered (RS256 by default), and generate nonce with enough entropy that it cannot be guessed. Use a maintained OIDC library rather than hand-written checks. For signature and algorithm pitfalls see the JWT Security Guide, and for failure messages see the JWT Validation Errors Troubleshooting Guide. Logout claims are covered in the OpenID Connect Logout and Session Management Guide.
Claims you should not use for authorisation
ID tokens tell the RP who logged in and how; they are not a permission system. The following claims cause real account takeover and privilege bugs when used as keys or access decisions.
| Claim or pattern | Why it is unsafe | Use instead |
|---|---|---|
email as account key | Not unique, can change or be reassigned; in some providers set by tenant administrators or users | iss + sub |
preferred_username, name | Not guaranteed unique; user or admin controlled | Display only |
email_verified=true to merge accounts automatically | Means the provider checked the address once, by its own method; trust differs by provider | Link only from providers you trust for that domain, with re-authentication to the existing account |
| Email domain to grant tenant or admin access | Any provider that lets a user set an arbitrary address can impersonate the domain | A provider-specific organisation claim, validated (for example Google's hd, Microsoft Entra tid) |
sub without iss | Two issuers can issue the same sub | Composite key of both |
| ID token sent to an API as a bearer token | Audience is the client, not the API | An access token issued for that API |
Provider guidance is consistent with the specification. Microsoft's claims validation guidance (Microsoft Entra) says never to use email, preferred_username or unique_name to decide access because they are not unique and can be controlled by tenant administrators or sometimes users, warns that upn often changes, and recommends the immutable tid and oid together as the key. Google's documentation (Google Identity) says sub is never reused or changed, tells developers not to use email as a unique identifier, and requires the hd claim in the ID token to be checked when restricting access to a Workspace domain, noting that the hd request parameter only adjusts the sign-in screen. For linking social and enterprise logins safely, see the Social Login and Account Linking Security Guide.
Authorisation data belongs in access tokens or your own policy store. Claims such as roles, groups and entitlements (registered via RFC 7643 and RFC 9068) and scope or act (RFC 8693) are not OIDC standard claims; if you rely on them, validate them in the access token for your API, not in the ID token.
Privacy and data minimisation
Every claim you request is personal data you must store, secure and justify. Under GDPR Article 5(1)(c) personal data must be adequate, relevant and limited to what is necessary, and Article 25 requires data protection by design and by default. See the Data Minimisation guide.
- Start with openid only: if the app needs a login and a stable key,
scope=openidis enough. - Add email when you must contact the user: store
emailas a mutable attribute and refresh it fromupdated_ator UserInfo, never as a key. - Avoid profile unless you use most of it: it releases
birthdateandgender; use theclaimsparameter to ask forgiven_namealone where the provider supports it. - Prefer pairwise subjects for consumer services so your
subvalues cannot be joined with another service's data. - Keep ID tokens out of logs and URLs: they contain personal data and, until expiry, can be replayed. See the JWT and Session Tokens in Code and Logs Guide.
- Test and roll back: change requested scopes in a staging client first, confirm the provider still returns what the app needs, and keep the previous scope list in configuration so you can revert quickly.
Detection and measurement
- Validation failures: log rejected ID tokens by reason (issuer, audience, expiry, nonce, signature); a spike in nonce or audience failures can indicate replay or token injection attempts.
- Key integrity: count user records keyed on anything other than
iss+sub; target zero. - Scope footprint: number of distinct scopes and claims requested per client, reviewed quarterly against what the code actually reads.
- Linking events: alert on automatic account links driven by email, and on
subchanges for an existing email address. - Assurance: share of privileged logins whose
acrorauth_timemeets policy.
Common failure patterns
- Email as primary key: a user changes their address, or an address is reassigned, and the wrong person inherits an account.
- Trusting email_verified from any provider: a multi-tenant provider lets a tenant set an arbitrary verified address, and the RP links it to a victim's existing account.
- Skipping aud or nonce checks: a token issued to another client, or replayed from an earlier session, is accepted.
- Treating exp as session length: the spec says the ID token expiry is unrelated to the RP session, so session policy must be set separately.
- Over-scoping by default: sample code requests
openid profile email address phone, and the app stores birth dates it never uses. - Using provider-specific claims without labelling: code written for one provider's claim breaks or becomes unsafe when another provider is added.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev. 5 | IA-2, IA-8 | Identifying and authenticating organisational and non-organisational users via federated login |
| NIST SP 800-53 Rev. 5 | AC-3 Access Enforcement | Access decisions from validated attributes, not display claims |
| NIST CSF 2.0 | PR.AA-01, PR.AA-03, PR.AA-05 | Identity management, authentication and least privilege authorisation |
| OWASP ASVS 5.0 | Chapter V10 OAuth and OIDC | Verification requirements for RPs and providers |
| GDPR | Article 5(1)(c), Article 25 | Data minimisation and data protection by design in scope choice |
Practitioner checklist
- Store users under a composite key of
issandsub; migrate any email-keyed records. - Validate
iss,aud,exp, signature andnonceon every ID token with a maintained library. - Check
azpwhen present andauth_timeoracrwhen your policy requests them. - Request
openidplus only the scopes the feature uses; review scope lists quarterly. - Never authorise on
email,preferred_usernameorname; use a validated organisation claim for tenant restrictions. - Allow email-based account linking only from trusted providers and only after the user proves control of the existing account.
- Label provider-specific claims in code and configuration, and read
claims_supportedfrom discovery. - Keep ID tokens out of logs, URLs and browser storage beyond what the flow requires.
Standards and references
- OpenID Foundation: OpenID Connect Core 1.0 incorporating errata set 2
- IETF: RFC 7519 JSON Web Token (JWT)
- IANA: JSON Web Token Claims registry
- IETF: RFC 8176 Authentication Method Reference Values
- Microsoft Learn: Secure applications and APIs by validating claims
- Google for Developers: OpenID Connect
- OWASP: Application Security Verification Standard
Related NHI Mgmt Group resources: OAuth 2.0 and OpenID Connect Guide · OAuth Claims vs Scopes · JWT Security Guide · Social Login and Account Linking Security Guide · OpenID Connect for Identity Assurance Guide