What does the authorization endpoint return for a code_challenge_method it does not support?
invalid_request for an unsupported code challenge transformationRFC 7636 §4.4.1MUSTRoles: authorization_server
Requirement as recorded in the ProtocolSoup registry
If the server supporting PKCE does not support the requested transformation, the authorization endpoint MUST return the authorization error response with "error" value set to "invalid_request".
Read §4.4.1 in RFC 7636Self-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 authorization request with a code_challenge and code_challenge_method=S256, the transformation this authorization server supports. The sign-in page is served.
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&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=EzcV3TSIB_ZljQvvuxD0JA200 OK
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=public-app&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=EzcV3TSIB_ZljQvvuxD0JA 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: a65bb058aa983cdb-MSP Content-Type: text/html Date: Sun, 06 Dec 2026 13:38:04 GMT Fly-Request-Id: 01M95S6WVF6VAFK7XTBPC605MF-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=BT6Y3CVY%2FCHQ0rx7I4gIYmZOb4OfrMPvwNVF1ceJkG%2BLHMPUi093b%2FBKxZzS2vHE9HaMdUX9bu%2BfLn0bA3zVuzeDEhx8LFpuMD2IHfNliuHcrP4PrwtFx3TmlulNK%2B70Wcg%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=5,cfOrigin;dur=199 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 Authorization</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="heFyd40y72VuMYFIAm0N3g"> <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="caaba6a3a9af8aafb2aba7baa6afe4a9a5a7">[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="a2c0cdc0e2c7dac3cfd2cec78cc1cdcf">[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="4120252c282f012439202c312d246f222e2c">[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:'a65bb058aa983cdb',t:'MTc5NjU2NDI4NA=='};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=a65bb058aa983cdb',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 public-app's authorization request with a code_challenge twice: with code_challenge_method=plain, and with no code_challenge_method, which Section 4.3 defines as plain. This authorization server supports S256 only. Each request is answered with the authorization error response, error=invalid_request, in the query component of the redirect_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&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=plain&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=uWtCDs15c_A5WFzpWMv2og302 Found
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=public-app&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=plain&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=uWtCDs15c_A5WFzpWMv2og HTTP/2.0 Accept: text/html Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 302 Found Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bb05ed85e3cdb-MSP Content-Type: text/html; charset=utf-8 Date: Sun, 06 Dec 2026 13:38:05 GMT Fly-Request-Id: 01M95S6XTNPA30SXHDP37RDC3S-ord Location: https://protocolsoup.com/callback?error=invalid_request&error_description=the+requested+code_challenge_method+is+not+supported%3B+this+server+supports+S256+only+%28RFC+7636+Section+4.4.1%29&iss=https%3A%2F%2Fprotocolsoup.com%2Foauth2&state=uWtCDs15c_A5WFzpWMv2og 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=URy%2BJbBV97dASuGOS60qKAAdvdhwXT9AWqMU%2FtBxY%2BMnqywrNDjqih7ixRtMKwJVuhSc5MFfsoCvU67xOtEJZ49cfQIRzfhMWEsRlk2LGalN7QLfXNHNq1qvCYhECaGxNfQ%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=4,cfOrigin;dur=197 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 <a href="https://protocolsoup.com/callback?error=invalid_request&error_description=the+requested+code_challenge_method+is+not+supported%3B+this+server+supports+S256+only+%28RFC+7636+Section+4.4.1%29&iss=https%3A%2F%2Fprotocolsoup.com%2Foauth2&state=uWtCDs15c_A5WFzpWMv2og">Found</a>.2.GET https://protocolsoup.com/oauth2/authorize?client_id=public-app&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=phc50gs02UBj_T8CBTuYEA302 Found
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=public-app&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=phc50gs02UBj_T8CBTuYEA HTTP/2.0 Accept: text/html Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 302 Found Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bb0651dc33cdb-MSP Content-Type: text/html; charset=utf-8 Date: Sun, 06 Dec 2026 13:38:06 GMT Fly-Request-Id: 01M95S6YSX87H3YJ6Y6MWZ1GQ1-ord Location: https://protocolsoup.com/callback?error=invalid_request&error_description=code_challenge_method+is+absent%2C+which+requests+the+plain+transformation+%28RFC+7636+Section+4.3%29%3B+this+server+supports+S256+only&iss=https%3A%2F%2Fprotocolsoup.com%2Foauth2&state=phc50gs02UBj_T8CBTuYEA 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=xx79eBTBWtEZCbPNRQFHkq9fxH19ihELefY%2B2oYoMugaComgXKIcttW81HVMmDIb8%2F%2F%2B2YoAlzmK3yGRkQoy0QaxadvoV7KUwZPVY27aENRBeDJVDgx1gPZxSiJNMH%2FDFJ4%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=198 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 <a href="https://protocolsoup.com/callback?error=invalid_request&error_description=code_challenge_method+is+absent%2C+which+requests+the+plain+transformation+%28RFC+7636+Section+4.3%29%3B+this+server+supports+S256+only&iss=https%3A%2F%2Fprotocolsoup.com%2Foauth2&state=phc50gs02UBj_T8CBTuYEA">Found</a>.
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
- TestAuthorizationCodeRequestRefusesEveryPKCETransformationButS256
./internal/protocols/oauth2
Pass
Implementation
Explainer
What this requires
The authorization endpoint returns the authorization error response with error set to invalid_request. It does so at the authorization request, before the user signs in, and it sends the error where RFC 6749 Section 4.1.2.1 puts every authorization code error: in the query component of the client's redirection URI, with state if the request carried one.
The request names a transformation in code_challenge_method. RFC 7636 Section 4.3 defines the parameter as "OPTIONAL, defaults to "plain" if not present in the request." A request with a code_challenge and no method is therefore a request for plain, and a server that supports only S256 has to refuse it the same way it refuses an explicit plain or a method it has never heard of.
Why it exists
The alternative is to accept the request and decide later. A server that issues a code for a transformation it cannot perform will fail at the token endpoint, after the user has authenticated, with an error that points at the wrong step. Refusing at the authorization endpoint tells the client which request was wrong while it can still build another.
What non-compliance looks like
A server that quietly treats a missing method as S256 hashes a verifier the client intended to send unhashed, and the flow fails at the token endpoint with invalid_grant. A server that treats an unknown method as plain has been downgraded by the request.
At /oauth2/authorize, a request with code_challenge_method=plain gets a 302 whose Location is the redirect URI with error=invalid_request, an error_description, iss and the request's state. With the method absent the description reads code_challenge_method is absent, which requests the plain transformation (RFC 7636 Section 4.3); this server supports S256 only.
How ProtocolSoup tests it
TestAuthorizationCodeRequestRefusesEveryPKCETransformationButS256 sends the same authorization request with plain, with no method and with S512. Each must be a 302 to the registered redirect URI with error=invalid_request and the original state. The same request with S256 must reach the sign-in page.
The captured passing exchange, s256-transformation, is an S256 request answered with the sign-in page. The failing one, unsupported-transformation, records the redirects for plain and for the absent method.