SecurityOIDCOpenID Providerrelying party

OpenID Connect

Definition

OpenID Connect extends OAuth 2.0 with the ID token, a JWT issued by an OpenID Provider to a relying party, plus standard discovery, a UserInfo endpoint, profile scopes and logout.

In practice

Before OIDC, sites "logged in with OAuth" by trusting any access token, which let a token granted to one app be replayed at another (token substitution). OIDC addresses the ID token to one client (aud), binds it to one sign-in (nonce) and makes it verifiable offline with keys from the provider's JWKS. Discovery at /.well-known/openid-configuration makes every provider look the same.

After validating the ID token, the app should create its own session rather than keep calling the provider. Key users by iss plus sub, never by email, which can change or be reassigned. Calling UserInfo or introspection on every request couples every page view to the provider's latency and availability.

Example

A web app redirects to https://login.example.com/authorize?scope=openid%20email&nonce=..., receives an ID token with sub: "248289761001" and aud: "my-app", validates it locally and sets a session cookie.