Bookmarks

OIDC — OpenID Connect

An authentication protocol on top of OAuth 2.0: an application delegates identity verification to an identity provider and receives standardised information about the user.

Also: OpenID Connect 1.0, OIDC

checked 9 Nov

All terms

OAuth 2.0 does not perform authentication itself: it issues a token for access to another party’s API but does not say who signed in. OpenID Connect adds an authentication layer on top of OAuth: the application delegates identity verification to a provider and receives an ID token — a signed statement about the user.

How sign-in works

The OpenID Foundation published the first version of the standard in February 2014. In it the application is called the Relying Party (RP) and the provider is the OpenID Provider (OP). Sign-in with the authorization code flow goes like this:

  1. the application redirects the browser to the provider and, in the authorisation request, asks for authentication: the mandatory openid scope, a state parameter to protect against CSRF, and a nonce that will later come back in the ID token and rule out replayed requests;
  2. the provider authenticates the user and obtains their consent to share data with the application;
  3. the provider sends the user back to the application with an authorisation code, which the application exchanges in a background request to the provider for an ID token and an access token;
  4. the application verifies the ID token’s signature and claims — after that the user counts as signed in.

Tokens and discovery

The main result is the ID token: the standard requires it to be signed and defines it as a JWT. With the iss claim the provider names itself, and with sub the user: this is a stable identifier within the provider that does not change after issue, so the application stores it as the account key. aud names the application the token was issued for, and exp and iat give the times. Alongside the ID token comes an ordinary OAuth access token: with it the application calls the UserInfo endpoint and gets the name, email and other profile fields, to the extent granted by the profile and email scopes. The signature is checked against the provider’s public keys, which the provider publishes in its discovery document, together with the addresses of the authorisation and token endpoints.

jsonID token payload
{  "iss": "https://id.example.com",  "sub": "248289761001",  "aud": "web-app",  "nonce": "n-0S6_WzA2Mj",  "exp": 1793448600,  "iat": 1793448000}

What the standard defines

Part of the standardWhat it does
Corethe mandatory minimum: scopes, the ID token, the authorisation and token endpoints
Discoverya JSON document at /.well-known/openid-configuration listing addresses and supported features
Dynamic Client Registrationregistering a client with the provider through an API

Where it is used

Signing in with Google, Microsoft Entra ID, Apple and other external providers — social login with no password in your application. Corporate SSO portals: OpenID Connect works alongside SAML and often replaces it in new systems. Authentication providers and libraries for web and mobile applications offer OAuth and OIDC together: authentication is built on top of the same OAuth authorisation process.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • OAuth 2.0

    OAuth 2.0 grants delegated access to an API and does not answer who the user is; OIDC adds authentication.

  • JWTJSON Web Token

    A JWT is a token format; the OIDC ID token is built as a JWT, but JWTs are used in other roles too.

  • SAMLSAML protocol

    SAML is the older XML-based single sign-on standard; OIDC solves the same problem with JSON on top of OAuth 2.0.

In depth in the references

where the topic is covered in detail