The Four Roles in OAuth 2.0
Every "Sign in with Google" button, every app that reads your calendar without ever seeing your password, and every third-party integration you've ever approved runs on the same four-actor play. Meet the cast.
Imagine you’re at a hotel. You don’t hand the valet the keys to your house so he can park your car — you hand him a valet key, one that only starts the engine and only unlocks the driver’s door. He never gets access to your trunk, your glove box, or your garage remote. That single idea — giving out a limited, purpose-built key instead of your master key — is the entire reason OAuth 2.0 exists, and it’s the reason it needs four distinct roles instead of just “you” and “the app.” This article walks through each of those four roles one at a time, in plain language, and then shows exactly how they talk to each other to make modern logins and app permissions work safely.
WWhy OAuth 2.0 Needed Four Roles in the First Place
Before there were four roles, there was one bad habit: sharing passwords. Understanding the problem OAuth solved makes the four roles feel obvious instead of abstract.
In the early days of the web, if you wanted a photo-printing website to grab your vacation photos from another site, there was really only one way to do it: you typed your username and password for the photo site directly into the printing site’s login form. The printing site would then log in as you, pretending to be you, and pull whatever it wanted. This approach is called the “password anti-pattern,” and it has three enormous problems. First, the printing site now permanently knows your real password. Second, it can access everything in your account, not just your photos — your private messages, your billing details, all of it. Third, the only way to cut off access later is to change your password everywhere, which also logs out every other app you’ve connected.
OAuth 2.0 (Open Authorization, version 2.0) was created to solve exactly this problem. Instead of handing out your real password, you hand out a narrow, revocable, time-limited token — like that valet key — that says “this app may read my photos, and nothing else, until this date.” To make that promise possible, the system needs more than just “you” and “the app.” It needs a party that owns the data, a party that wants the data, a party that issues the permission slip, and a party that actually checks the permission slip before handing over the data. Those four separate jobs are the four roles of OAuth 2.0: the Resource Owner, the Client, the Authorization Server, and the Resource Server.
OAuth 2.0 is not a login protocol by itself — it’s a delegation protocol. It answers the question “can App X act on my behalf, for this one specific purpose?” rather than “who are you?” That second question is handled by a related standard called OpenID Connect, which is built on top of OAuth 2.0.
RThe Resource Owner — The Person Who Owns the Data
The Resource Owner is almost always you. It’s the human whose data, files, or account is at stake, and the only role in the entire system with the authority to say “yes, you may access this.”
The Resource Owner is defined very simply: it’s whoever owns the protected data and has the right to decide who can touch it. In the vast majority of everyday examples, the Resource Owner is a human being — you, sitting at your laptop or holding your phone, clicking “Allow” on a screen that says “TripPlannerApp wants to view your Google Calendar.” You are the owner of that calendar data. Google is not the owner; Google is just the custodian. TripPlannerApp is not the owner either; it’s the one asking for permission.
Think of the Resource Owner as the landlord of an apartment. The landlord (you) owns the apartment (your data). A moving company (the app) wants to get in to move some boxes. The landlord doesn’t hand over the master key to the whole building — the landlord decides, specifically, “yes, you can access apartment 4B, between 9am and 5pm, this Saturday only.” That decision-making power belongs to the landlord and no one else.
It’s worth noting that the Resource Owner does not have to be a human. In some setups — often called “machine-to-machine” flows — a piece of software or a company system can act as its own Resource Owner, granting permission to another piece of software without any person clicking a consent button in the moment. But for the login and permission-screen experiences most people encounter daily (connecting a fitness app to health data, letting a scheduling tool see your calendar, allowing a music app to post to your social account), the Resource Owner is you, personally.
Real Example: Google Account Permissions
When you see a Google screen listing “TripPlannerApp wants to: View your calendar events, See your basic profile info,” you — the Resource Owner — are the one clicking “Allow” or “Deny.” Google itself never makes that call on your behalf; it only enforces whatever choice you make.
CThe Client — The App That Wants Access
The Client is the application requesting access to your data. Confusingly, in OAuth vocabulary, “Client” does not mean “the customer” — it means “the app doing the asking.”
The Client is any application — a website, a mobile app, a smart TV app, a background service — that wants to access data belonging to the Resource Owner, but that data lives somewhere else, on a different system, guarded by a different company. The Client itself never sees your password. Its entire job is to ask nicely, receive a limited-purpose token if you approve, and then use that token to make requests for the specific data it was granted.
The Client is the moving company from our apartment analogy. It’s not the landlord, and it’s not the building’s front-desk security guard — it’s the outside company that needs temporary, limited access to do a specific job. It shows up with a permission slip (the token) rather than trying to pick the lock or ask the landlord for a permanent copy of the master key.
OAuth 2.0 recognizes two flavors of Client, and the difference matters a lot for security:
Confidential Client
- Runs on a server you don’t control directly (e.g., a web app’s backend)
- Can safely keep a secret key hidden from end users
- Example: a traditional server-rendered web application
Public Client
- Runs directly on the user’s device (mobile app, single-page app in a browser)
- Cannot safely hide any secret — the code is visible to whoever installs the app
- Requires extra protections like PKCE (covered later) to stay secure
Many beginners assume “Client” means “the customer” or “the end user.” In OAuth terms, the Client is always the application, never the person. The person is the Resource Owner. Keeping these two roles straight is the single most useful mental habit for understanding OAuth diagrams.
AThe Authorization Server — The Bouncer and Ticket Booth
The Authorization Server is the system that checks your identity, asks for your consent, and then issues the actual token the Client will use. It is the single most trusted component in the whole picture.
The Authorization Server has two jobs, and it’s helpful to picture them as two rooms in the same building. In the first room, it verifies who you are — this is usually a familiar login screen where you enter your username and password, and possibly a second factor like a code from your phone. In the second room, once it knows who you are, it shows you the consent screen: “TripPlannerApp wants to view your calendar — Allow / Deny.” If you click Allow, the Authorization Server generates a token and hands it, indirectly, to the Client.
The Authorization Server is like the ticket booth and bouncer combined at a concert venue. It checks your ID at the door (authentication), then, based on what kind of ticket you bought, prints you a wristband that says exactly which areas you can enter — general floor only, or backstage too (authorization). The bouncer at the actual entrance later just looks at your wristband; he doesn’t re-check your ID.
Well-known Authorization Servers include Google’s accounts system, Microsoft’s Entra ID (formerly Azure AD), Auth0, Okta, and GitHub’s OAuth apps platform. When a company builds a “Sign in with GitHub” button, GitHub’s servers are acting as the Authorization Server for that flow.
Authenticate the User
Confirms the Resource Owner is really who they claim to be, typically via password plus multi-factor authentication.
Capture Consent
Presents the exact list of permissions (“scopes”) the Client is requesting, and records the user’s Allow or Deny decision.
Issue Tokens
Creates a short-lived access token (and often a longer-lived refresh token) tied to exactly the approved scopes.
Validate Later Requests
Can revoke, refresh, or inspect tokens on request, acting as the ongoing source of truth for what’s still allowed.
SThe Resource Server — The Vault That Holds the Data
The Resource Server is the system that actually stores your protected data and hands it over — but only after checking that the token presented to it is valid and covers the right permissions.
The Resource Server is often a completely different piece of infrastructure from the Authorization Server, even when both are run by the same company. For example, at Google, the servers that handle login and consent screens are logically separate from the servers that actually store your Gmail messages or Calendar events. When TripPlannerApp wants your calendar entries, it doesn’t ask the Authorization Server for the data directly — it presents its access token to the Calendar Resource Server, which checks the token and, if everything is valid, returns just the calendar data the token allows.
Continuing the concert analogy: the Resource Server is the actual room behind the door — the backstage area, or the VIP lounge. The staff at that door don’t re-verify your entire identity; they simply check your wristband (the token) and let you through if it matches, or turn you away if it doesn’t. They don’t care how you got the wristband, only whether it’s valid right now.
| Role | Analogy | Primary Question It Answers |
|---|---|---|
| Resource Owner | The landlord / concert-goer | “Do I approve this access?” |
| Client | The moving company / ticket holder | “Can I get access on the owner’s behalf?” |
| Authorization Server | The ticket booth & bouncer at the door | “Who are you, and what did you approve?” |
| Resource Server | The backstage room | “Does this wristband let you in here, right now?” |
Splitting the Authorization Server and Resource Server lets a company scale each independently, apply different security rules to each, and even let outside developers build entirely separate Resource Servers (their own APIs) that still trust the same central Authorization Server for identity and consent.
HHow the Four Roles Work Together
Individually, the four roles are simple. The magic of OAuth 2.0 is in the sequence they follow together — a carefully choreographed handoff of trust from the person to the app.
Picture the most common version of this dance, called the Authorization Code flow, which is what powers most “Sign in with…” buttons on websites today. It happens in a clear, repeatable sequence:
The Client Asks
You click “Connect your Google Calendar” inside TripPlannerApp (the Client). The Client redirects your browser to the Authorization Server, listing exactly which permissions (“scopes”) it wants — for example, “calendar.readonly.”
The Resource Owner Logs In and Consents
The Authorization Server shows you a familiar login screen if you’re not already signed in, then shows the consent screen. You, the Resource Owner, review the requested scopes and click Allow.
The Authorization Server Issues a Code
Rather than sending the token directly through your browser (which would be riskier), the Authorization Server sends back a short-lived, one-time-use “authorization code” to the Client.
The Client Exchanges the Code for a Token
Behind the scenes, the Client’s own server contacts the Authorization Server directly (not through your browser) and trades the authorization code — plus its own credentials — for an actual access token.
The Client Calls the Resource Server
TripPlannerApp now presents that access token to Google Calendar’s Resource Server, which checks its validity and scope, then returns just your calendar events — nothing more.
sequenceDiagram
participant RO as Resource Owner (You)
participant C as Client (TripPlannerApp)
participant AS as Authorization Server (Google Login)
participant RS as Resource Server (Google Calendar API)
RO->>C: Click "Connect Google Calendar"
C->>AS: Redirect with requested scopes
AS->>RO: Show login + consent screen
RO->>AS: Approve access
AS->>C: Return authorization code
C->>AS: Exchange code + client secret for token
AS->>C: Return access token
C->>RS: Request calendar data with access token
RS->>C: Return calendar events
Notice what never happens anywhere in this sequence: at no point does TripPlannerApp (the Client) ever see your Google password. It only ever sees an access token — a narrow, revocable permission slip — and it only ever uses that token against the specific Resource Server it was issued for.
TTrade-offs, Common Mistakes & Security Considerations
Understanding the four roles is step one. Step two is understanding where things go wrong when a role’s boundaries get blurred or a step in the handshake gets skipped.
Mistake
Treating the Client and the Resource Owner as if they’re the same entity, and letting the Client hold or request the user’s real password directly instead of going through the Authorization Server.
Why It’s Dangerous
This is the exact password anti-pattern OAuth was built to eliminate. If the Client ever sees your real password, it can do anything your account can do, forever, until you change your password everywhere.
Better Approach
Always route authentication through the Authorization Server’s own login screen, never through a form embedded inside the Client’s app or website.
Because mobile apps and browser-based apps (public Clients) can’t hide a secret key, modern OAuth deployments require a technique called PKCE (Proof Key for Code Exchange). It adds a one-time, dynamically generated secret to each individual login attempt, so even if someone intercepts the authorization code in step 3 above, they can’t complete step 4 without also having generated that matching secret beforehand.
Benefits of the Four-Role Split
- Your real password is never shared with third-party apps
- Access can be scoped narrowly (read-only calendar, not full account)
- Access can be revoked instantly from the Authorization Server without changing your password
- Different companies can build Resource Servers that all trust one shared Authorization Server
Trade-offs to Manage
- More moving parts than a simple username/password check, meaning more places to configure correctly
- Tokens must be stored securely by the Client — a leaked access token is still a real risk
- Consent screens can suffer from “permission fatigue” if scopes are too broad or too frequent
- Public clients require additional safeguards like PKCE to reach the same security bar as confidential clients
FFrequently Asked Questions
SSummary and Key Takeaways
What to Remember
- Resource Owner — the person (usually you) who owns the data and has the sole authority to grant or deny access to it.
- Client — the application requesting access on the Resource Owner’s behalf; it never sees the real password, only a limited token.
- Authorization Server — the trusted system that verifies identity, captures consent, and issues short-lived, scope-limited tokens.
- Resource Server — the system that actually stores the protected data and checks tokens before releasing anything.
- The entire point of splitting these four jobs apart is to replace “give me your password” with “here’s a narrow, revocable permission slip” — the digital equivalent of a valet key instead of your house keys.
- Public clients (mobile apps, browser apps) need extra protections like PKCE, since they can’t safely hide a secret the way server-based confidential clients can.
- OAuth 2.0 answers “what is this app allowed to do?” — it does not by itself answer “who is this user?”; that’s the job of OpenID Connect, built on top of these same four roles.