Course contentsShow
← System Design
Lesson 921 of 1,91924. Authentication and Authorization at ScaleFree lesson

OAuth2 Roles: Resource Owner, Client, Server

Identifying the four core roles in OAuth2 flows and their responsibilities.

OAuth2 Roles: Resource Owner, Client, Server

What you'll learn: The four distinct roles that interact in every OAuth2 authorization flow and what each is responsible for.


The Four Players in OAuth2

OAuth2 defines exactly four roles that participate in the authorization dance. Think of it like a valet parking scenario: the car owner, the valet service, the valet attendant, and the parking lot.

1. Resource Owner

Who: Usually the end user (you).
Responsibility: Owns the protected data and grants permission to access it.
Example: You deciding whether to let a photo-printing app access your Google Photos.

2. Client

Who: The application requesting access.
Responsibility: Requests authorization and uses access tokens to retrieve resources.
Example: The photo-printing website or mobile app that wants to read your photos.

3. Authorization Server

Who: The gatekeeper that issues tokens.
Responsibility: Authenticates the resource owner, obtains their consent, and issues access tokens to the client.
Example: Google's OAuth server (accounts.google.com) that shows the consent screen and generates tokens.

4. Resource Server

Who: The API hosting protected resources.
Responsibility: Validates access tokens and serves the requested data.
Example: Google Photos API that delivers your actual photo files when presented with a valid token.


Why This Separation Matters

Separating these roles allows the resource owner to grant limited access without sharing credentials. The client never sees your password. The authorization server can be centralized across many resource servers, and the resource server simply validates tokens—it doesn't handle login flows.

Key Takeaway: OAuth2's four roles—resource owner, client, authorization server, and resource server—create a clean separation of concerns that enables secure, delegated access without password sharing.