Which redirect_uri can receive the access token of an implicit grant?
Implicit grant redirection URI matches a registered redirection URIRFC 6749 §4.2.1MUSTRoles: authorization_server
Requirement as recorded in the ProtocolSoup registry
The authorization server MUST verify that the redirection URI to which it will redirect the access token matches a redirection URI registered by the client as described in Section 3.1.2.
Read §4.2.1 in RFC 6749Self-test verdict
PassCommit 00bac3fEvaluated
This is ProtocolSoup's result against its own implementation at the commit shown. It is not a certification of ProtocolSoup or of any other product.
Captured from production
Captured Commit 00bac3f
Captured from the deployed ProtocolSoup at the commit shown. Every request and response is shown exactly as sent and received.
Passing exchange
Accepted, as requiredConformance client
The conformance client sends public-app's implicit grant request, response_type=token, with a redirect_uri the client registered. The authorization server serves the sign-in page; the access token it will issue goes to that URI.
Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.
1.GET https://protocolsoup.com/oauth2/authorize?client_id=public-app&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=token&scope=profile&state=-lgtJ9-qhmTW4zc0aBYTeQ200 OK
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=public-app&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=token&scope=profile&state=-lgtJ9-qhmTW4zc0aBYTeQ HTTP/2.0 Accept: text/html Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 200 OK Cf-Cache-Status: DYNAMIC Cf-Ray: a65baacddaf13cdb-MSP Content-Type: text/html Date: Sun, 06 Dec 2026 13:34:17 GMT Fly-Request-Id: 01M95RZZ5QY37TMFES91Z459B7-ord Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800} Referrer-Policy: strict-origin-when-cross-origin Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=gCV84sTvRuRqYl6ZZP1pKYOWjIPj7A60oiFYhVuf%2FTKCWNX9Gm9Q8mKQExHCi6wcuYQhVEijFhl5cLcf06OQXiSdmS%2BOug91%2FDqjKIPlG2x%2F8EHN0H5XDRfU9Wydmbn5aHs%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=4,cfOrigin;dur=202 Speculation-Rules: "/cdn-cgi/speculation" Vary: Origin Vary: accept-encoding Via: 1.1 fly.io, 1.1 fly.io X-Content-Type-Options: nosniff X-Frame-Options: DENY X-Xss-Protection: 1; mode=block <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>Login - Protocol Showcase</title> <style> * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: 'Segoe UI', system-ui, sans-serif; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; color: #e4e4e7; padding: 16px; } .container { background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 28px; width: 100%; max-width: 420px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); } @media (min-width: 480px) { body { padding: 0; } .container { padding: 40px; } } .logo { text-align: center; margin-bottom: 30px; } .logo h1 { font-size: 24px; font-weight: 600; color: #fff; } .logo p { color: #a1a1aa; font-size: 14px; margin-top: 8px; } .client-info { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 8px; padding: 16px; margin-bottom: 24px; text-align: center; } .client-info span { color: #a5b4fc; font-size: 14px; } .client-info strong { color: #fff; } .form-group { margin-bottom: 20px; } label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; color: #d4d4d8; } input[type="email"], input[type="password"], input[type="text"] { width: 100%; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; background: rgba(0, 0, 0, 0.2); color: #fff; font-size: 16px; transition: all 0.2s; } input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); } button { width: 100%; padding: 14px; background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); border: none; border-radius: 8px; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; } button:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5); } .error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #fca5a5; padding: 12px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; } .demo-users { margin-top: 24px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.1); } .demo-users h3 { font-size: 14px; color: #a1a1aa; margin-bottom: 12px; } .demo-user { background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; } .demo-user:hover { background: rgba(99, 102, 241, 0.1); border-color: rgba(99, 102, 241, 0.2); } .demo-user .name { font-weight: 500; color: #fff; } .demo-user .email { font-size: 12px; color: #71717a; } .scopes { margin-top: 16px; font-size: 12px; color: #71717a; } .scopes span { display: inline-block; background: rgba(99, 102, 241, 0.1); padding: 4px 8px; border-radius: 4px; margin: 2px; } </style> </head> <body> <div class="container"> <div class="logo"> <h1>Protocol Showcase</h1> <p>OAuth 2.0 Implicit Grant</p> </div> <div class="client-info"> <span>Signing in to <strong>Public Application (SPA)</strong></span> </div> <!-- ERROR --> <form method="POST" action="/oauth2/authorize"> <input type="hidden" name="login_request_id" value="AiweejGUrjCSB3z98jVcGg"> <div class="form-group"> <label for="email">Email</label> <input type="email" id="email" name="email" placeholder="[email protected]" required> </div> <div class="form-group"> <label for="password">Password</label> <input type="password" id="password" name="password" placeholder="password" required> </div> <button type="submit">Sign In</button> </form> <div class="demo-users"><h3>Demo Users (click to autofill)</h3><div class="demo-user" data-email="[email protected]" data-password="4bbw3nqtTsR9az7s2albdeeu" onclick="fillCredentials(this.dataset.email || '', this.dataset.password || '')"><div class="name">Alice (Standard User)</div><div class="email"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="12737e7b717752776a737f627e773c717d7f">[email protected]</a></div></div><div class="demo-user" data-email="[email protected]" data-password="6PdvnYFdfrvoyxTXbzmHF9c1" onclick="fillCredentials(this.dataset.email || '', this.dataset.password || '')"><div class="name">Bob (Standard User)</div><div class="email"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="accec3ceecc9d4cdc1dcc0c982cfc3c1">[email protected]</a></div></div><div class="demo-user" data-email="[email protected]" data-password="ETi7vCbBBwojO-wKkmBZp81Q" onclick="fillCredentials(this.dataset.email || '', this.dataset.password || '')"><div class="name">Admin (Elevated Permissions)</div><div class="email"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b8d9dcd5d1d6f8ddc0d9d5c8d4dd96dbd7d5">[email protected]</a></div></div></div> <div class="scopes"> Requested scopes: <span>profile</span> </div> </div> <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script> function fillCredentials(email, password) { document.getElementById('email').value = email; document.getElementById('password').value = password; } </script> <script>(function(){function c(){var b=a.contentDocument||(a.contentWindow&&a.contentWindow.document);if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a65baacddaf13cdb',t:'MTc5NjU2NDA1Nw=='};var l=window.parent.location,o;try{o=new URL(l.origin).origin}catch(e){try{o=new URL(new URL(l.href).origin).origin}catch(e){o=''}}var u='/cdn-cgi/challenge-platform/scripts/jsd/main.js?ray=a65baacddaf13cdb',a=document.createElement('script');a.src=o?new URL(u,o).href:u;document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script><script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/vce701823e78c4301a35b7e07294d87301792088814092" integrity="sha512-UKNk8GbxkABxKcXYuLkO16EleLGUkcvJWtpSNmExE0Too3ZaFAxTscNWEc1OdAv5/BikHawapSCaiD2XCmp+Bw==" data-cf-beacon='{"version":"2024.11.0","token":"4e68ea7d404d48c4b57e5a383f411883","spa":2}' crossorigin="anonymous"></script> </body> </html>
Failing exchange
Rejected, as requiredConformance client
The conformance client sends an implicit grant request three times: without redirect_uri, with a redirect_uri public-app never registered, and with a client_id the authorization server does not know. Each is answered 400 and the user-agent is sent nowhere.
Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.
1.GET https://protocolsoup.com/oauth2/authorize?client_id=public-app&response_type=token&scope=profile&state=hU788fbtOB1_rdkdQsziZw400 Bad Request
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=public-app&response_type=token&scope=profile&state=hU788fbtOB1_rdkdQsziZw HTTP/2.0 Accept: text/html Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65baad41fef3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:34:18 GMT Fly-Request-Id: 01M95S004ZEEHEH2XJ1XANVTKT-ord Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800} Pragma: no-cache Referrer-Policy: strict-origin-when-cross-origin Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=k3rNVZR188Poa0smw%2F6kwzUUKH%2FVKNqFwZCiqe%2BPyYFLQv0KuPocBBbL8ISu8Lw4O32i3%2Bm42XcxlVvsZIvIRpEwf8PXMtkhTRTBGkjDYWoDldFJkbvdtUUgUevSFxs2OV0%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=5,cfOrigin;dur=201 Speculation-Rules: "/cdn-cgi/speculation" Vary: Origin Vary: accept-encoding Via: 1.1 fly.io, 1.1 fly.io X-Content-Type-Options: nosniff X-Frame-Options: DENY X-Xss-Protection: 1; mode=block {"error":"invalid_request","error_description":"Invalid redirect_uri","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}2.GET https://protocolsoup.com/oauth2/authorize?client_id=public-app&redirect_uri=https%3A%2F%2Fclient.invalid%2Fcallback&response_type=token&scope=profile&state=xmDAN92pGbopWAwdT-XIFg400 Bad Request
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=public-app&redirect_uri=https%3A%2F%2Fclient.invalid%2Fcallback&response_type=token&scope=profile&state=xmDAN92pGbopWAwdT-XIFg HTTP/2.0 Accept: text/html Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65baada5c703cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:34:19 GMT Fly-Request-Id: 01M95S0146F8M6TW0DE9GPZAMN-ord Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800} Pragma: no-cache Referrer-Policy: strict-origin-when-cross-origin Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=VN%2Fr3kC28c22l0as%2BCMaFJpt861KSZXbK0k62XvN3D3VhhrtF208iSYlhfyonr1jajECmmhAH9tKSWO9KVGlaB%2BXeZijTQ7Rh6dHCi989BAOWogEFX7%2Bz6yC%2FT8riNplSNY%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=201 Speculation-Rules: "/cdn-cgi/speculation" Vary: Origin Vary: accept-encoding Via: 1.1 fly.io, 1.1 fly.io X-Content-Type-Options: nosniff X-Frame-Options: DENY X-Xss-Protection: 1; mode=block {"error":"invalid_request","error_description":"Invalid redirect_uri","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}3.GET https://protocolsoup.com/oauth2/authorize?client_id=no-such-client&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=token&scope=profile&state=i0MU9FcdbGRqa-RyNDZttw400 Bad Request
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=no-such-client&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=token&scope=profile&state=i0MU9FcdbGRqa-RyNDZttw HTTP/2.0 Accept: text/html Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65baae0a9a43cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:34:20 GMT Fly-Request-Id: 01M95S023E1KFR6VV9S0FGAB2E-ord Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800} Pragma: no-cache Referrer-Policy: strict-origin-when-cross-origin Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=Pn2QkvNbBu49hXoBIfXItz%2F3vTu%2BTCQ78HK6vvfnkuagcRPT9n2bZs1%2Fh9O6dCVutZvAYMzBrbYr5LUpCmsKZ5NS01CnH2a1Xs33nrKnzEjDaS1aWdR5UU%2FgqaEh6xEEc9s%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=201 Speculation-Rules: "/cdn-cgi/speculation" Vary: Origin Vary: accept-encoding Via: 1.1 fly.io, 1.1 fly.io X-Content-Type-Options: nosniff X-Frame-Options: DENY X-Xss-Protection: 1; mode=block {"error":"invalid_client","error_description":"Unknown client","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}
Run it live
Looking Glass runs the flow that sends the message this requirement governs, against the same server, and decodes each exchange as it happens.
Open the flow in Looking GlassTests
- TestImplicitGrantDoesNotRedirectInvalidClientOrRedirectURI
./internal/protocols/oauth2
Pass - TestRedirectURIIsMatchedByExactStringComparison
./internal/protocols/oauth2
Pass
Implementation
Explainer
What this requires
An implicit grant delivers its access token only to a redirection URI the client registered. In the implicit grant the authorization response is the token response: the access token is placed in the fragment of the redirection URI and the browser carries it there. So the server must confirm, before the user is asked to do anything, that the URI in the request is a registered one.
The check is the one in Section 3.1.2 that applies to every redirect. Section 4.2.1 repeats it as a MUST of its own because of what is being redirected.
Why it exists
The implicit grant has no second step. With an authorization code, a wrong redirect still leaves the thief needing to redeem the code. Here whoever receives the redirect has a usable bearer token at once. RFC 6749 describes the grant as "optimized for public clients known to operate a particular redirection URI", and that known URI is the only thing identifying the client.
This is also why current guidance steers away from the grant. RFC 9700 Section 2.1.2 says responses that carry access tokens in the authorization response "are vulnerable to access token leakage and access token replay".
What non-compliance looks like
An implicit endpoint that accepts any redirect_uri for a known public client_id. A crafted link then sends the victim's access token straight to the attacker's page.
How ProtocolSoup tests it
/oauth2/authorize runs the same client and redirection URI validation for response_type=token as for code, before the implicit branch is reached. The grant is offered only to a public client registered for it, public-app among the seeded clients. A confidential client that asks is refused with unauthorized_client in the fragment.
TestImplicitGrantDoesNotRedirectInvalidClientOrRedirectURI sends four implicit requests: no client_id, an unknown one, an unregistered redirect_uri and none. Each is a 400 with no Location, and the body does not repeat the rejected URI. TestRedirectURIIsMatchedByExactStringComparison runs its eleven near-miss URIs against response_type=token as well.
The captured passing exchange, implicit-request-with-registered-redirect-uri, is an implicit request by public-app answered with the sign-in page. The failing one, implicit-request-with-bad-redirect-uri-or-client, records three refusals.