User Information Endpoint
The user information endpoint allows applications to retrieve identity and profile information associated with an authenticated user.
The information returned depends on the scopes, permissions, and claim mappings configured for the application client.
Endpoint
GET or POST
https://auth.zanthem.cloud/realms/{realm}/protocol/openid-connect/userinfo
Authentication
Requests require a valid access token associated with an OpenID Connect user authentication session.
Authorization: Bearer ACCESS_TOKEN
The token must have been issued by the appropriate authentication realm and authorized for the request.
Example Request
curl --request GET \
"https://auth.zanthem.cloud/realms/example-company/protocol/openid-connect/userinfo" \
--header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/json"
Example Response
{
"sub": "2d9174cc-4c53-4b39-8e35-8b6c34a80f24",
"preferred_username": "example.user",
"given_name": "Example",
"family_name": "User",
"name": "Example User",
"email_verified": true
}
The response is illustrative. Individual claims may be omitted or supplemented according to the configuration of the application.
Standard Identity Claims
| Claim | Description |
|---|---|
sub | Subject identifier representing the authenticated user. |
preferred_username | Preferred account username. |
name | Full display name. |
given_name | Given or first name. |
family_name | Family or last name. |
email | Email address. |
email_verified | Indicates whether the email address has been verified. |
phone_number | Phone number, where available. |
phone_number_verified | Indicates whether the phone number has been verified. |
locale | User locale, where available. |
Applications must not assume that optional claims will always be present.
Identifying Users
Applications should identify users using the combination of the authentication issuer and subject identifier.
issuer + subject
For example:
{
"issuer": "https://auth.zanthem.cloud/realms/example-company",
"subject": "2d9174cc-4c53-4b39-8e35-8b6c34a80f24"
}
Email addresses, usernames, and phone numbers may change and should not be used as permanent identity identifiers.
Applications must verify that the sub claim returned
by the user information endpoint matches the sub
claim contained in the validated ID token.
Requesting Profile Information
Applications can request additional identity information by including approved scopes in the initial authorization request.
| Scope | Requested Information |
|---|---|
openid | Subject identification. |
profile | Standard profile claims. |
email | Email address and verification status. |
phone | Phone number and verification status. |
The presence of a requested scope does not guarantee that all related claims will be returned.
Custom Claims
Additional claims may be configured for an application where required and approved.
Custom claims may include organization identifiers, application-specific attributes, or other authorized identity information.
Contact your Zanthem account manager to discuss additional claim requirements.
Applications should not rely on undocumented custom claims.
Application Authorization
Identity information establishes who the authenticated user is. It does not automatically establish which application resources the user is permitted to access.
Applications remain responsible for enforcing their own authorization policies, including:
- Application-specific roles
- Resource permissions
- Organization membership
- Tenant boundaries
- Administrative privileges
Claims supplied by Zanthem Identity Services may support these decisions where explicitly configured.
Handling User Information
Applications should only retain identity information necessary for their intended functionality.
Avoid unnecessarily storing, logging, or distributing personally identifiable information.
Applications should accommodate changes to user profile attributes over time.
Error Responses
| HTTP Status | Description |
|---|---|
200 OK | User information returned successfully. |
400 Bad Request | Invalid or malformed request. |
401 Unauthorized | Missing, expired, or invalid access token. |
403 Forbidden | The request is not permitted. |