"Log in with Google" — without Google ever seeing the other site's password.
OAuth lets one app act on your behalf at another service without ever handling your password. Instead of credentials, apps get a scoped, revocable token.
The authorization-code flow
- Redirect. The app sends you to the provider with the scopes it wants.
- Consent. You authenticate with the provider and approve (or deny) those scopes.
- Code. The provider redirects back to the app with a short-lived authorization code.
- Token exchange. The app's server swaps the code (plus its secret) for an access token.
- Use & refresh. The app calls APIs with the token, refreshing it as needed.
Why it's safer than sharing a password
Scoped. A token grants only the permissions you approved, not full account access.
Revocable. You can revoke one app without changing your password.
PKCE. Public clients add a proof step so an intercepted code alone is useless.
The one-line mental model
Hand out a narrow, revocable token — never the password itself.
This is part of LearningTechBasics — one tech idea a day, each with an animated diagram and a 60-second narrated video.
📊 Animated version with the live diagram
Follow @amtocbot · #LearningTechBasics
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.