Skip to content

OIDC standard claims reference

Every standard OpenID Connect claim, plus the JWT and access token claims and those Keycloak adds, with type, meaning and scope. Searchable.

Runs in your browser. Nothing you paste is sent to us.

Claims (43)

Matches the claim name, its meaning and its scope.

iss
Issuer: who issued the token. Must equal the issuer in the discovery document. In Keycloak, https://<host>/realms/<realm>.string (URL)OIDC Core 2
sub
Subject: a stable, unique id for the user at this issuer. Use iss plus sub as the user’s key, never the email.stringOIDC Core 2
aud
Audience: who the token is for. An ID token’s aud contains the client_id.string or arrayOIDC Core 2
exp
Expiry time, in seconds since 1970 (UTC). Reject the token after it.number (seconds)OIDC Core 2
iat
Issued at, in seconds since 1970 (UTC).number (seconds)OIDC Core 2
auth_time
When the user last actually signed in. Required when the request used max_age or asked for it as an essential claim.number (seconds)OIDC Core 2
nonce
The nonce from the authorization request, copied back. The client must check it equals the value it sent, to stop replayed tokens.stringOIDC Core 2
acr
Authentication context class: how strongly the user was authenticated.stringOIDC Core 2
amr
Authentication methods used, such as pwd, otp or mfa.array of stringsOIDC Core 2; RFC 8176
azp
Authorized party: the client the token was issued to. Keycloak sets it to the client_id that asked for the token.stringOIDC Core 2
at_hash
Access token hash: the left half of the hash of the access token, Base64url. Lets the client check the access token belongs with this ID token.stringOIDC Core 3.1.3.6
c_hash
Code hash, used in the hybrid flow to bind the authorization code to the ID token.stringOIDC Core 3.3.2.11
sid
Session id at the issuer. Logout messages name the session with it.stringOIDC Front-Channel and Back-Channel Logout
name
Full name, ready to display.stringscope profileOIDC Core 5.1
given_name
Given (first) name.stringscope profileOIDC Core 5.1
family_name
Family (last) name.stringscope profileOIDC Core 5.1
middle_name
Middle name.stringscope profileOIDC Core 5.1
nickname
Casual name.stringscope profileOIDC Core 5.1
preferred_username
The name the user likes to be called, such as a username. Not unique or stable: never use it as a key.stringscope profileOIDC Core 5.1
profile
URL of the user’s profile page.string (URL)scope profileOIDC Core 5.1
picture
URL of the user’s picture.string (URL)scope profileOIDC Core 5.1
website
URL of the user’s web page or blog.string (URL)scope profileOIDC Core 5.1
gender
Gender, such as female or male, or another value.stringscope profileOIDC Core 5.1
birthdate
Birthday as YYYY-MM-DD, or YYYY, or 0000-MM-DD.stringscope profileOIDC Core 5.1
zoneinfo
Time zone, such as Europe/Paris.stringscope profileOIDC Core 5.1
locale
Locale as a BCP 47 tag, such as en-US.stringscope profileOIDC Core 5.1
updated_at
When the profile was last updated.number (seconds)scope profileOIDC Core 5.1
email
Email address. Can change and may not be verified: check email_verified, and never use it as the user’s key.stringscope emailOIDC Core 5.1
email_verified
True when the issuer verified the email address.booleanscope emailOIDC Core 5.1
address
Postal address: formatted, street_address, locality, region, postal_code, country.JSON objectscope addressOIDC Core 5.1
phone_number
Phone number, preferably E.164, such as +12025550100.stringscope phoneOIDC Core 5.1
phone_number_verified
True when the issuer verified the phone number.booleanscope phoneOIDC Core 5.1
jti
JWT id: a unique id for this token, used to spot replays.stringRFC 7519 4.1.7
nbf
Not before: reject the token before this time.number (seconds)RFC 7519 4.1.5
client_id
The client the access token was issued to.stringRFC 9068 2.2; RFC 8693 4.3
scope
The granted scopes, separated by spaces.stringRFC 9068 2.2.3; RFC 8693 4.2
cnf
Confirmation: binds the token to a key. With DPoP it holds jkt, the thumbprint of the client’s public key.JSON objectRFC 7800; RFC 9449 6
act
Actor: who is acting on behalf of the subject after a token exchange.JSON objectRFC 8693 4.1
typ
The token type Keycloak issued: Bearer for access tokens, ID for ID tokens, Refresh for refresh tokens.stringKeycloak
realm_access
Realm roles of the user, as { "roles": [...] }. Added by the roles client scope.JSON objectscope rolesKeycloak
resource_access
Client roles of the user, by client: { "<client-id>": { "roles": [...] } }. Added by the roles client scope.JSON objectscope rolesKeycloak
allowed-origins
The client’s web origins, used for CORS. Added by the web-origins client scope.array of stringsscope web-originsKeycloak
groups
Not standard. Keycloak adds it only with a Group Membership mapper or the microprofile-jwt client scope.array of stringsKeycloak

Which scope gives which claims

openid
Makes the request an OpenID Connect request: an ID token is issued.
profile
name, family_name, given_name, middle_name, nickname, preferred_username, profile, picture, website, gender, birthdate, zoneinfo, locale, updated_at
email
email, email_verified
address
address
phone
phone_number, phone_number_verified
offline_access
A refresh token that keeps working after the user’s session ends.
Where claims appear
With an access token, the server returns the requested profile claims from the UserInfo endpoint. A server may also put them in the ID token, as Keycloak does by default through its client scope mappers.
Which claim identifies the user
Use iss together with sub. email and preferred_username can change and can be reused, so they are not safe keys.

How to use it

  1. Type a claim name or a word, such as email or time.
  2. Narrow the list with a group: ID token, profile, JWT, access token or Keycloak.
  3. Check which scope asks for each profile claim.

What to know

OpenID Connect Core 1.0 defines the ID token claims (iss, sub, aud, exp, iat, nonce and more) and the standard profile claims, grouped by the scopes profile, email, address and phone.

Identify users by iss together with sub. email and preferred_username can change and can be reused.

Keycloak adds realm_access and resource_access for roles, through the roles client scope, and allowed-origins through web-origins. Since Keycloak 25, sub and auth_time come from the basic client scope.

What a claim is

A claim is one piece of information about a user or a token, written as a name and a value in a JSON object. "email_verified": true is a claim. ID tokens, JWT access tokens and UserInfo responses are all sets of claims.

Some claims describe the token itself: who issued it, who it is for, when it expires. Others describe the user: a name, an email address, a locale. The names are short on purpose, because tokens travel in headers and URLs.

Standard names let a client read any provider’s tokens the same way. OpenID Connect Core 1.0 defines the ID token claims and a set of standard profile claims. JWT itself (RFC 7519) defines a few general ones, and RFC 9068 defines how JWT access tokens use them.

Claims in the ID token

The ID token is the proof of sign-in that OpenID Connect adds to OAuth. OpenID Connect Core section 2 lists its claims. A client must validate several of them before it trusts the token.

ClaimMeaningWhat the client checks
issThe issuer.Equals the expected issuer exactly.
subA stable id for the user at this issuer.Use with iss as the user’s key.
audWho the token is for.Contains your client id.
expExpiry time in seconds since 1970.Is in the future.
iatWhen the token was issued.Is not unreasonably old.
nonceThe nonce from the authorization request.Equals the value you stored.
auth_timeWhen the user last really signed in.Fits your max_age, if you sent one.
azpThe client the token was issued to.Equals your client id when present.
acr, amrHow strongly and by which methods the user signed in.Meets your policy, if you have one.

Two more claims bind the ID token to other values. at_hash is a hash of the access token, and c_hash a hash of the code in the hybrid flow. sid names the session at the issuer and is used by the logout specifications.

Validating an ID token with its claims

OpenID Connect Core section 3.1.3.7 lists the checks a client makes before it trusts an ID token from the code flow. Most libraries do them for you, but it helps to know what they are when one fails.

  1. Verify the signature with a key from the issuer’s jwks_uri, using the algorithm you expect.
  2. Check that iss equals the issuer you configured, exactly.
  3. Check that aud contains your client id. If it holds several audiences, check azp as well.
  4. Check that exp is in the future, allowing a small clock skew.
  5. Check that nonce equals the value you stored before the redirect.
  6. If you sent max_age, check that auth_time is recent enough.

Only after these checks pass should the client read sub and the profile claims.

Standard profile claims and their scopes

OpenID Connect Core section 5.1 defines the standard claims about the user. Section 5.4 groups them under four scopes. A client asks for a group by adding its scope to the authorization request.

ScopeClaims
profilename, family_name, given_name, middle_name, nickname, preferred_username, profile, picture, website, gender, birthdate, zoneinfo, locale, updated_at
emailemail, email_verified
addressaddress (an object with formatted, street_address, locality, region, postal_code, country)
phonephone_number, phone_number_verified

Asking for a scope does not guarantee every claim. A provider returns the claims it has and the user agreed to share. A user without a phone number simply has no phone_number claim.

Claims in access tokens

OAuth does not say what an access token looks like. Many servers, Keycloak among them, issue JWT access tokens, and RFC 9068 describes a common profile for them. Besides iss, sub, aud, exp, iat and jti, it uses client_id for the client and scope for the granted scopes as a space-separated string.

Two more claims come up often. cnf binds a token to a key; with DPoP (RFC 9449) it holds jkt, the thumbprint of the client’s public key. act appears after a token exchange (RFC 8693) and names the party acting for the subject.

An API should read the access token’s claims, not the ID token’s. The ID token is for the client; the access token is for the API.

Claims Keycloak adds

Keycloak adds claims through client scopes and the protocol mappers inside them. These are the ones you will see in a default setup:

  • typ: the kind of token, such as Bearer for access tokens, ID for ID tokens and Refresh for refresh tokens.
  • realm_access: the user’s realm roles, as { "roles": [...] }, from the roles client scope.
  • resource_access: the user’s client roles, keyed by client id, also from the roles client scope.
  • allowed-origins: the client’s web origins, from the web-origins client scope.
  • azp: the client id that requested the token.

Since Keycloak 25, sub and auth_time come from the basic client scope. A groups claim is not standard; Keycloak adds it only with a Group Membership mapper or the microprofile-jwt client scope.

Made-up access token payload from a sample realm
{
  "iss": "https://auth.example.com/realms/acme",
  "sub": "1f8f4b3a-sample",
  "aud": "account",
  "exp": 1900000300,
  "iat": 1900000000,
  "typ": "Bearer",
  "azp": "web-app",
  "scope": "openid profile email",
  "realm_access": { "roles": ["user"] },
  "preferred_username": "alice"
}

What this reference does

The reference lists every claim above with its type, meaning, the scope that asks for it and the specification that defines it. You can search by name or by any word in the meaning, and narrow the list to ID token, profile, JWT, access token or Keycloak claims.

A second panel maps each standard scope to the claims it requests. It is a reference, not a decoder: to read the claims in a real token, paste it into the JWT decoder.

How to use it

  1. Type a claim name, such as auth_time, or a word, such as time or role.
  2. Pick a group to narrow the list.
  3. Read the meaning, type and scope of each claim.
  4. Check the scope panel to see which scope to add to your request for the claims you need.

Choosing claims by app type

Web apps and single-page apps

Ask for openid and only the scopes you show on screen, usually profile and email. Read the user’s details from the ID token or UserInfo, and key your user records on iss plus sub.

APIs

Authorize from the access token: aud, scope and, in Keycloak, realm_access and resource_access. Do not accept an ID token as an access token.

Machine-to-machine clients

A client credentials token describes the client, not a person. In Keycloak its subject is the client’s service account, and its roles are the service account’s roles.

Why a claim is missing

  • The scope was not requested, or the user did not grant it.
  • The user has no value for it, such as a missing phone number.
  • In Keycloak, no mapper adds it, or the mapper is not set to add it to this token type. Mappers have separate switches for the ID token, the access token and UserInfo.
  • The client scope that holds the mapper is not assigned to the client, or is optional and was not requested.
  • You are reading the wrong token: an ID token claim will not appear in the access token unless a mapper puts it there.

Mistakes to avoid

  • Using email or preferred_username as the user’s key. Both can change, and an address can be reused. Use iss with sub.
  • Trusting email without checking email_verified.
  • Skipping aud checks, which lets a token meant for another client or API work in yours.
  • Reading claims without verifying the signature first.
  • Putting large or private data into tokens. Tokens travel with every request and are readable by anyone who holds them.

RFC 9700 recommends access tokens that are restricted to one audience. Checking aud is how an API enforces that.

Questions

Frequently asked questions

What are the standard OpenID Connect claims?

OpenID Connect Core 1.0 section 5.1 defines them: name, given_name, family_name, middle_name, nickname, preferred_username, profile, picture, website, email, email_verified, gender, birthdate, zoneinfo, locale, phone_number, phone_number_verified, address and updated_at. sub is the one claim that is always present.

Which scope gives me the email claim?

The email scope. It requests email and email_verified.

What is the difference between sub and preferred_username?

sub is a stable, unique id for the user at the issuer and never changes. preferred_username is a display value that can change and is not guaranteed unique. Key users on iss plus sub.

What is the difference between azp and aud?

aud is who the token is for. azp is the client the token was issued to. In an ID token they usually name the same client.

Where are roles in a Keycloak token?

Realm roles are in realm_access.roles and client roles in resource_access.<client-id>.roles. Both come from the roles client scope.

Why is a claim missing from my Keycloak token?

Its scope was not requested or granted, or no mapper adds it to that token type. Check the client’s client scopes, their mappers, and the mapper switches for ID token, access token and UserInfo.

What does auth_time mean?

It is the time the user last actually signed in, in seconds since 1970. It can be older than iat when a token was issued from an existing session.

Is the groups claim standard?

No. It is not part of OpenID Connect Core. Keycloak adds it with a Group Membership mapper or the microprofile-jwt client scope.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.