Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is OAuth 2.0?

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.

Illustration for the cybersecurity term OAuth 2.0
Home / Blog / Cybersecurity Terms / What Is OAuth 2.0?
17 November 2026

What Is OAuth 2.0?

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.

The Cast

Which Grant to Use

GrantUse it forStatus
Authorisation code with PKCEWeb, mobile, and single-page applicationsRecommended for all interactive clients
Client credentialsService-to-service with no userCurrent
Device authorisationTelevisions, consoles, command line toolsCurrent, restrict carefully
ImplicitNothingDeprecated; tokens exposed in the URL fragment
Resource owner password credentialsNothingDeprecated; 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.

Scopes, Consent, and the Thing Users Actually Click

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.

The Implementation Mistakes That Recur

  1. Loose redirect URI matching. Register exact URIs and compare them exactly. Wildcards, prefix matching, and open redirects on the registered host have all been used to steal authorisation codes.
  2. No state parameter. Without a cryptographically random 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.
  3. Skipping audience validation. A resource server that accepts any token from a trusted issuer will accept one minted for a different API. Check the audience claim on every request, as covered in JSON Web Token validation.
  4. Long-lived tokens with no revocation path. Keep access tokens to minutes, rotate refresh tokens on use, and make sure revocation is implemented and tested before you need it.
  5. Tokens in the wrong place. Access tokens in URL query strings end up in server logs, browser history, and referrer headers. Send them in a header, and in browsers prefer a cookie marked HttpOnly, Secure, and SameSite over local storage.

Where It Is Heading

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.

FAQ – Frequently Asked Questions

Is OAuth 2.0 an Authentication Protocol?

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.

Which OAuth Grant Should I Use?

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.

What Is Consent Phishing?

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.

How Long Should Access Tokens Last?

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.

Related Terms

You May Be Interested In These

What Is a Safety Integrity Level?

Cybersecurity Terms

17 November 2026

What Is a Safety Integrity Level?

Read More
What Is DKIM?

Cybersecurity Terms

17 November 2026

What Is DKIM?

Read More
What Is a MAC Address?

Cybersecurity Terms

30 March 2021

What Is a MAC Address?

Read More