HOW-TO GUIDE | AUTHENTICATION
13 min read

OAuth 2.1 Migration: A Practical Runbook for Removing Implicit Grant and Adding PKCE

Step-by-step guidance for moving SPAs, mobile apps, and server-side clients off the Implicit Grant flow and onto Authorization Code with PKCE, without breaking existing sign-ins

3 flows
removed outright by OAuth 2.1: the Implicit Grant, the Resource Owner Password Credentials grant, and bearer tokens passed in URL query strings
PKCE required
for every OAuth client using the Authorization Code flow under OAuth 2.1, public or confidential, not just single-page apps and mobile apps
Draft, not RFC
OAuth 2.1 remains an active IETF Internet-Draft rather than a published RFC, though Okta, Auth0, Microsoft Entra, and Keycloak already support its core requirements

SponsoredHorizon3.ai

Proactive Security for the AI Era

NodeZero continuously and autonomously pentests infrastructure, identity, cloud, and now web applications, chaining weaknesses across every domain the way real attackers do. Every finding ships with replayable proof showing exploitable business impact, not theoretical risk.

See NodeZero WebApp in action

A lot of organizations running OAuth 2.0 still have at least one client, often an older single-page application or an internal tool nobody has touched in years, configured for the Implicit Grant flow. OAuth 2.1 removes that flow outright, along with the Resource Owner Password Credentials grant and bearer tokens in URL query strings, and requires PKCE on every client using Authorization Code, public or confidential. None of that is controversial from a security standpoint; Implicit Grant has been discouraged since the OAuth Security Best Current Practice (RFC 9700) and its predecessor drafts. What is harder is the actual mechanics of migrating a production client population without breaking sign-in for real users mid-rollout. This is a runbook for that migration: what to inventory before touching anything, the order PKCE rollout and Implicit Grant removal have to happen in, how the work differs for SPAs versus mobile apps versus already-confidential server-side clients, how to validate the cutover actually worked, and the specific failure modes that show up when the rollout order is wrong. This is a general-purpose migration guide for standard web, mobile, and SPA OAuth clients. If you are specifically migrating AI agent orchestration frameworks like LangChain, CrewAI, or AutoGen to OAuth 2.1, see our agent-specific governance guide instead, which covers per-tool scopes and approval gates that do not apply to a standard client migration.

The problem: what is actually wrong with Implicit Grant

Implicit Grant (response_type=token) returns the access token directly in the browser's URL fragment as part of the redirect back from the authorization server, with no authorization code and no token exchange step in between. That design has three concrete problems. First, a token in a URL fragment can end up in browser history, in referrer headers sent to third-party scripts on the redirect page, and in server access logs if any intermediate hop logs the full URL. Second, there is no client authentication step at all, so any party that can intercept the redirect gets a usable token immediately, with nothing further to steal. Third, because there is no authorization code, there is nothing for PKCE to protect; PKCE works by binding the code exchange to a secret the client generated before redirect, and Implicit Grant has no exchange step to bind. OAuth 2.1 formalizes what identity providers have recommended since RFC 9700: every client, public or confidential, uses Authorization Code with PKCE, and Implicit Grant, along with the Resource Owner Password Credentials grant and bearer tokens in query strings, is removed rather than merely deprecated.

Prerequisites before you touch a single client

Do not start reconfiguring the identity provider or shipping client updates before these are in place. Skipping the inventory step is the single most common cause of an incomplete or broken rollout.

Subscribe to unlock Remediation & Mitigation steps

Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.

Free daily briefing

Briefings like this, every morning before 9am.

Threat intel, active CVEs, and campaign alerts, distilled for practitioners. 50,000+ subscribers. No noise.

The migration runbook: step by step

Run these steps in this order, one client at a time if you have more than a handful. Do not skip ahead to disabling Implicit Grant before the client-side steps have reached full rollout for that client, that ordering mistake is covered in the failure cases section below.

Subscribe to unlock Remediation & Mitigation steps

Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.

Client-specific considerations: SPAs, mobile apps, and server-side apps

The runbook above applies to every client type, but the details differ enough to call out separately. Single-page applications are public clients with no client secret, so PKCE is doing the entire job of proving the token exchange request came from the same client that started the authorization request. Use the S256 code challenge method, keep the code_verifier in memory rather than in storage that persists across page loads unless you also handle the redirect-and-reload case carefully, and confirm your OAuth library actually supports PKCE for SPAs specifically, since some older SDK versions built for Implicit Grant do not add PKCE support automatically on upgrade. Mobile apps have their own wrinkle: the authorization request needs to happen in a system browser component, such as ASWebAuthenticationSession on iOS or Chrome Custom Tabs on Android, rather than an embedded webview, since an embedded webview can be manipulated by the host app to intercept the code, undermining part of what PKCE is meant to prevent. Confirm the redirect URI scheme is registered exactly as the mobile OS expects, since custom URI schemes are also subject to the exact-match requirement. Server-side, confidential clients that were already using Authorization Code do not need to change their flow, but OAuth 2.1 still expects PKCE added to these too, since a client secret protects the token exchange step but does not protect the authorization code itself from interception in transit.

Validation: confirming the migration actually worked

Do not consider a client migrated because the code deployed without errors. Confirm each of the following before removing Implicit Grant for that client, and again after.

Subscribe to unlock Remediation & Mitigation steps

Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.

Failure cases: what breaks when the rollout order is wrong

Every failure mode below traces back to a step being run out of order relative to the runbook above, not to PKCE or Authorization Code being inherently fragile.

Subscribe to unlock Remediation & Mitigation steps

Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.

Security tradeoffs and residual risk

PKCE closes a specific gap: it prevents a stolen or intercepted authorization code from being exchanged for tokens by a party that does not hold the original code_verifier. It does not, by itself, protect a token that has already been issued and stored insecurely, which is why token storage is called out as its own step in the runbook rather than treated as a side effect of the PKCE change. A SPA that migrates to Authorization Code with PKCE but still stores the resulting access token in localStorage has closed the code-interception gap while leaving an XSS-driven token theft gap wide open. PKCE also does not replace the value of short-lived access tokens, refresh token rotation, or sender-constrained tokens (DPoP or mutual TLS) for genuinely high-value clients; treat OAuth 2.1 compliance as the floor for a modern OAuth deployment, not the ceiling. Teams running this migration alongside a broader identity hardening push often have Entra ID legacy authentication protocols in scope at the same time; see our guide on blocking legacy authentication in Microsoft 365 and Entra ID if that is also on your list, since both efforts touch the same client registrations and both fail the same way when rolled out to every user at once instead of staged. If MFA policy is part of the same identity modernization effort, our Cisco Duo vs Okta MFA comparison covers how the two handle step-up authentication and conditional access, which is a separate but related decision from the OAuth flow itself.

The bottom line

OAuth 2.1 removes Implicit Grant, the Resource Owner Password Credentials grant, and bearer tokens in query strings, and requires PKCE on every client using Authorization Code, public or confidential. It is still an IETF Internet-Draft rather than a finalized RFC, but Okta, Auth0, Microsoft Entra, and Keycloak already support its core requirements, so there is no need to wait for a final RFC number before migrating. The actual risk in this migration is almost never PKCE itself; it is rollout order. Disable Implicit Grant before every client has shipped PKCE support and users cannot sign in. Enforce exact redirect URI matching before updating registered URIs and valid clients break. Run the identity provider configuration change and the client code deployment in the same release and you lose the ability to tell which one caused a sign-in failure when something goes wrong. Inventory every client and its grant types first, enable both flows side by side, roll out client changes in stages while watching per-client grant type telemetry, and only then remove Implicit Grant client by client. That order is slower than a single global cutover, and it is also the difference between a migration users never notice and one that generates a flood of support tickets on the same afternoon.

Frequently asked questions

Is OAuth 2.1 a final, published standard we have to comply with?

Not yet in the formal sense. OAuth 2.1 is still an active IETF Internet-Draft rather than a finalized RFC, meaning its text can still change before publication. In practice this rarely matters for a migration decision, because OAuth 2.1 does not invent new rules so much as consolidate security practices from RFC 7636 (PKCE), RFC 8252 (native apps), and RFC 9700 (the OAuth Security Best Current Practice) that identity providers have already been recommending for years. Okta, Auth0, Microsoft Entra, and Keycloak all support PKCE and exact redirect URI matching today, so a team can adopt OAuth 2.1's requirements now without waiting for the draft to become an RFC.

Why does OAuth 2.1 remove the Implicit Grant flow entirely?

Implicit Grant returns the access token directly in the browser's URL fragment after redirect, with no client authentication step and no code to exchange. That token can leak through browser history, referrer headers, server access logs, and browser extensions, and because there is no authorization code intermediary, there is nothing for PKCE to protect. The flow was designed in 2012 for browsers that could not make cross-origin requests from JavaScript, a constraint that no longer applies, so OAuth 2.1 removes it in favor of Authorization Code with PKCE for every public client, including single-page applications.

Do confidential server-side clients need PKCE too, or is it only for SPAs and mobile apps?

OAuth 2.1 requires PKCE for every client using the Authorization Code flow, confidential clients with a client secret included, not only public clients like SPAs and mobile apps. A confidential client's secret protects the token exchange step, but PKCE additionally protects the authorization code itself from interception between the redirect and the token request, for example if a code is captured by a malicious app registered to intercept the same custom URI scheme or by a network-level attacker. Adding PKCE to an already-confidential server-side client is low effort and closes that separate gap rather than being redundant with client authentication.

What breaks if we disable Implicit Grant before every client has PKCE support deployed?

Any client still configured to request response_type=token will get an invalid_request or unsupported_response_type error back from the authorization server the moment Implicit Grant is disabled, and users of that client will be unable to sign in at all until it is redeployed with Authorization Code and PKCE support. This is the most common rollout mistake: disabling the grant type at the identity provider before the client population that depends on it has shipped an update. The runbook in this piece treats client-side PKCE rollout as a prerequisite that must reach zero remaining Implicit Grant traffic before the flow is disabled, not something to flip in parallel.

Can Implicit Grant and Authorization Code with PKCE run side by side during migration?

Yes, and this is the safest way to run the cutover. Most identity providers, including Okta, Auth0, Microsoft Entra, and Keycloak, let an application register multiple allowed grant types simultaneously, so both flows can be enabled on the same client while newer builds are rolled out to users. The migration then becomes a matter of shipping the PKCE-enabled client, watching grant type telemetry until Implicit Grant traffic drops to zero for that client, and only then removing Implicit Grant from its allowed grant type list, rather than an instantaneous switch that assumes every user has already updated.

Which identity providers already support PKCE and OAuth 2.1-aligned configuration?

Okta, Auth0, Microsoft Entra (Azure AD), and Keycloak all support PKCE for the Authorization Code flow today, and all four expose settings to require exact redirect URI matching and to restrict which grant types a given application is allowed to use. None of them require OAuth 2.1 to be a finalized RFC before a team can configure a client to those standards. The practical work of an OAuth 2.1 migration is almost entirely about reconfiguring existing IdP client settings and updating client-side code, not waiting on a vendor to ship new capability.

Sources & references

  1. OAuth.net - OAuth 2.1
  2. IETF Datatracker - draft-ietf-oauth-v2-1 (OAuth 2.1)
  3. IETF RFC Editor - RFC 7636: Proof Key for Code Exchange (PKCE)
  4. IETF RFC Editor - RFC 9700: Best Current Practice for OAuth 2.0 Security
  5. Descope - OAuth 2.0 vs OAuth 2.1: Key Differences, Security Changes, and MCP Impact
  6. WorkOS - OAuth 2.1: What's New, What's Gone, and How to Migrate Securely
  7. Okta Developer - Implement authorization by grant type: Implicit
  8. Microsoft Learn - OAuth 2.0 implicit grant flow (Microsoft identity platform)
  9. OAuth.net - Implicit Flow (Deprecated)

Free resources

25
Free download

Critical CVE Reference Card 2025–2026

25 actively exploited vulnerabilities with CVSS scores, exploit status, and patch availability. Print it, pin it, share it with your SOC team.

No spam. Unsubscribe anytime.

Free download

Ransomware Incident Response Playbook

Step-by-step 24-hour IR checklist covering detection, containment, eradication, and recovery. Built for SOC teams, IR leads, and CISOs.

No spam. Unsubscribe anytime.

Free newsletter

Get threat intel before your inbox does.

50,000+ security professionals read Decryption Digest for early warnings on zero-days, ransomware, and nation-state campaigns. Free, daily, no spam.

Unsubscribe anytime. We never sell your data.

Eric Bang
Author

Founder & Cybersecurity Evangelist, Decryption Digest

Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals every morning.

Giveaway: InfoSec World 2026 All Access Pass ($3,895 value)

Details →
Daily Briefing

Subscribe to enter the giveaway

Every subscriber is automatically entered. You also get daily threat intel every morning: zero-days, ransomware, and nation-state campaigns. Free. No spam.

Already subscribed? You're already entered.

Giveaway

Win a $3,895 InfoSec World 2026 pass.