OAuth 2.0 Authorization Code Flow with PKCE

OAuth 2.0 Authorization Code Flow with PKCE A sequence diagram generated by Archify. open app redirect: code_challenge log in + MFA + consent redirect: ?code=... POST /token (code, verifier) access, refresh, ID token Authorization: Bearer fetch JWKS (cached) 200 OK page rendered Authenticate Exchange code Use token User · browser · Sequence participant User browser Client app · BFF / oauth2Login · Sequence participant Client app BFF / oauth2Login Authorization server · Keycloak, Entra ID · Sequence participant Authorization server Keycloak, Entra ID Resource server · Spring API · Sequence participant Resource server Spring API Legend request return async trace

PKCE

  • • Stops stolen-code attacks; required in OAuth 2.1

OIDC

  • • The ID token says who logged in

Local validation

  • • APIs verify JWTs with cached keys
© 2026 Samir Kumar Sahoo. All rights reserved.