I. Overview

%%{init: { 'theme': 'base', 'themeVariables': { 'edgeLabelBackground': '#fff' }}}%%
flowchart LR
    A["Sharing\npasswords"] -- "Token-based delegated authorization" --> B["Secure third-party\nservice integration"]
    style A fill:#f9f9f9,stroke:#333,stroke-width:3px
    style B fill:#e1f5fe,stroke:#01579b,stroke-width:3px

Definition: An open standard protocol that lets a third-party application access a resource on a user’s behalf — through delegation — without ever exposing the user’s password.

Features:
( Password Protection ) Delegates only safe resource-access privileges to third-party apps, without ever exposing the user’s password
( Fine-Grained Authorization ) Scope-based privilege control allows access to only the minimum data required
( Standardized Authentication ) Builds a unified identity-verification system via OIDC, ensuring interoperable user authentication across services

II. Mechanism & Components

A. OAuth 2.0’s Four Roles

  • Resource Owner: The owner of the resource (the user)
  • Client: The application requesting access to the resource
  • Resource Server: The server that holds the resource (data)
  • Authorization Server: The server that verifies privileges and issues tokens

B. The Emergence of OpenID Connect (OIDC)

Concept: An identity layer built on top of OAuth 2.0 that adds the missing “authentication” capability

Key Element: Delivers the user’s profile information securely through an ID Token (JWT)

III. Advanced Topics & Comparison

A. OAuth 2.0 vs. OpenID Connect (OIDC)

Comparison ItemOAuth 2.0OpenID Connect (OIDC)
Primary PurposeAuthorization / delegationAuthentication / identity
Core Question“Is this app allowed to access my data?”“Who is this user?”
Tokens IssuedAccess Token, refresh tokenID Token, access token
Token FormatOpaque or JWTAlways JWT (JSON Web Token)
EndpointsToken endpoint, auth endpoint+ adds a UserInfo endpoint

B. OAuth 2.0 Grant Types

Grant TypeDescriptionTypical Use
Authorization CodeObtains a code first for security, then exchanges it for a token via server-to-server communicationGeneral web applications (most secure)
ImplicitIssues a token directly in the browser (increasingly deprecated due to security weaknesses)Single-page apps (SPA)
Client CredentialsIssues a token using only the client’s own credentials, with no user involvedServer-to-server (M2M) communication
Refresh TokenA mechanism for reissuing an expired access tokenMaintaining sessions and improving UX

Last updated 18 Aug 2026, 00:00 UTC. history