Skip to main content

Scopes and Claims

Standard OIDC scopes​

ScopeDescriptionReturned claims
openidRequired. Indicates an OIDC authentication request.sub (user GUID)
profileBasic user profile informationname, given_name, family_name
emailThe user's email addressemail, email_verified
phoneThe user's phone numberphone_number, phone_number_verified
addressThe user's postal addressaddress object
offline_accessRequest a refresh token(enables refresh tokens)

API scope​

ScopeDescriptionUsage
apiAccess to the service APIManaging users, sessions, 2FA
M2M (Machine-to-Machine) only

The api scope is intended exclusively for the Client Credentials flow (service-to-service communication). User tokens obtained via the Authorization Code Flow cannot access the API endpoints.

The /api/* service endpoints require:

  1. A token obtained via the Client Credentials flow
  2. The api scope
  3. A token whose sub equals the client_id (which is a property of Client Credentials flow tokens)

User tokens (Authorization Code Flow) do not meet this condition, and therefore cannot call the /api/* management endpoints.

Claims overview​

Claims in the ID token​

The ID token always contains:

ClaimDescriptionExample
issToken issuerhttps://your-sso-domain.com/
subUser identifier (GUID)550e8400-e29b-41d4-a716-446655440000
audIntended audience (client_id)my-app
expExpiration time (Unix timestamp)1704067200
iatIssued-at time (Unix timestamp)1704065400
nonceValue for replay protectionabc123

Profile claims (scope: profile)​

ClaimDescriptionExample
nameFull nameJan Novák
given_nameFirst nameJan
family_nameLast nameNovák

Email claims (scope: email)​

ClaimDescriptionExample
emailEmail addressjan@example.com
email_verifiedWhether the email is verifiedtrue

Phone claims (scope: phone)​

ClaimDescriptionExample
phone_numberPhone number+420123456789
phone_number_verifiedWhether the phone is verifiedtrue

Address claims (scope: address)​

ClaimDescriptionExample
address.street_addressStreet and numberHlavní 123
address.localityCityPraha
address.postal_codePostal code11000

Other claims​

ClaimDescriptionPossible values
roleThe user's roleUser, Cashier, Administrator, SuperAdministrator
The role claim is always present

The role claim is emitted always – in both the access token and the ID token – regardless of the requested scopes. There is no roles scope that would control this behavior.

Example: Decoded ID token​

{
"iss": "https://your-sso-domain.com/",
"sub": "550e8400-e29b-41d4-a716-446655440000",
"aud": "my-app",
"exp": 1704067200,
"iat": 1704065400,
"nonce": "abc123",
"name": "Jan Novák",
"given_name": "Jan",
"family_name": "Novák",
"email": "jan@example.com",
"email_verified": true,
"role": "User"
}

Example: UserInfo response​

Request:

curl https://your-sso-domain.com/connect/userinfo \
-H "Authorization: Bearer ACCESS_TOKEN"

Response:

{
"sub": "550e8400-e29b-41d4-a716-446655440000",
"name": "Jan Novák",
"given_name": "Jan",
"family_name": "Novák",
"email": "jan@example.com",
"email_verified": true,
"phone_number": "+420123456789",
"phone_number_verified": true,
"address": {
"street_address": "Hlavní 123",
"locality": "Praha",
"postal_code": "11000"
},
"role": "User"
}

Requesting scopes​

Include the requested scopes in the authorization request:

scope=openid profile email offline_access
Best practice

Request only the scopes your application actually needs. Users are more likely to grant consent when fewer permissions are requested.