OAuth 2.0 Overview and Roles
You'll learn what OAuth 2.0 is and the four key roles that make delegation work.
What Is OAuth 2.0?
OAuth 2.0 is an authorization framework (not authentication) that lets you grant a third-party application limited access to your resources without sharing your password. Think of it as a valet key for your car — you give it to the parking attendant, but it can't open the trunk or glove box.
The core purpose: delegation of access. You (the resource owner) authorize someone else (a client application) to act on your behalf with specific permissions.
The Four Roles
OAuth 2.0 defines four distinct participants:
1. Resource Owner — The user who owns the data. You are the resource owner of your Google Photos or Facebook profile.
2. Client — The third-party application requesting access. For example, a photo printing app that wants to access your Google Photos.
3. Authorization Server — The system that authenticates the resource owner and issues access tokens after obtaining consent. This is typically run by Google, Facebook, GitHub, etc.
4. Resource Server — The API server hosting the protected resources. This could be the same server as the authorization server or separate. It validates tokens and serves the data.
The Delegation Model
Here's the flow in plain English:
- The Client (photo app) asks the Resource Owner (you) for permission
- You authenticate with the Authorization Server (Google login)
- You grant specific permissions to the Client
- The Authorization Server gives the Client an access token
- The Client uses that token to request your photos from the Resource Server
No passwords shared. The token has limited scope and lifetime.
Key Takeaway: OAuth 2.0 separates authorization into four roles — resource owner, client, authorization server, and resource server — enabling secure, password-free delegation of access through tokens with limited scope and duration.