Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is OpenID Connect?

OpenID Connect adds an identity layer to OAuth 2.0. It returns a signed identity token containing verified claims about the user, which OAuth alone never did.

Illustration for the cybersecurity term OpenID Connect
Home / Blog / Cybersecurity Terms / What Is OpenID Connect?
17 November 2026

What Is OpenID Connect?

What Is OpenID Connect?

OAuth 2.0 answers the question “may this application do that?” It never answers “who is this person?” For years developers tried to infer identity from an access token by calling some profile API and trusting whatever came back, which produced a steady supply of account takeover vulnerabilities. OpenID Connect, published by the OpenID Foundation in 2014, fixed that properly by adding a token whose entire purpose is to assert identity.

What It Adds

Three things, essentially.

A Sign-In, Step by Step

  1. The application redirects the browser to the authorisation endpoint with response_type=code, scope=openid profile email, a random state, a random nonce, and a PKCE code challenge.
  2. The provider authenticates the user—password, passkey, whatever policy requires—and records consent if needed.
  3. The browser returns to the registered redirect URI with an authorisation code.
  4. The application exchanges the code at the token endpoint, presenting its PKCE code verifier, and receives an identity token, an access token, and usually a refresh token.
  5. The application validates the identity token and establishes its own session.

That validation step is where implementations fail, and it is not optional. Verify the signature against a key fetched from the provider’s key set. Confirm the issuer matches exactly. Confirm the audience is your client identifier. Confirm the expiry has not passed. Confirm the nonce equals the one you generated and stored in the user’s session—this is what prevents an identity token obtained elsewhere being replayed into your application.

The Mistakes That Cause Takeover

Trusting the email claim as an identifier. Email addresses change and are reassigned. Worse, some providers will return an email claim with email_verified false, and an application that matches accounts on email alone lets an attacker register an address they do not control and inherit the matching account. Key your accounts on the issuer and subject pair, and treat email as a display attribute.

Accepting tokens from the wrong issuer. In multi-tenant scenarios, particularly Microsoft’s common endpoint, a token from any tenant will validate cryptographically. Check the tenant identifier as well as the signature.

Using the implicit flow. Returning tokens directly in the URL fragment exposes them to browser history, referrer leakage, and any script on the page. Use the authorisation code flow with PKCE for every client type.

Confusing the two tokens. The identity token is for your application and proves who signed in. The access token is for an API and proves what may be done. Sending an identity token to an API, or using an access token to establish a session, are both common and both wrong.

Where You Meet It

OpenID Connect is the protocol behind “sign in with” buttons, behind Microsoft Entra ID and Okta integrations for modern applications, and behind the UK’s own identity initiatives—GOV.UK One Login uses it, as do most of the digital identity providers certified against the UK digital identity and attributes trust framework.

It is also the default for workload authentication in CI/CD. GitHub Actions, GitLab, and similar platforms can present an OIDC token to a cloud provider, which exchanges it for short-lived credentials. That removes the long-lived cloud access keys that used to sit in pipeline secrets, and it is one of the highest-value changes available to a platform team, connecting directly to machine identity practice.

Compared with SAML, OpenID Connect is easier to implement correctly, better suited to mobile and single-page applications, and built on JSON rather than XML signature processing, which has a long history of parsing vulnerabilities. SAML remains widespread in enterprise software, so most organisations operate both and let the identity provider translate between them, as discussed in federated identity management.

At Privia Security, we test single sign-on implementations and their token validation logic in our web application security services.

FAQ – Frequently Asked Questions

What Is the Difference Between OAuth 2.0 and OpenID Connect?

OAuth 2.0 is about authorisation: it issues access tokens that tell an API what an application may do. OpenID Connect is a layer on top that adds authentication, returning a signed identity token with validated claims about who the user is and how they authenticated. If you need to know who signed in, you need OpenID Connect.

Why Should I Not Match Accounts on Email Address?

Because email addresses change, get reassigned after someone leaves, and in some providers can be returned unverified. An attacker who registers an address they do not control at a permissive provider could then claim the matching account in your application. Use the issuer and subject pair as the account key, and treat email as display information only.

What Does the Nonce Do?

The client generates a random nonce, sends it in the authorisation request, and stores it in the user’s session. The identity token comes back containing that value, and the client checks it matches. This binds the token to the specific sign-in attempt and session, preventing an identity token obtained elsewhere from being injected into your application.

Can I Use OpenID Connect for CI/CD Pipelines?

Yes, and it is one of the better reasons to adopt it. Platforms such as GitHub Actions can present a short-lived OIDC token to a cloud provider, which verifies it and issues temporary credentials scoped to that workflow. This removes long-lived cloud access keys from pipeline secrets entirely, along with the rotation and leakage problems that come with them.

Related Terms

You May Be Interested In These