OAuth Security Best Practices: The RFC 9700 Checklist

OAuth security best practices are collected in RFC 9700, the IETF's best current practice for OAuth 2.0. Its core rules: always use the authorization code flow with PKCE, match redirect URIs exactly, drop the implicit and password grants, and sender-constrain tokens where you can.

Key takeaways
  • PKCE is no longer optional. Public clients must use it; every client should.
  • Redirect URIs match exactly. No wildcards, no pattern matching, one narrow exception.
  • Two grants are retired. Implicit and resource owner password flows are out.
  • Tokens need binding and rotation. Sender-constraining and refresh rotation limit theft.
  • Check who answered. The iss parameter stops mix-up attacks between providers.

What is RFC 9700 and why does it matter?

RFC 9700, published by the IETF in January 2025, updates the OAuth threat model with lessons from a decade of real attacks.

It strengthens the advice in the original OAuth specifications and formally deprecates modes of operation now considered insecure.

Its recommendations also feed into OAuth 2.1, so following the BCP today puts you ahead of the next specification rather than behind it.

For the implementation side, our guide on how to implement OAuth in web apps covers the build steps.

Why is PKCE now required for the code flow?

PKCE binds an authorization code to the client instance that requested it, using a secret verifier and its hashed challenge.

Without it, an attacker who intercepts or injects a code can redeem it from their own client and walk away with tokens.

The BCP is specific: public clients must use PKCE, confidential clients are strongly recommended to, and authorization servers must support it.

Use the S256 challenge method. It is currently the only method that does not expose the verifier inside the authorization request.

Servers must also block downgrade attacks, accepting a verifier only when a challenge was present in the original request.

Which grants does the BCP tell you to retire?

The implicit grant goes first. It returns access tokens in the authorization response, where URLs, logs, and browser history can leak them.

Tokens issued that way also cannot be sender-constrained, so anyone who steals one can replay it from anywhere.

The resource owner password credentials grant goes too. It trains users to hand their password to client apps, defeating federation entirely.

Replace both with the authorization code flow, which delivers tokens from the token endpoint where servers can detect replay attempts.

When you audit third-party apps connected to your workspace, these legacy flows are worth flagging; our piece on OAuth app risk explains why.

How exact must redirect URI matching be?

Exact string matching, full stop. The authorization server compares the requested redirect URI character by character against the registered one.

The single exception is the port number in localhost redirect URIs used by native apps, which may vary.

Loose matching, wildcards, and open redirectors are how codes and tokens get steered to attacker-controlled endpoints.

The BCP also forbids exposing open redirector URLs on clients and servers, since they launder a trusted domain into an attack path.

PracticeAttack or failure it blocks
PKCE with S256Authorization code interception and injection
Exact redirect URI matchingToken leakage through manipulated URIs
No implicit grantToken exposure in URLs and browser history
Sender-constrained tokensReplay of stolen tokens from another client
Refresh token rotationLong-lived theft of refresh tokens
iss response checkMix-up attacks across authorization servers

How should you protect tokens in storage and transit?

Keep access tokens out of URLs entirely. The code flow exists partly so tokens travel in token responses, not in browser-visible addresses.

Restrict each token's privileges to the minimum the application needs. Narrow scopes shrink the value of any token that escapes.

On the client side, store tokens where your platform protects them best, and never in places other scripts or apps can read casually.

For SaaS admins, the mirror task is reviewing which connected apps hold broad tokens against your data, a job for regular access reviews.

What do sender-constrained tokens prevent?

A sender-constrained token only works when the presenter proves possession of a secret bound to that token.

The BCP recommends mutual TLS or DPoP for this binding. A stolen token, without the key, becomes a useless string.

This matters because token theft happens: logs leak, devices are lost, and proxies get misconfigured. Binding converts those incidents from breaches into non-events.

Not every ecosystem supports DPoP or mTLS today. Where it does not, shorter token lifetimes and narrow scopes are the fallback controls.

Tip

Audit your own integrations first. The oldest client in your stack is the one most likely to still use the implicit flow or a wildcard redirect.

How should refresh tokens be handled?

For public clients, the BCP requires refresh tokens to be sender-constrained or rotated. Rotation means each use issues a fresh token and invalidates the old one.

Rotation doubles as theft detection. If an old token reappears, either the client or an attacker is replaying it, and the server can revoke the family.

Confidential clients get a head start: their refresh tokens can only be used by the client they were issued to.

Pair rotation with sensible lifetimes. A refresh token that never expires and never rotates is a permanent credential wearing a temporary costume.

How do you stop mix-up and login CSRF attacks?

Mix-up attacks trick a client that talks to several authorization servers into sending credentials to the wrong one.

The defense is checking the issuer: clients should validate the iss parameter in the authorization response, as defined in RFC 9207.

For login CSRF, clients must bind each flow to the browser that started it, using a one-time state value, the OpenID Connect nonce, or PKCE itself.

These checks are cheap to implement and expensive to skip, which is why the BCP makes them requirements rather than suggestions. Treat OAuth posture as part of shadow IT risk, because every connected app is an OAuth client.

Two further recommendations round out the BCP for high-risk deployments. The first is stronger client authentication, such as private_key_jwt or mutual TLS instead of shared secrets.

Shared secrets leak from both ends of a partnership. Asymmetric credentials mean the authorization server never holds anything that can impersonate the client.

The second is pushed authorization requests, known as PAR, which the oauth.net summary recommends for high-security deployments.

PAR moves the authorization request out of the browser and into a direct, authenticated call, so parameters cannot be tampered with in transit.

Adopt in risk order: fix legacy grants and redirect matching first, add PKCE everywhere, then layer PAR and sender-constraining where the data justifies it.

Revisit the checklist whenever a new client type appears in your stack. Each new integration reopens questions the last audit settled.

For teams buying software rather than building it, the BCP still applies, as a set of vendor questions.

Ask providers whether their OAuth integrations use PKCE, whether redirect URIs are registered exactly, and whether any legacy implicit flows remain in their apps.

Ask, too, what scopes their connected apps request by default. A vendor that asks for broad access on day one is telling you something about its security culture.

Record the answers in your vendor reviews. OAuth posture is part of the risk a connected app brings into your estate, alongside its data access.

Keep a simple register of your own OAuth clients while you are at it: which flows each uses, which redirect URIs are registered, and when each was last reviewed.

The register turns the BCP from a document you admire into a checklist you can finish. Most teams find their legacy flows in the first pass.

Assign the register an owner and a review date. OAuth configuration drifts as surely as access does, and for the same reason: nobody's calendar holds it.

Document exceptions when a legacy client cannot comply yet. A named exception with a deadline beats a silent gap an auditor finds first.

Review the register after every major integration launch, not only on the annual date. New clients arrive with new defaults.

Sources

Frequently asked questions

What is the single most important OAuth security practice?

Use the authorization code flow with PKCE, with the S256 challenge method. RFC 9700 makes PKCE mandatory for public clients and recommended for everyone, because it stops code interception and injection attacks.

Is the implicit grant ever acceptable now?

The BCP says clients should not use it, because tokens issued in the authorization response leak through URLs and cannot be sender-constrained. Narrow exceptions exist only where leakage and injection are otherwise prevented, which is rare in practice.

What is a sender-constrained token?

It is an access token bound to a specific client through a key, using mutual TLS or DPoP. The resource server only accepts it when the presenter proves possession of that key, so a stolen token alone is useless.

How strict should redirect URI validation be?

Exact string matching against pre-registered URIs, with the only exception being the port in a native app's localhost URI. Wildcards and pattern matching are how codes and tokens get redirected to attackers.

Does RFC 9700 replace the original OAuth specification?

No. It updates and extends the security advice in RFCs 6749, 6750, and 6819, and deprecates some modes they allowed. Its recommendations are also being folded into OAuth 2.1.