Date: June 28, 2026
OpenID Connect (OIDC) is the identity layer built on top of OAuth 2.0. Where OAuth 2.0 answers the question “what is this application allowed to access?”, OIDC answers “who is the person using this application?” It is the protocol behind every “Sign in with Google”, “Login with Microsoft”, and “Continue with Apple” button on the modern web.
This article traces OIDC from its origins in the early OpenID experiments of 2005, walks through the protocol mechanics step by step, and maps the timeline of how internet authentication arrived at its current form.
Before federated identity protocols existed, every website managed its own usernames and passwords. This created three compounding problems:
The industry needed a way to let a trusted third party (an Identity Provider) confirm a user’s identity to an application, without the application ever seeing the user’s password. OIDC is the mature answer to that need.
Brad Fitzpatrick, creator of LiveJournal, proposed a system where a user’s identity was a URL. You owned http://yourname.example.com, and any website could verify your identity by checking that URL against an OpenID server.
OpenID 2.0 introduced the Attribute Exchange (AX) extension, allowing identity providers to share profile data (name, email) with relying parties. It also added a discovery mechanism so clients could find the right OpenID endpoint for a given identity URL.
OAuth 1.0 (2007) and OAuth 1.0a (2009) emerged as a separate protocol for delegated authorization — allowing an application to access a user’s resources (photos, contacts) on another service without sharing credentials. OAuth solved authorization but explicitly did not address authentication. This created a gap: developers started using OAuth access tokens as proof of identity, which was never the intended use and led to security vulnerabilities.
OAuth 2.0 replaced the signature-based approach of OAuth 1.0 with bearer tokens over TLS. It was simpler, more flexible, and quickly became the dominant authorization framework. But it still had no standard mechanism for authentication. The community recognized the need for an identity layer on top of OAuth 2.0.
Several attempts were made to combine OpenID authentication with OAuth authorization:
In February 2014, the OpenID Foundation published the OpenID Connect Core 1.0 specification. OIDC took everything the community had learned from OpenID 1.0/2.0 and OAuth and distilled it into a single, clean protocol:
openid, profile, email, address, phone).By the end of 2015, Google, Microsoft, and other major providers had deprecated OpenID 2.0 and migrated fully to OIDC.
OIDC expanded beyond web login:
The current era focuses on eliminating optionality and strengthening security:
| Actor | Role |
|---|---|
| End User | The person authenticating |
| Relying Party (RP) | Your application — needs to know who the user is |
| OpenID Provider (OP) | The identity service (Google, Okta, Auth0, Keycloak) |
| UserInfo Endpoint | An API at the OP that returns additional profile claims |
This is the recommended flow for all clients — web apps, mobile apps, and SPAs.
sequenceDiagram
participant U as End User
participant RP as Relying Party (App)
participant OP as OpenID Provider
Note over RP: Generate code_verifier (random string)<br/>Compute code_challenge = SHA256(code_verifier)
U->>RP: Click "Sign In"
RP->>U: Redirect to OP /authorize
Note over U,OP: URL includes response_type=code,<br/>scope=openid profile email,<br/>code_challenge, redirect_uri, state, nonce
U->>OP: Authenticate (username/password, MFA, etc.)
OP->>U: Redirect back to RP with authorization code
Note over U,RP: Code arrives via redirect_uri?code=...&state=...
RP->>OP: POST /token with code + code_verifier
OP-->>RP: ID Token (JWT) + Access Token + Refresh Token
Note over RP: Validate ID Token signature, iss, aud, exp, nonce
RP->>OP: GET /userinfo with Access Token
OP-->>RP: User profile claims (name, email, picture)
RP->>U: Authenticated session established
Step 1 — Discovery. The RP fetches the OP’s configuration from /.well-known/openid-configuration. This JSON document contains all the endpoints (authorize, token, userinfo, jwks) and supported features.
Step 2 — Authorization Request. The RP redirects the user’s browser to the OP’s authorization endpoint:
GET /authorize?
response_type=code
&client_id=my-app
&redirect_uri=https://app.example.com/callback
&scope=openid profile email
&state=random-csrf-token
&nonce=random-replay-guard
&code_challenge=SHA256(code_verifier)
&code_challenge_method=S256
scope=openid signals this is an OIDC request (not just OAuth).state prevents CSRF attacks.nonce prevents token replay attacks.code_challenge is the PKCE mechanism.Step 3 — Authentication. The OP authenticates the user. This can be username/password, multi-factor authentication, biometrics, or any method the OP supports. The RP never sees the user’s credentials.
Step 4 — Authorization Code. After successful authentication, the OP redirects the user back to the RP’s redirect_uri with an authorization code:
HTTP/1.1 302 Found
Location: https://app.example.com/callback?code=abc123&state=random-csrf-token
Step 5 — Token Exchange. The RP sends the authorization code to the OP’s token endpoint, along with the original PKCE verifier:
POST /token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&code=abc123
&redirect_uri=https://app.example.com/callback
&client_id=my-app
&code_verifier=original-random-string
Step 6 — Tokens Received. The OP responds with three tokens:
{
"id_token": "eyJhbGciOiJSUzI1NiJ9...",
"access_token": "ya29.a0AfH6SM...",
"refresh_token": "1//0gdv...",
"token_type": "Bearer",
"expires_in": 3600
}
Step 7 — ID Token Validation. The RP decodes the ID Token (a JWT) and verifies:
jwks_uri.iss) — matches the expected OP.aud) — matches the RP’s client_id.exp) — the token is not expired.nonce) — matches the value sent in Step 2.Step 8 — UserInfo (optional). For additional claims, the RP calls the UserInfo endpoint with the access token.
An ID Token is a JWT with three parts: header, payload, and signature.
{
"iss": "https://accounts.google.com",
"sub": "110248495921238986420",
"aud": "my-app.apps.googleusercontent.com",
"exp": 1719561600,
"iat": 1719558000,
"nonce": "random-replay-guard",
"name": "Jane Doe",
"email": "jane@example.com",
"email_verified": true,
"picture": "https://lh3.googleusercontent.com/a/photo.jpg"
}
| Claim | Purpose |
|---|---|
iss |
Issuer — identifies the OP |
sub |
Subject — unique user identifier at the OP |
aud |
Audience — the RP this token is intended for |
exp |
Expiration — Unix timestamp after which the token is invalid |
iat |
Issued At — when the token was created |
nonce |
Replay protection — matches the request |
name, email, picture |
Profile claims requested via scopes |
| Scope | Claims Returned |
|---|---|
openid |
sub (required for all OIDC requests) |
profile |
name, family_name, given_name, picture, updated_at |
email |
email, email_verified |
address |
address (structured object) |
phone |
phone_number, phone_number_verified |
| Feature | OAuth 2.0 | OIDC | SAML 2.0 |
|---|---|---|---|
| Purpose | Authorization | Authentication + Authorization | Authentication + Authorization |
| Token Format | Opaque or JWT | JWT (ID Token) | XML Assertion |
| Transport | HTTP/JSON | HTTP/JSON | HTTP/XML |
| Primary Use | API access | Web/mobile SSO | Enterprise SSO |
| Complexity | Medium | Medium | High |
| Mobile-friendly | Yes | Yes | No |
| Year Standardized | 2012 | 2014 | 2005 |
OIDC is not a single document. It is a family of specifications:
.well-known/openid-configuration mechanism.code id_token, code token, etc.The OIDC ecosystem continues to evolve: