Course contentsShow
← System Design
Lesson 928 of 1,91924. Authentication and Authorization at ScaleFree lesson

OpenID Connect (OIDC) Overview

How OIDC extends OAuth2 to add an authentication layer with ID tokens.

OpenID Connect (OIDC) Overview

You'll learn: How OpenID Connect extends OAuth2 to add standardized authentication with identity information.

The Authentication Gap in OAuth2

OAuth2 was designed for authorization — letting apps access resources on your behalf. But it doesn't tell you who the user is. Imagine a bouncer (OAuth2) giving you a ticket to enter a VIP room, but the ticket doesn't have your name on it. The club knows you're allowed in, but not who you actually are.

OIDC fills this gap by layering authentication on top of OAuth2's authorization framework.

What OIDC Adds

OpenID Connect introduces an ID token alongside OAuth2's access token. While an access token is like a hotel room key (grants access to resources), the ID token is like your driver's license — it proves your identity.

The ID token is a JWT containing identity claims about the authenticated user:

  • sub (subject): unique user identifier
  • name, email: profile information
  • aud (audience): which client the token was issued to
  • iat, exp: issued-at and expiration times

When you sign in with "Login with Google," you're using OIDC. The application receives both an access token (to read your Google Drive, if authorized) and an ID token (proving you're user@gmail.com).

How It Works

OIDC builds on OAuth2's authorization code flow, adding one key step: after exchanging the authorization code for tokens, you receive both an access token and an ID token. The ID token is cryptographically signed, letting your application verify the user's identity without additional server calls.

Key Takeaway: OpenID Connect extends OAuth2 by adding standardized authentication through signed ID tokens, transforming OAuth2 from a pure authorization protocol into a complete authentication and authorization solution.