Guides

What Is OAuth? Delegated Access Without Passwords

Ravi Menonยทยท9 min read

Here's the thing most tutorials get backwards from the first sentence: OAuth doesn't log you in. It was never designed to. OAuth is about delegation โ€” letting one app do a specific job on your behalf inside another service, without that app ever seeing your password. The 'Sign in with Google' button you're probably picturing is a newer identity layer bolted on top. Strip that away and OAuth's actual job is narrower, older, and more useful than 'login': it hands out limited, revocable permission slips.

Once that clicks, the rest of OAuth stops feeling like alphabet soup. So let me take the common myths one at a time and replace each with what OAuth actually does.

The valet-key picture

Some cars come with a valet key. It starts the engine and opens the driver's door, but it won't unlock the trunk or the glovebox, and some limit how far you can drive. You hand it to someone you don't fully trust โ€” a parking attendant โ€” precisely because it grants one narrow capability and nothing more. Your real key stays in your pocket.

That's OAuth. When you let a photo-printing app reach your cloud storage, you don't give it your storage password (your real key). You give it the equivalent of a valet key: permission to read the photos folder, nothing else, revocable the moment you change your mind. Hold that image and every piece of the flow below has an obvious place.

The four parties

OAuth choreographs four roles, and naming them removes most of the confusion:

  • Resource owner โ€” you, the person who owns the data.
  • Client โ€” the app that wants to act on your behalf (the printing app).
  • Authorization server โ€” the service that authenticates you and issues tokens (Google's, GitHub's, etc.).
  • Resource server โ€” the API that actually holds your data and accepts the token (the storage API).

The whole point is that the client talks to the authorization server to get a token, and never learns your password in the process. You authenticate directly with the provider you already trust.

Myth 1: "OAuth logs users in"

This is the big one. OAuth answers what is this app allowed to do, not who is this person. Those are different questions. The reason 'Sign in with Google' feels like login is that a thin standard called OpenID Connect (OIDC) sits on top of OAuth and adds an identity token describing who you are. Underneath, it's still OAuth granting delegated access โ€” OIDC just piggybacks a verified identity onto the same handshake. If you only need 'let this app read my calendar,' that's pure OAuth and no login is implied.

Myth 2: "The app gets a password-equivalent"

Watch what the client actually receives. In the common authorization code flow, the client redirects you to the authorization server, you log in there and approve a list of scopes (read:photos, say), and you're redirected back with a short-lived, single-use code. The client then exchanges that code โ€” server to server โ€” for an access token.

That access token is not your password. It's scoped (only the permissions you approved), it expires (often in minutes to an hour), and it can be revoked without you touching your real credentials. It's the valet key, not the master key. Access tokens are usually JSON Web Tokens, which means the token itself carries readable claims โ€” you can drop one into the JWT Decoder to see its scopes and expiry, and check exactly when it expires with the JWT Expiration Checker.

Myth 3: "Once granted, access lasts forever"

Short-lived access tokens would be annoying if you had to re-approve every hour, so OAuth splits the job. Alongside the access token, the authorization server can issue a refresh token: a longer-lived credential the client uses at one endpoint to silently mint fresh access tokens. Short access token caps the damage of a leak; the refresh token restores convenience; and because the server can revoke a refresh token, it's how 'disconnect this app' actually works. It's the same two-token split covered in what is a refresh token.

How the token rides on each request

Once the client has an access token, it sends it on every API call in the Authorization: Bearer <token> header. 'Bearer' means possession equals access โ€” whoever holds the token can use it โ€” which is why OAuth leans so hard on HTTPS, short lifetimes, and scopes. If you're wiring this up, the Bearer Token Parser pulls the token cleanly out of that header, and the deeper mechanics live in what is a bearer token.

OAuth vs an API key

It's worth drawing the line against the simpler credential. An API key โ€” the kind you'd mint with an API Key Generator โ€” identifies an application and typically grants broad, long-lived access with no user consent step. OAuth delegates a specific user's access to an app, with explicit consent, narrow scopes, expiry, and per-grant revocation. Reach for an API key for server-to-server calls you fully control; reach for OAuth when an app needs to act on an end user's behalf against a third-party service.

The one-line version

OAuth is a delegation framework: it lets you grant an app a scoped, expiring, revocable permission slip to your data on another service, without ever handing over your password. It authorizes rather than authenticates (OpenID Connect adds the identity part), it issues bearer tokens that are usually JWTs, and it pairs a short access token with a refresh token so security and convenience both survive. Hand out the valet key, keep the master key in your pocket.

And when you do need the identity part โ€” the "Sign in with Google" login experience rather than just delegated access โ€” that's the job of the thin layer built on top of OAuth: what is OpenID Connect explains the ID token that finally answers "who is this user."

Try the tools

Frequently Asked Questions

What is OAuth in simple terms?

OAuth is a standard way to let one app act on your behalf inside another service without giving it your password. You log in directly with the service, approve a specific set of permissions, and the app receives a limited access token instead of your credentials. Think of it as issuing a scoped permission slip rather than handing over your keys.

Is OAuth authentication or authorization?

Authorization. OAuth decides what an app is allowed to do with your data, not who you are. The 'Sign in with Google' experience adds authentication through OpenID Connect, a small identity layer built on top of OAuth. Plain OAuth 2.0 by itself is about delegated permission, not proving identity.

What is the difference between OAuth and an API key?

An API key is a single static credential that identifies an application and usually grants broad, long-lived access. OAuth issues short-lived, user-scoped tokens after the user explicitly consents, and those tokens can be narrowed to specific permissions and revoked individually. API keys identify an app; OAuth delegates a user's access to an app.

What is an OAuth access token?

It's the credential the app receives after you approve access, and it's sent with each API request to prove the app is allowed in. Access tokens are deliberately short-lived and scoped to specific permissions, so a leaked one causes limited, time-bounded damage. They're commonly JWTs, which means their contents can be decoded and inspected.

Does OAuth encrypt my data?

No. OAuth is an authorization framework, not an encryption protocol. It defines how tokens are requested and granted; the confidentiality of those tokens in transit comes from HTTPS/TLS underneath. OAuth assumes it's running over a secure channel and does not add encryption of its own.

RM

Ravi Menon writes for CodeUtilityKit, where the team builds free, privacy-first developer tools that run entirely in your browser. Every guide is written and reviewed by developers who use these tools daily.