Authentication

How it works

Ver.iD Authentication is an OpenID Provider. It lets customers sign in to your platform with a digital identity wallet through a standard OpenID Connect client.

Authentication uses the Authorization Code flow. Ver.iD only supports the code response type for this flow.

Tokens

The token endpoint returns two tokens with different purposes:

TokenFormatPurpose
ID tokenSigned JWTAuthenticates the customer and contains identity claims. Validate it before using its claims.
Access tokenOpaque bearer tokenAuthorizes a request to the UserInfo endpoint. Do not decode it or use it as proof of identity.

Authentication flow

  1. Create a new login transaction with a random state, nonce, and PKCE code verifier.
  2. Redirect the customer to the authorization endpoint. Send response_type=code, scope=openid with at least one configured scope, the redirect URI, state, nonce, and an S256 PKCE code challenge.
  3. The customer chooses a digital identity wallet and completes the authentication request.
  4. Ver.iD returns an authorization code and the original state to your redirect URI.
  5. Compare the returned state with the value stored for the login transaction. Stop if they do not match.
  6. Exchange the code at the token endpoint. Send the PKCE code verifier. Confidential clients must also authenticate with their client secret.
  7. Ver.iD returns an ID token and an access token.
  8. Validate the ID token before creating a session or using any claims.

Client security

Use S256 PKCE for every client.

Client typeRequirements
Public clientUse PKCE. A public client cannot keep a client secret.
Confidential clientKeep the client secret on a trusted server. Use PKCE and authenticate at the token endpoint with the client secret.

Never put a client secret in browser or mobile application code. Register exact redirect URIs, and create new state, nonce, and PKCE values for every authentication request.

Validate the ID token

Use a maintained OpenID Connect library to validate ID tokens. Do not only decode the JWT. The validation must:

  • Verify the signature with a key from the discovery document's jwks_uri.
  • Accept only the advertised signing algorithm.
  • Confirm that iss exactly matches the expected issuer.
  • Confirm that aud contains your client ID.
  • Confirm that exp has not passed and that the token time claims are valid.
  • Compare nonce with the value stored for the login transaction.
  • Require sub and use it as the customer's pairwise identifier for this client.

Only create the customer session after all checks succeed.

Account identifiers and continuity

Store the validated (iss, sub) pair as the external account key. Treat sub as opaque; do not calculate it from wallet claims or use email as an account key.

The current authentication implementation derives sub from the client identifier, a provider-managed salt and selected identity claims in the returned payload. These can include names, email, phone number, company, national identifier, address and birth details. Only claims present in that payload contribute their values.

This has consequences for account continuity:

  • A different client identifier produces a different sub for otherwise identical inputs. Replacing a Studio authentication with a new client needs an account-migration plan.
  • Changing requested scopes, flow mappings or wallet data can change the identity claims used to derive sub. Correcting an email, replacing a phone number or changing an address can therefore produce a different sub.
  • Switching wallets preserves sub only if the resulting identity inputs, client identifier and provider salt remain identical. Credential renewal alone does not guarantee continuity.
  • Changing the provider salt can change sub. An issuer change changes the (iss, sub) account key even if sub stays the same.

sub is not a guaranteed unique legal-person identifier: identical identity inputs for the same client and salt produce the same value. Do not use it alone as evidence that two logins belong to the same legal person.

Before changing an existing login configuration, test repeat login and account continuity with controlled accounts. To attach a new external key to an existing account, authenticate that local account and require explicit authorization for the link. Prevent an external key already linked to one account from being attached to another. Never merge or recover accounts automatically by matching email, name or other profile claims.

When Keycloak brokers the connection, applications receive Keycloak's issuer and subject. Keep both the upstream Ver.iD identity association and the downstream Keycloak account stable; the broker does not remove the upstream continuity limits.

Discovery

Use the issuer URL shown in Studio to load the OpenID Connect discovery document:

{issuer}/.well-known/openid-configuration

The document contains the authorization, token, UserInfo, intent, and JSON Web Key endpoints. It also describes the supported protocol features. Confirm that the returned issuer exactly matches the issuer URL you expected.

Scopes

Every authentication request must include openid and at least one additional scope configured for the authentication in Studio. The available scopes depend on the selected digital identity wallets and configuration. Only request the information your platform needs.

Supported protocol

FeatureSupported value
Response typecode
Grant typeauthorization_code
PKCE methodS256
ID token signing algorithmES384
Subject typepairwise
Client typesPublic and confidential

Specifications

On this page