OAuth Implicit Grant Deprecation: Transitioning to Authorization Code with PKCE
0 reputation · 25 Sept 2021, 12:47 UTC
0 reputation · 25 Sept 2021, 12:47 UTC
The goal is to maintain the ability to revert a client’s configuration from the authorization code flow with PKCE back to the deprecated implicit grant after a failed upgrade, while preserving existing sessions and tokens.
Constraints include the absence of a defined deprecation window for the implicit grant in OAuth 2.0/2.1, the need to keep both grant types registered simultaneously, and the risk that refresh‑token rotation with reuse detection may invalidate an entire token family if an older client replays a rotated token. Additionally, token format changes (opaque vs. JWT access tokens) are only reversible if resource servers accept both formats during the transition.
What overlap period and monitoring criteria should be used before disabling the implicit grant? How can resource servers be configured to accept both opaque and JWT access tokens during the transition to allow rollback?
34775 reputation · 25 Sept 2021, 20:31 UTC
There is no spec-defined deprecation window to comply with: OAuth 2.1 (still a draft) removes the implicit grant without setting a timeline, so the overlap must be derived from your own telemetry. A defensible operational gate is to keep both grants registered for at least 90 days — long enough to span one full session-lifetime cycle plus your slowest client-release cadence — and disable implicit only after its share of token issuance stays below roughly 5% for 30 consecutive days, with no critical errors on the authorization-code + PKCE path.
For rollback, configure every resource server to validate both token formats during the overlap: attempt local JWT validation first (signature via the JWKS endpoint, then issuer, audience, and expiry), and fall back to RFC 7662 introspection for opaque tokens. Normalize both paths into the same principal and claims shape so authorization policy never depends on token format. Remove the opaque path only after the rollback window closes.
prompt=none), not refresh-based continuity.| Metric | Gate |
|---|---|
| Grant-type mix at token issuance | Implicit below ~5% for 30 consecutive days |
| Authorization-code + PKCE error rate (invalid_grant, code_challenge failures) | No upward trend; near zero for released clients |
| Refresh-token rotation failures and reuse-detection family revocations | No spikes; separable from downgrade noise |
| Silent-renewal (prompt=none) failure rate | Stable against the pre-migration baseline |
| Session-expiry anomalies and auth-related support volume | No sustained increase |
The reuse-detection hazard bites upgraded clients: if a stale build replays a previously rotated refresh token, the server revokes the entire token family and the user is logged out everywhere. During the overlap, enable a rotation grace window if your server offers one — accepting the superseded token briefly without treating it as reuse — and alert on family-revocation events so downgrade noise stays separable from attack signals. Also avoid revoking outstanding access tokens when you flip a client's configuration; let existing implicit tokens age out naturally so rollback never strands valid sessions.
Sketch of the fallback order:
principal = validateJwt(token) ?? introspect(token)
if principal is null:
return 401Do your resource servers already hold introspection credentials and network access to the authorization server? If not, opaque tokens issued under rollback cannot be validated at all, and the plan must change: either route traffic through a gateway that performs introspection centrally, or configure the authorization server to issue JWTs for the implicit grant during the transition.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.