Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
OAuth 2.0 is a delegated authorisation framework. It lets an application act on your behalf against an API without ever being given your password.

What Is OAuth 2.0?
Before OAuth, an application that wanted to read your calendar asked for your password and signed in as you. That gave it everything—mail, files, the ability to change your password—and you could only revoke it by changing the credential. OAuth 2.0, specified in RFC 6749 and refined by a decade of extensions, replaced that with delegated authorisation: you approve a specific, limited permission, and the application receives a token rather than a credential.
The distinction that trips people up is in the name. OAuth authorises; it does not authenticate. It tells an API what an application is allowed to do. It does not, on its own, tell an application who you are—that is what OpenID Connect adds on top. Applications built on OAuth alone for login have produced a long history of account takeover bugs.
| Grant | Use it for | Status |
|---|---|---|
| Authorisation code with PKCE | Web, mobile, and single-page applications | Recommended for all interactive clients |
| Client credentials | Service-to-service with no user | Current |
| Device authorisation | Televisions, consoles, command line tools | Current, restrict carefully |
| Implicit | Nothing | Deprecated; tokens exposed in the URL fragment |
| Resource owner password credentials | Nothing | Deprecated; the application handles the password |
The guidance in the OAuth 2.0 Security Best Current Practice document is unambiguous on the last two: do not use them in new work, and migrate existing uses. PKCE is now recommended for every client, confidential ones included, not only for public clients as originally scoped. Client credentials and the device code flow each have their own entries.
A scope names a permission: calendar.read, files.readwrite.all, mail.send. The consent screen lists them, and the resource server enforces them on every call. In principle this is a clean least-privilege mechanism.
In practice two things undermine it. Applications request broad scopes because it is easier than requesting narrow ones and returning for more later, and users approve whatever is in front of them. That combination is the entire basis of consent phishing, where an attacker registers an application with an innocuous name, sends a link, and obtains a token that reads a mailbox indefinitely—surviving password resets and unaffected by multi-factor authentication, because nothing was ever stolen. Restricting user consent and reviewing granted permissions periodically is the only real defence.
state value bound to the user’s session, the flow is open to cross-site request forgery, letting an attacker link their own account to a victim’s session.Bearer tokens are the weak point, because anyone holding one can use it. Sender-constrained tokens tie a token to a key the client holds—DPoP at the application layer, mutual TLS at the transport layer—so theft alone achieves nothing. The UK Open Banking programme and the wider Financial-grade API profile already require this kind of constraint, and the practice is spreading outward from regulated sectors.
For most teams, the practical checklist is short: authorisation code with PKCE for anything interactive, exact redirect URIs, state and nonce where applicable, narrow scopes, short token lifetimes, audience checks, and a consent policy that does not let an unprompted click hand a stranger a mailbox.
At Privia Security, we test OAuth implementations and token handling in our web application security services.
No. It is an authorisation framework that tells an API what an application may do, and it says nothing reliable about who the user is. Building login on OAuth alone has produced many account takeover vulnerabilities. Use OpenID Connect, which defines an identity token with validated claims and a nonce, when you need to authenticate a person.
Authorisation code with PKCE for anything with a user present, including web, mobile, and single-page applications. Client credentials for service-to-service calls with no user. Device authorisation only for input-constrained devices, and restricted to those. The implicit and resource owner password credentials grants are deprecated and should not appear in new work.
An attacker registers an OAuth application with a plausible name and sends a link requesting broad permissions such as reading mail or files. The victim approves on the genuine identity provider page, and the attacker receives a token. No password is stolen, multi-factor authentication is bypassed entirely, and the access survives a password reset until the grant is revoked.
Minutes rather than hours. Fifteen minutes is a reasonable default for most APIs and less for high-value operations, with refresh tokens handling continuity and rotating on each use. Because a valid token keeps working after an account is disabled, short lifetimes are the main thing limiting the damage from theft, alongside sender-constrained tokens and tested revocation.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.