1. Concept library
  2. Java & Spring Boot
  3. Module 10: OAuth 2.0 and JWT

Concept

OAuth 2.0 flows

OAuth 2.0 lets a user grant an application limited access to their account on another service without sharing a password. The authorization code flow with PKCE is the one for web and mobile apps.

What a session covers

The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.

  1. Explain what OAuth 2.0 lets a user grant and what it does not
  2. Trace the authorization code flow with PKCE step by step
  3. Spot the implicit flow or the missing state check

In practice

A few lines that show OAuth 2.0 flows doing its job.

text
1. App sends the browser to the provider's /authorize with client_id,
   redirect_uri, scope, state and a PKCE code_challenge.
2. User signs in and consents.
3. Provider redirects back with ?code=...&state=...
4. App checks state, then POSTs code + code_verifier to /token.
5. Provider returns access_token (and maybe refresh_token).
6. App calls the API with Authorization: Bearer <access_token>.

The common mistake

Watch for

Using the implicit flow or skipping PKCE and state. Tokens in the URL fragment leak through history and referrers, and a missing state check allows login CSRF.

What to know first

Your roadmap puts these before OAuth 2.0 flows, unless you already know them.

How it stays learned

Once a session shows you understand OAuth 2.0 flows, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.

  1. Day 3First recall, while it is fresh
  2. Day 7Second, a week on
  3. Day 18Last, when it has settled

Where it leads

Topics that build on OAuth 2.0 flows.

Next in the moduleJWT validation →