What is OpenID Connect OIDC?

OpenID Connect, usually shortened to OIDC, is an identity layer built on OAuth 2.0. It lets an application verify a user's identity based on authentication performed by a trusted identity provider, and receive selected identity information in a standard way.
When you choose a supported sign-in provider, the application can rely on a validated ID token rather than collecting that provider's password itself. The application still needs its own account mapping, session management and access rules. A successful sign-in does not automatically permit every action.
The OpenID Connect Core specification defines the authentication flows, ID token and validation requirements. Its current errata set was published in December 2023.
How OpenID Connect works
The application is called the relying party or client. The identity service is the OpenID Provider. Before sign-in, the application needs a trust configuration that identifies the provider, client registration and permitted redirect addresses. It must not accept identity claims from an arbitrary provider simply because the response looks like a token.
The illustration shows a simplified OIDC sign-in: the application requests authentication, the provider authenticates the user, the application validates the identity information and then applies its own permissions.

The application sends an authentication request to the configured provider, including the openid scope.
The provider authenticates the user or uses an existing session that meets the request and policy.
In an authorisation-code flow, the provider returns a code to the registered redirect address.
The application exchanges the code at the token endpoint, with PKCE and client authentication where applicable.
The application validates the ID token and associates the identity with the correct local account.
The application establishes its session and enforces its own permissions.
The precise steps vary by client and provider. A provider can require a fresh authentication or stronger checks, so single sign on does not promise that every visit avoids a prompt. The application and provider can also maintain separate sessions.
OIDC and OAuth: what is the difference?
OAuth is primarily an authorisation framework for limited access to protected resources. OIDC adds a standard way for a client to obtain and validate information about the user's authentication. The OAuth access token and OIDC ID token serve different audiences and purposes.
Item | Main purpose | Typical recipient |
|---|---|---|
ID token | Communicates authentication claims to the client | The relying application |
Access token | Authorises access to a protected resource | The intended API |
Refresh token | Obtains replacement tokens when supported | The provider's token endpoint |
An access token is not necessarily a JWT, and decoding any token is not proof that it is valid. Do not use an ID token as a general-purpose API access token, or treat an arbitrary OAuth access token as a standard OIDC login response.
What is in an ID token?
An ID token is a JSON Web Token containing claims about the authentication. The issuer identifies the provider, the subject identifies the user within that issuer, the audience identifies intended clients, and expiry limits when the token can be accepted. Other claims depend on the request, provider and policy.
The issuer and subject together are the stable identifier a relying party can use for that provider relationship. Email addresses and display names can change or be reassigned. Matching accounts from different providers on email alone can create an account takeover risk, so account linking needs explicit, verified rules.
The application must perform the checks required by its chosen flow and profile, including issuer, audience, expiry, applicable signature and algorithm checks, and nonce validation when a nonce was sent. It also needs transaction correlation and proper redirect handling. Use a maintained OIDC library and current provider documentation rather than writing a token validator from scratch.
PKCE, state and nonce
PKCE binds an authorisation request to the subsequent code exchange using a verifier and derived challenge. It helps prevent misuse of intercepted or injected authorisation codes. The verifier must be fresh for each transaction, and S256 is the usual secure challenge method.
The OAuth Security Best Current Practice, RFC 9700, requires public clients to use PKCE in the relevant code flow and recommends it for confidential clients. It also sets out conditions for protection against request forgery and authorisation-server mix-up. PKCE does not make a client secret embedded in a browser or mobile app confidential.
State can bind a response to the user's transaction and carry application state when properly protected. An OIDC nonce binds an ID token to the authentication request and, when used, must be checked. These mechanisms have related but distinct roles. Their exact use depends on the protocol flow and security profile; none replaces the other checks automatically.
Discovery and key management
OIDC discovery can provide metadata including the issuer, endpoints and signing-key location. The OpenID Connect Discovery specification describes how clients obtain and validate this information.
Discovery is not a reason to trust any URL supplied by a user. Configure or otherwise establish trusted issuers, verify metadata and use secure transport. Signing keys can rotate, so clients need a safe way to refresh trusted keys without accepting a key merely because an untrusted token names it. Incorrect metadata or an unmanaged key rollover can break sign-in.
OIDC, identity providers and SSO
An identity provider authenticates users and provides identity information to connected applications. OIDC is one protocol that can support that relationship. SAML is another federation approach, with different formats and integration requirements.
Single sign on describes an arrangement in which connected applications can rely on a common sign-in. OIDC can support SSO, but an application's session remains distinct from the provider's session. A user may have to authenticate again when policy, expiry or risk requires it.
Authorisation remains separate. The application must decide whether the authenticated user may read a particular customer's report or change a configuration. Claims can inform that decision, but stale groups or broad roles can still result in excessive access.
A practical UK support example
Imagine a UK support business with a case portal and a monitoring application. This is an illustrative design, not a tested configuration. Both applications trust the organisation's provider and use a code flow with appropriate protections.
Situation | Intended result | Check |
|---|---|---|
Engineer opens the case portal | Establish the correct local session | Validate token and map issuer plus subject |
Engineer opens the monitoring app | Reuse a suitable provider session | Apply that application's permissions |
User changes team | Remove access no longer needed | Review claims, local grants and active sessions |
Provider is unavailable | Follow the continuity plan | Test existing sessions and emergency access |
A valid ID token for the case portal should not be accepted as if it were issued for the monitoring application. Likewise, an authenticated support engineer should not gain access to another customer's records simply because both applications trust the same provider.
Sessions, logout and account removal
The provider's session, the application's session and any access or refresh tokens have separate lifecycles. Signing out of one application does not necessarily end all other sessions. Wider logout depends on supported protocols, configuration and application behaviour.
Disabling an account can prevent new authentication without immediately ending every existing application session or invalidating every token. Test actual revocation, expiry, token refresh and cache behaviour. OIDC is not a guarantee of instant removal from every connected service.
Provisioning is a related but separate concern. An application might create a local account at first sign-in or receive users and groups through another integration. Include local accounts, API credentials and recovery paths when reviewing joiners, role changes and departures.
Security and privacy considerations
Protect the provider and its administrators because a compromised account, signing key or trust configuration can affect multiple applications. Use appropriate strong authentication, restrict changes to integrations and monitor important sign-in and configuration events.
Request and retain only the identity claims the application needs. Claims and diagnostic logs can contain personal information, and live tokens or session cookies may be usable credentials. Avoid putting them in public support tickets, screenshots or application logs.
Account recovery and availability matter as much as normal sign-in. A provider outage can block new authentication, while some existing application sessions continue until their own policies require reauthentication. Test recovery and tightly controlled emergency access rather than assuming every application will behave the same way.
How to test an OIDC integration
Confirm the trusted issuer, client registration and exact redirect addresses.
Use the supported code flow and transaction protections for the client type.
Test ID token validation, including wrong issuer, wrong audience, expiry and nonce where applicable.
Confirm account mapping uses an appropriate stable identifier and handles multiple providers safely.
Test successful and denied access to specific application resources.
Test key rollover, session expiry, logout, account suspension and token revocation.
Record expected results and repeat tests when the provider or application configuration changes.
Use authorised test accounts and non-sensitive data. A successful login proves only that one path worked at that time. A thorough review also checks rejected messages, alternative sign-in paths and the application's own permissions.
Common OIDC problems
Redirect mismatch: the return address does not match the registered configuration.
Invalid issuer or audience: the token is not intended for the configured provider and client relationship.
Key rollover failure: the application cannot obtain or use the current trusted signing keys.
Wrong local account: identity mapping or account linking associates the response with the wrong user.
Login succeeds but access fails: application assignment or permissions are missing.
Logout appears incomplete: the provider and application sessions have different lifecycles.
Trace the provider, client and application logs together using non-sensitive correlation details. Keep live tokens and secrets out of diagnostic messages. Identify whether the issue is authentication, token validation, mapping or authorisation before changing security settings.
Key takeaway
OpenID Connect gives applications a standard way to rely on a provider's authentication. The application must still validate the identity response, map the correct account, enforce permissions and manage sessions safely.
Frequently asked questions
What does OIDC stand for?
OIDC stands for OpenID Connect, an identity layer built on OAuth 2.0.
Is OpenID Connect the same as OAuth?
No. OAuth primarily provides delegated access; OpenID Connect adds standard user authentication and identity claims on top of OAuth 2.0.
What is an ID token?
An ID token is a JSON Web Token containing claims about an authentication event for the relying application to validate.
Can I use an ID token to call any API?
No. An ID token is intended for the relying client. An API should receive and validate an appropriate access token for that API.
Does OIDC replace MFA?
No. The identity provider can use MFA as part of authentication, but OIDC does not by itself guarantee a particular authentication method.
Does OIDC automatically sign me out everywhere?
No. Provider and application sessions are separate, and wider logout depends on support and configuration.
Is an email address a reliable OIDC user identifier?
Not by itself. Email addresses can change or be reassigned; the issuer and subject combination is the stable identifier defined for the provider relationship.

