OAuth vs OIDC

OAuth 2.0 authorizes access. OpenID Connect adds identity layer with ID tokens (JWTs) proving who logged in.

Token Roles

  • Access token — call APIs (may or may not be JWT)
  • ID token — user identity (always JWT in OIDC)
  • Refresh token — obtain new access token (usually opaque)

Validation

ID tokens: verify signature, iss, aud (client_id), exp, nonce. Access tokens: verify signature, iss, aud (API id), exp, scope.

Inspect Tokens

Use JWT Debugger and OAuth Token Inspector.

Understanding JWT in OAuth 2.0 and OpenID Connect in Production

Developers search for JWT in OAuth 2.0 and OpenID Connect when building API authentication with JSON Web Tokens. JWTs are used by OAuth 2.0, OpenID Connect, Auth0, Firebase, AWS Cognito, and Keycloak. Always validate exp, iss, and aud server-side — decoding alone proves nothing about authenticity.

JWT Structure Recap

Every JWT has three dot-separated segments: header (algorithm), payload (claims), signature (proof). Use JWT Decoder to inspect and JWT Validator to verify before trusting any claim value in production code.

Common Pitfalls

  • Algorithm confusion (none attack) — whitelist allowed algorithms
  • Secrets in the payload — payload is only Base64-encoded, not encrypted
  • Ignoring clock skew on exp and nbf
  • Weak HMAC secrets — use 256-bit random keys
  • Skipping signature verification — always call verify(), not decode()
  • Storing tokens in localStorage — XSS can steal them

Further Reading

Browse related resources: JWT Decoder, JWT Validator, JWT Basics, JWT Authentication, JWT Errors, Algorithms, Glossary, and Learning Path.

Try It Now

FAQ

Is every OAuth token a JWT?

No. Access tokens can be opaque strings. ID tokens in OpenID Connect are always JWTs.

What is an ID token?

A JWT proving user authentication event — contains profile claims. Not for API authorization.