Authorization Endpoint
The authorization endpoint initiates authentication through Zanthem Identity Services.
Applications redirect users to the assigned realm's authentication interface. User credentials and additional authentication factors are handled by Zanthem Identity Services according to the configured authentication policy.
Following successful authentication, the user is redirected to the application's approved callback address.
Endpoint
GET
https://auth.zanthem.cloud/realms/{realm}/protocol/openid-connect/auth
Authorization Code Flow
Applications should use the Authorization Code flow with Proof Key for Code Exchange (PKCE).
The authentication process consists of:
- The application generates authentication state, nonce, and PKCE values.
- The application redirects the user to the authorization endpoint.
- The user completes authentication.
- Zanthem Identity Services redirects the user to the registered callback URI.
- The application verifies the returned state.
- The application exchanges the authorization code for tokens.
- The application validates the returned ID token and establishes its local session.
Request Parameters
| Parameter | Required | Description |
|---|---|---|
client_id | Yes | Assigned application client identifier. |
response_type | Yes | Set to code. |
redirect_uri | Yes | Approved application callback URI. |
scope | Yes | Include openid for OIDC authentication. |
state | Recommended | Random value used to correlate requests and protect against CSRF. |
nonce | Recommended | Random value used to associate the ID token with the authentication request. |
code_challenge | Yes for PKCE | Derived from the generated PKCE verifier. |
code_challenge_method | Yes for PKCE | Set to S256. |
prompt | No | Controls authentication interaction where supported. |
login_hint | No | Provides an optional user identifier hint. |
max_age | No | Specifies the maximum acceptable authentication age. |
Applications should always generate and validate
state and nonce when using the flow described
in this guide.
Example Authorization Request
https://auth.zanthem.cloud/realms/example-company/protocol/openid-connect/auth
?client_id=example-app
&response_type=code
&redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback
&scope=openid%20profile%20email
&state=GENERATED_STATE
&nonce=GENERATED_NONCE
&code_challenge=GENERATED_CHALLENGE
&code_challenge_method=S256
The request is displayed across multiple lines for readability.
All query parameter values must be correctly URL encoded.
The generated state, nonce, and challenge values must be unique to each authentication transaction.
PKCE
Proof Key for Code Exchange protects authorization codes against interception and unauthorized exchange.
The application generates a cryptographically random
code_verifier before initiating authentication.
The verifier must contain between 43 and 128 characters using the permitted PKCE character set.
The application derives the challenge using:
BASE64URL(SHA256(code_verifier))
Base64 URL encoding must omit padding.
The resulting challenge is included in the authorization request. The original verifier is retained securely until the application exchanges the authorization code.
:::warning PKCE security
Do not reuse PKCE verifiers between authentication transactions. Use the S256 challenge method.
:::
Authentication Response
After successful authentication, the user is redirected to the approved callback URI.
Example Callback
https://app.example.com/callback?code=AUTHORIZATION_CODE&state=GENERATED_STATE
Additional parameters may be included in the response.
Response Parameters
| Parameter | Description |
|---|---|
code | Temporary authorization code. |
state | State originally supplied by the application. |
session_state | Session identifier, when included. |
iss | Issuer identifier, when included. |
Applications must verify that the returned state matches the state associated with the original request.
If an issuer parameter is returned, verify that it matches the expected issuer.
The authorization code must then be exchanged through the token endpoint.
Authorization codes are temporary and intended for single use.
Authentication Scopes
Scopes determine which identity information and capabilities are requested by the application.
| Scope | Description |
|---|---|
openid | Enables OpenID Connect authentication. |
profile | Requests standard profile information. |
email | Requests email-related claims. |
phone | Requests phone-related claims, where configured. |
offline_access | Requests offline access, where permitted. |
Requested scopes remain subject to the permissions and policies configured for the application client.
Redirect URIs
Redirect URIs must be registered with Zanthem before they can be used.
Production applications should use HTTPS and explicitly registered callback addresses.
Contact your account manager to add or modify approved redirect URIs.
Authentication Failures
If authentication cannot be completed, the application may receive an error response through its callback URI.
https://app.example.com/callback?error=access_denied&state=GENERATED_STATE
Some request validation failures may instead be displayed directly by the authentication service.
Applications must handle both successful and unsuccessful authentication outcomes.