OIDC Flow: "Authorization Code Flow" (with PKCE optional for public clients)

 Absolutely. Here’s a concise explanation of the OIDC flow you implemented, plus a quick list of other standard OAuth2/OIDC flows for context.


Your OIDC Flow: "Authorization Code Flow" (with PKCE optional for public clients)

How it Works (Your MVP):

  1. User visits client app (API Gateway) → clicks login

  2. Client app redirects user to /authorize endpoint on identity-backend, passing:

    • client_id, redirect_uri, scope, and state

  3. Identity-backend shows login form.

    • User enters username/password, submits.

  4. If login is successful:

    • Identity-backend creates a single-use authorization code and redirects back to redirect_uri (your client) with ?code=...&state=...

  5. Client app receives the code, then POSTs to /token endpoint on identity-backend with:

    • code, client_id, client_secret, redirect_uri

  6. Identity-backend checks everything is valid and issues a JWT (your id_token), which the client stores (session).

  7. Client app now uses this token to authorize access to all protected endpoints.

Key Points:

  • Client never sees the user’s password.

  • Code is exchanged server-to-server for token (never exposed to browser or attacker).

  • This is the most secure and widely used flow for web apps and APIs.


Other OAuth2 / OIDC Flows (Just the Names)

  1. Authorization Code Flow (what you implemented)

  2. Implicit Flow (for old-school pure JS apps—not recommended anymore)

  3. Client Credentials Flow (for server-to-server/API service auth)

  4. Resource Owner Password Credentials Flow (ROPC—legacy, not recommended)

  5. Device Authorization Flow (for devices without browser, e.g., TVs)

  6. Hybrid Flow (mixes code + implicit, advanced)

  7. Authorization Code Flow with PKCE (for public/native/mobile clients)


You are using #1, which is the gold standard for browser-based web apps!
Let me know if you want to see a diagram or the details on any of the others.

Comments

Popular posts from this blog

Feature: Audit log for one login, and identity service

Getting started - Build your data science lab environment

QA - Run #1 - Results