What is OAuth? Explained with a key card from the front desk
OAuth lets one app use your account in another service, with limited and time-limited access, without your password. Explained with a front desk that gives your cleaner a kitchen-only key card.
- Author
Umair Mateen- Published
- Reading time
- 5 min
- Category
- Engineering
Our story on AWS IAM Credential Broker, and the one on Google Workspace asking AI agents to use MCP, both lean on one idea: OAuth.
In one sentence: OAuth is an open standard that lets you give one app limited, time-limited access to your account in another service, without ever handing over your password.
The everyday picture
Imagine you live in a block of flats with a front desk. You hire a cleaner to tidy your kitchen while you are at work.
You could give the cleaner your own front-door key. But that key opens every room, never expires, and you would have to change the locks to take it back.
Instead, the cleaner goes to the front desk. The desk phones you: "A cleaner wants to get into your kitchen today. Is that OK?" You say yes. The desk hands the cleaner a key card that opens only the kitchen, and only until this evening. Your own key never leaves your pocket.
The app asks the front desk, the desk checks with you, and you approve a key card that opens only the rooms you chose, for a limited time.
How it works, step by step
- The app (the cleaner) wants something from your account, such as adding events to your calendar. It sends you to the authorization server (the front desk), which belongs to the service that holds your account.
- You sign in with that service, not with the app. The app never sees your password, just as the cleaner never holds your front-door key.
- The consent screen (the phone call from the desk) lists what the app is asking for. These requested permissions are called scopes (which rooms). You approve or refuse.
- If you approve, the authorization server gives the app an access token (the key card). It covers only the approved scopes and stops working after a set time.
- The app shows the access token to the resource server (your flat's door), the system that holds your data. The door checks the card and lets the app do only what the card allows.
- Some apps also get a refresh token (a pass the cleaner shows only at the front desk). When the key card expires, the app uses it to get a new card without asking you again. You can cancel that pass at any time.
Try it · What would you do?
What should you do with this consent screen?
A new meeting-booking app asks to connect to your work account. Its consent screen asks to see, edit and delete all your calendars, and to read all your email. You only want it to add meetings to your calendar.
Pick what you would do. You can change your mind.
Where the picture stops
- A real front desk would recognise the cleaner by sight. In OAuth, each app must be registered with the service in advance as an "OAuth client", and the service checks that it is talking to the registered app.
- The "phone call" is usually a screen in your browser, and it only happens once. With a refresh token, the app can keep getting new key cards for weeks or months until you or an administrator cancel its access.
- OAuth is about access, not about proving who you are. The "Sign in with…" buttons on websites usually use OpenID Connect, a separate layer built on top of OAuth that adds proof of identity.
Why it matters for your business
- Less risk from shared passwords. Staff can connect tools to work accounts without typing their password into someone else's app. The current OAuth security guidance, RFC 9700 (January 2025), says the older approach of an app collecting your username and password "MUST NOT be used".
- Smaller damage if something leaks. A stolen access token opens only what its scopes allow, and only until it expires. The same guidance says an app's permissions should be kept to the minimum it needs.
- Easy to switch off. You can cancel one app's access without changing your password or affecting other apps.
- AI agents run on it. When an AI assistant connects to your email, calendar or CRM, it is usually through OAuth. That makes the consent screen the place to decide how much an agent may touch.
An example
Imagine a 15-person design studio that wants an AI assistant to book client meetings. The assistant's consent screen asks to read and change all calendars and to read all email. The office manager asks the vendor whether booking meetings really needs email access. The vendor offers a calendar-only setting, so the studio approves only that. Months later the studio changes tools. The manager removes the assistant's access in the admin panel, and nobody has to change a password.
Frequently asked questions
Is OAuth the same as single sign-on?
No. Single sign-on lets you log in to many apps with one account. OAuth lets one app use another service on your behalf. "Sign in with…" buttons combine the two, using OpenID Connect on top of OAuth.
What is the difference between OAuth and an API key?
An API key is one long-lived secret that usually gives the same access to anyone holding it. OAuth gives each app short-lived access tokens, limited to what a person or administrator approved, which can be cancelled one app at a time.
Is OAuth secure?
It is the widely used standard for this job, but it is only as safe as its setup. Apps should ask for as few scopes as possible, and people should read consent screens before clicking yes.
How do I remove an app's access?
Open the security or connected-apps settings of the account the app connects to, such as your Google or Microsoft account, and remove the app. Its refresh token stops working, so it cannot get new access tokens.
Related explainers
- Single sign-on and two-factor authentication, explained
- What is an API key?
- What is least privilege?
- What is agent identity?
The DevDrift builds AI connectors and automations that ask only for the access they need: see how.
Sources
Could you explain this to a colleague now?
Mark it and posts that mention it will show a tick. Saved in this browser only.