Skip to main content

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:

  1. The application generates authentication state, nonce, and PKCE values.
  2. The application redirects the user to the authorization endpoint.
  3. The user completes authentication.
  4. Zanthem Identity Services redirects the user to the registered callback URI.
  5. The application verifies the returned state.
  6. The application exchanges the authorization code for tokens.
  7. The application validates the returned ID token and establishes its local session.

Request Parameters​

ParameterRequiredDescription
client_idYesAssigned application client identifier.
response_typeYesSet to code.
redirect_uriYesApproved application callback URI.
scopeYesInclude openid for OIDC authentication.
stateRecommendedRandom value used to correlate requests and protect against CSRF.
nonceRecommendedRandom value used to associate the ID token with the authentication request.
code_challengeYes for PKCEDerived from the generated PKCE verifier.
code_challenge_methodYes for PKCESet to S256.
promptNoControls authentication interaction where supported.
login_hintNoProvides an optional user identifier hint.
max_ageNoSpecifies 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​

ParameterDescription
codeTemporary authorization code.
stateState originally supplied by the application.
session_stateSession identifier, when included.
issIssuer 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.

ScopeDescription
openidEnables OpenID Connect authentication.
profileRequests standard profile information.
emailRequests email-related claims.
phoneRequests phone-related claims, where configured.
offline_accessRequests 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.