CodeOath
← All posts
Auth & Security60 min total · 19 parts

OAuth 2.0 and JWT Explained: How "Login with Google" Actually Works

Contents — Part 3 of 19: The Actors in an OAuth Flow
Part 3 of 19 · ~1 min

The Actors in an OAuth Flow

Every OAuth flow involves four distinct roles, and most confusion about "who talks to whom" traces back to conflating two of them:

RoleWho this is, in a "Login with Google" example
Resource OwnerThe end user — the person who owns the Google account and can grant or deny access to it
ClientYour application — the thing requesting access on the user's behalf
Authorization ServerGoogle's login/consent infrastructure — issues tokens after the user approves
Resource ServerGoogle's actual API (Calendar API, People API) — accepts the access token and returns data

The Authorization Server and Resource Server are frequently the same company (Google issues the token and runs the API that accepts it) but they're logically separate roles, and in some systems they really are separate services — a company might run its own internal Authorization Server (e.g. an identity provider like Okta or Auth0) that issues tokens accepted by several unrelated internal APIs, each of which is its own Resource Server.