Skip to content

Glossary drawing · Security & identity

OpenID Connect(OIDC)

Also called: OpenID Connect 1.0 · OIDC SSO · OIDC login

Note 1 —An identity layer on top of OAuth 2.0 that returns a signed ID token saying who the user is, used for single sign-on and sign-in-with buttons.

Term
OpenID Connect
Abbreviation
OIDC
Category
Security & identity
Level
Practitioner
Reviewed
Sheet no.
GLO-SEC-344
Drawn by
InfiQ Glossary

Drawing 1 · Interactive

Access or identity: which one do you need?

8 / 8

OAuth 2.0

Delegates access: what may this app do?

OpenID Connect

Adds identity: who just signed in?

  1. OAuth 2.0May this app call this API?
    OpenID ConnectWho is the user, and when did they authenticate?
  2. OAuth 2.0Access token, sent to the API
    OpenID ConnectID token, read by your app
  3. OAuth 2.0Opaque or JWT, up to the server
    OpenID ConnectAlways a signed JWT
  4. OAuth 2.0Any scopes, e.g. whatsapp_business_messaging
    OpenID ConnectThe openid scope (plus email, profile)
  5. OAuth 2.0The resource server or API
    OpenID ConnectYour client_id
  6. OAuth 2.0state and PKCE
    OpenID Connectstate, PKCE and a nonce inside the ID token
  7. OAuth 2.0Embedded Signup granting WABA access
    OpenID ConnectAgents signing in to the team inbox via SSO

Verdict

Use OAuth when an app must act on someone's account; add OpenID Connect when the app must know who the person is.

OAuth 2.0 and OpenID Connect side by side, row by row: what each token is for, who it is addressed to and where each shows up in a WhatsApp business.

Verdict: Use OAuth when an app must act on someone's account; add OpenID Connect when the app must know who the person is.

What is OpenID Connect (OIDC)?

OpenID Connect (OIDC) is an identity layer built on top of OAuth 2.0. Where OAuth only delegates access ("this app may call that API"), OIDC also authenticates: the identity provider returns an ID token, a signed JSON Web Token (JWT) stating who the user is (sub), who issued the statement (iss), which app it is for (aud), when the person authenticated (auth_time) and when the token expires (exp). OpenID Connect Core 1.0 was finalised by the OpenID Foundation in 2014 and sits behind most sign-in-with buttons and modern Single Sign-On (SSO).

The flow is an OAuth authorisation code flow with additions. The app adds openid to the scope (plus email or profile if it needs those claims), a random nonce and ideally PKCE. After the user authenticates at the identity provider, the app exchanges the code at the token endpoint and receives an id_token alongside the access_token. Providers publish their endpoints and signing keys in a discovery document at /.well-known/openid-configuration, so clients can find the jwks_uri they need to verify signatures.

For a business running WhatsApp at scale, OIDC usually appears in two places: staff signing in to the messaging dashboard or team inbox with their company identity provider, and customer apps offering sign-in with an existing account. It is not how Embedded Signup works; that flow uses OAuth to grant access to WhatsApp assets, not to start a user session. Compared with Security Assertion Markup Language (SAML), OIDC uses compact JSON tokens over plain HTTPS redirects, which suits mobile and single-page apps.

Key takeaways

  • OpenID Connect (OIDC) is an identity layer on OAuth 2.0: it tells your app who signed in through a signed ID token.
  • Adding the openid scope turns an OAuth authorisation request into an OIDC sign-in.
  • Validate every ID token: signature against the provider's JWKS, then iss, aud, exp and the nonce you sent.
  • Use the ID token to sign the user in and the access token to call APIs, never the other way round.
  • OIDC is the modern default for staff single sign-on to messaging dashboards; SAML remains common in older enterprise setups.

Specifications

OpenID Connect (OIDC): key facts and limits

Built on
OAuth 2.0 authorisation code flow
What turns it on
openid in the scope parameter
Identity proof
ID token: always a signed JWT
Claims to check
Signature, iss, aud, exp, nonce
Discovery document
/.well-known/openid-configuration
Stable user key
iss + sub (sub is unique per issuer)
Specification
OpenID Connect Core 1.0 (2014)

Operating sequence

How does OpenID Connect (OIDC) work?

  1. Register the client

    Register your app with the identity provider to get a client_id (and a secret for server-side apps), and allow-list the exact redirect_uri the provider may send users back to.

  2. Send an authentication request

    Redirect to the authorization_endpoint with response_type=code, scope=openid email, a random state, a random nonce and a PKCE code_challenge.

  3. Exchange the code

    On the callback, check state, then POST the code and the code_verifier to the token_endpoint. The response holds an id_token, an access_token and often a refresh_token.

  4. Validate the ID token

    Verify the signature with a key from the provider's jwks_uri, then check that iss equals the issuer, aud contains your client_id, exp is in the future and nonce matches the value you stored.

  5. Create your own session

    Map the stable iss + sub pair (not the email) to a user record, start your app's session, and keep the access token for calls to the provider's APIs or its UserInfo endpoint.

Implementation

OpenID Connect (OIDC) in code

import { createRemoteJWKSet, jwtVerify } from "jose";
// Read the issuer's endpoints from its discovery document once at start-up.
const ISSUER = "https://login.example-idp.com";
const discovery = await fetch(`${ISSUER}/.well-known/openid-configuration`).then((r) => r.json());
const JWKS = createRemoteJWKSet(new URL(discovery.jwks_uri)); // cached, refetched on unknown kid
export async function verifyIdToken(idToken, expectedNonce) {
// Checks the signature, iss, aud and exp in one call.
const { payload } = await jwtVerify(idToken, JWKS, {
issuer: ISSUER,
audience: process.env.OIDC_CLIENT_ID,
clockTolerance: 60, // seconds of allowed clock skew
});
if (payload.nonce !== expectedNonce) throw new Error("nonce mismatch");
return { issuer: payload.iss, subject: payload.sub, email: payload.email };
}

Use a maintained JOSE library: hand-rolled JWT parsing is where most ID-token bugs come from.

Failure modes

Common mistakes with OpenID Connect (OIDC)

  • Using the access token as proof of identity

    An access token is meant for an API: your app may not be its audience, and it may not even be a JWT. Sign users in from a validated ID token whose aud is your client.

  • Decoding without verifying

    Base64-decoding the ID token and reading email skips the signature, issuer and audience checks, so anyone can forge a token. Verify against the provider's JWKS with a maintained library.

  • Keying users by email

    Email addresses change and can be reassigned to someone else. Use the iss + sub pair as the stable identifier, and treat email as a profile attribute (check email_verified).

  • Skipping state and nonce

    Without state the callback is open to login CSRF; without nonce, a captured ID token can be replayed into a new session. Generate both per request and compare them on return.

OIDC FAQs

What is the difference between OAuth and OpenID Connect?+
OAuth 2.0 grants an app access to resources; OpenID Connect adds authentication by returning a signed ID token about the user. OIDC runs on top of OAuth, so one flow can return both an ID token and an access token.
Is an ID token the same as a JWT?+
Every ID token is a JWT, but most JWTs are not ID tokens. An ID token is the specific OIDC token carrying identity claims such as `sub`, `iss`, `aud` and `nonce`, issued for your client.
Should I choose OIDC or SAML for single sign-on?+
Choose OIDC for new web, mobile and single-page apps, and support SAML when enterprise customers' identity providers require it. Both deliver SSO: OIDC uses JSON tokens and REST endpoints, SAML uses signed XML assertions.
Does WhatsApp Embedded Signup use OpenID Connect?+
No. Embedded Signup uses OAuth 2.0 through Facebook Login for Business to grant your app access to a business's WhatsApp assets. It does not sign the business into your product, so keep your own login for that.

Design intent

Why does OpenID Connect (OIDC) matter?

Sign-in is where most account takeovers begin. Building your own password login for a messaging dashboard means storing hashes, adding MFA and handling resets, and every leaver keeps working credentials until someone remembers to delete them. With OIDC the identity provider handles authentication and Two-Factor Authentication, your app receives a verifiable statement of who signed in, and disabling a person in the directory removes their access everywhere at once, which is exactly what auditors look for when agents can read customer chats.

Example: SSO for a 60-agent support team in Kochi

A travel company in Kochi runs WhatsApp support from a 60-seat inbox. Agents used to have separate passwords, and two former agents still had working logins months after leaving. The team switches the inbox to OIDC with the company's identity provider: agents click "Sign in with company account", the provider enforces MFA, and the inbox validates the ID token and maps sub to the agent's profile and role. When someone leaves, HR disables their directory account and the next sign-in attempt fails, with no inbox admin needing to remember anything.

Recommended practice

Best practices for OpenID Connect (OIDC)

  • Cache the JWKS but refetch on an unknown kid, so provider key rotation never breaks sign-in.
  • Allow a small clock skew, a minute or so, when checking exp and iat.
  • Request only the claims you use; openid email is enough for most dashboards.
  • Map directory groups to dashboard roles at sign-in, so access follows the person's job.

See InfiQ pricing

Put OIDC to work

InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.