Skip to main content

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": "[email protected]",
"email_verified": true
}

The response is illustrative. Individual claims may be omitted or supplemented according to the configuration of the application.

Standard Identity Claims​

ClaimDescription
subSubject identifier representing the authenticated user.
preferred_usernamePreferred account username.
nameFull display name.
given_nameGiven or first name.
family_nameFamily or last name.
emailEmail address.
email_verifiedIndicates whether the email address has been verified.
phone_numberPhone number, where available.
phone_number_verifiedIndicates whether the phone number has been verified.
localeUser 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.

ScopeRequested Information
openidSubject identification.
profileStandard profile claims.
emailEmail address and verification status.
phonePhone 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 StatusDescription
200 OKUser information returned successfully.
400 Bad RequestInvalid or malformed request.
401 UnauthorizedMissing, expired, or invalid access token.
403 ForbiddenThe request is not permitted.