Concepts

OAuth & OIDC

Industry standards for delegated authorization (OAuth 2.0) and federated authentication (OpenID Connect), enabling third-party login and secure API access.

seed#oauth#oidc#authentication#authorization#jwt#identity

What it is

  • OAuth 2.0: authorization protocol allowing applications to access resources on behalf of a user without knowing their credentials
  • OpenID Connect (OIDC): identity layer on top of OAuth 2.0 adding authentication

OAuth 2.0 flows

FlowUse
Authorization CodeWeb apps with backend
Authorization Code + PKCESPAs, mobile apps
Client CredentialsMachine-to-machine
Device CodeDevices without browser

Tokens

TokenPurposeDurationStandard
Access TokenAuthorizes resource accessShort (minutes-hours)OAuth 2.0
Refresh TokenObtains new access tokensLong (days-weeks)OAuth 2.0
ID TokenContains user informationShortOIDC (always JWT)

JWT (JSON Web Token)

Common token format: header.payload.signature. Allows verifying integrity without calling the authentication server.

Providers

  • Auth0, Okta (SaaS)
  • AWS Cognito, Azure AD B2C (cloud)
  • Keycloak (open-source)

Why it matters

OAuth 2.0 and OpenID Connect are the authentication and authorization standards of the modern web. Implementing them correctly protects users and the application. Implementing them poorly creates vulnerabilities that attackers know well.

References

Concepts