Must a confidential client authenticate when it redeems an authorization code?
Client authentication required to redeem an authorization codeRFC 6749 §4.1.3MUSTRoles: authorization_server
Requirement as recorded in the ProtocolSoup registry
require client authentication for confidential clients or for any client that was issued client credentials (or with other authentication requirements),
Read §4.1.3 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 demo-app's authorization request and redeems the code at the token endpoint, authenticating as demo-app over HTTP Basic with its client password. The sign-in between the two requests is not recorded.
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=demo-app&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=eNL8jsCXvQfbquXYhMdLTg200 OK
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/authorize?client_id=demo-app&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=eNL8jsCXvQfbquXYhMdLTg 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: a65ba98299043cdb-MSP Content-Type: text/html Date: Sun, 06 Dec 2026 13:33:24 GMT Fly-Request-Id: 01M95RYBDDGCJB76D5ZGWBRYFA-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=Ukgg64dbTsstIGkxLiHKhMsBrYG1l%2BcdX%2B9qMFgGSLnt6zcrLV17RExZ0yFtw4z9NAZKm2obg3GIO7YIqH6bN4zigv7YNl8nLp2yMY8hZYI6i2V3f8yG5Jhgp%2FPhdyBgki8%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,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 <!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>Demo Application</strong></span> </div> <!-- ERROR --> <form method="POST" action="/oauth2/authorize"> <input type="hidden" name="login_request_id" value="KU30hvnbtVNsScgNHShrCQ"> <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="afcec3c6cccaefcad7cec2dfc3ca81ccc0c2">[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="c9aba6ab89acb1a8a4b9a5ace7aaa6a4">[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="2746434a4e4967425f464a574b420944484a">[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 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> <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:'a65ba98299043cdb',t:'MTc5NjU2NDAwNA=='};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=a65ba98299043cdb',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></body> </html>2.POST https://protocolsoup.com/oauth2/token200 OK
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
POST /oauth2/token HTTP/2.0 Authorization: Basic ZGVtby1hcHA6OXh2TTdNYXZPSXYyc0xoODFBUnBLNHRabUJKV2ZVSnA= Content-Length: 122 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 code=5HeTwrdc1qWIsBBF8FP9nkrbzPSZWj2C&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback
Response
HTTP/2.0 200 OK Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65ba9955f8a3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:33:27 GMT Fly-Request-Id: 01M95RYEB7NAXPJS9NPAZ24ZMP-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=q7RzLpzR3LczJk6kZwVQvT57qH5Tbn9ZXIeOtOvlGaIgwUF3QIJRBW%2FzAhDPGFZQ56V0f%2BDVmp6TrE5xN8qfChA4AMfxOhkHBNuN8zd7BTMnpxxlV1Vl6dD%2BK4tz0he08lI%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=4,cfOrigin;dur=201 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 {"access_token":"eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiYXQrand0In0.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiYmlydGhkYXRlIjoiMTk5MC0wMy0xMiIsImNsaWVudF9pZCI6ImRlbW8tYXBwIiwiZXhwIjoxNzk2NTY3NjA3LCJmYW1pbHlfbmFtZSI6IkpvaG5zb24iLCJnZW5kZXIiOiJmZW1hbGUiLCJnaXZlbl9uYW1lIjoiQWxpY2UiLCJpYXQiOjE3OTY1NjQwMDcsImlzcyI6Imh0dHBzOi8vcHJvdG9jb2xzb3VwLmNvbS9vYXV0aDIiLCJqdGkiOiJqdGktODJmZjM3ZmQ3YWYyZGFjNiIsImxvY2FsZSI6ImVuLUFVIiwibWlkZGxlX25hbWUiOiJNYXJpZSIsIm5hbWUiOiJBbGljZSBKb2huc29uIiwibmJmIjoxNzk2NTY0MDA3LCJuaWNrbmFtZSI6IkFsaSIsInBpY3R1cmUiOiJodHRwczovL3d3dy5wcm90b2NvbHNvdXAuY29tL3UvYWxpY2UvYXZhdGFyLnBuZyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFsaWNlIiwicHJvZmlsZSI6Imh0dHBzOi8vd3d3LnByb3RvY29sc291cC5jb20vdS9hbGljZSIsInNjb3BlIjoicHJvZmlsZSIsInN1YiI6ImFsaWNlIiwidXBkYXRlZF9hdCI6MTc5NjU2MjY5Mywid2Vic2l0ZSI6Imh0dHBzOi8vYWxpY2UuZXhhbXBsZS5jb20iLCJ6b25laW5mbyI6IkF1c3RyYWxpYS9TeWRuZXkifQ.CpzawpxTSfwIvQ8Zu308w08KF1wlxVye2CbPGMBNasiYcm0SefDCqKfs4Dp2tCArbXvOX6tyMz8845jfZJ7Nv2ylFi7SZkaZCJXHeq-nFGb1Jh1LIXIf1soaI4Cwoz5swyznJApkwo6P-W3TbDFBtYLsASMULEZuY5ZMxQqTwMhO4MF9kRZ9we42oUXHeaDW1FtBcRmd32RXXyeEnfX4_NtjFgpGiz-6BKb0Mu6hFfcVrd2q5hnnZr4bb69dQLcYTkQBDykeOXS1j4IQAvAW-jpshreVpyQFvW0d42FxUITKamfv41uLaPQ7TMYyeeOvX36b-R39GpK2vhkaUknq9A","token_type":"Bearer","expires_in":3600,"refresh_token":"eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiSldUIn0.eyJjbGllbnRfaWQiOiJkZW1vLWFwcCIsImV4cCI6MTc5NzE2ODgwNywiaWF0IjoxNzk2NTY0MDA3LCJpc3MiOiJodHRwczovL3Byb3RvY29sc291cC5jb20iLCJqdGkiOiJyZWZyZXNoLTkxNTIyYzYxMzk4Mzc0ODEiLCJzY29wZSI6InByb2ZpbGUiLCJzdWIiOiJhbGljZSIsInR5cGUiOiJyZWZyZXNoIn0.ZXpRWwbr1naZjQFmYmGog12EGcSUxG_mwR-CDs0D1vJQL98od6QLT7baiI0VqoiTJI_j1Gae0KXfGV3UCE9HHxXWdLLE-BnAM8qW7b_X9fdXnM6T1eshS960eSqCkczrPl2K5N1oPppP1hRaLqdIODoJZ_F2-CPuazDPYDPjTg4q-yfCyYZO3662-LoTI19FRCzmdHCfuKX3Gr5QDEgJKRDf-aFpflEqD4W4hejMw-rYTE2SOs5w-S2zwCuMvE_mSoi4zG6vyPh4rUvswldRu3WPljbMsET4gtqZFqVSz8qawn6_7ef_fK6Xx5lGgxkPeI1TSv7h0K-Iz4lnQ7yR4Q","scope":"profile"}
Failing exchange
Rejected, as requiredConformance client
The conformance client obtains an authorization code as demo-app, a confidential client, and sends the token request three times: with client_id and no client authentication, with a wrong client_secret in the body, and with a wrong password over HTTP Basic. The first two are answered 400 and the third 401 with a Basic challenge.
Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.
1.POST https://protocolsoup.com/oauth2/token400 Bad Request
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
POST /oauth2/token HTTP/2.0 Content-Length: 141 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=demo-app&code=uW9Z1BO9oP4LoAfQnbe2zzc8Q7FQdKqn&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65ba9badac13cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:33:33 GMT Fly-Request-Id: 01M95RYM6N6V4QFCCSN74G1DZ6-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=KV8gmuhhMaWGq2q8akcqvZ9aRy9BJ8OvO6lb%2BrR1%2B96Y6KvMkt1KxQ8%2BJXy5E7pDRN4LXo2t%2F6%2Fz0sgX8sAK9mRA%2FkzBYF07NP8%2Bwp67HRaED%2BqLjG0p11y9d96CvflmROU%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=197 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":"Client authentication failed","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}2.POST https://protocolsoup.com/oauth2/token400 Bad Request
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
POST /oauth2/token HTTP/2.0 Content-Length: 177 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=demo-app&client_secret=not-the-client-secret&code=uW9Z1BO9oP4LoAfQnbe2zzc8Q7FQdKqn&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65ba9c1181f3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:33:34 GMT Fly-Request-Id: 01M95RYN5Z05JTZMPHP1E7DQGW-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=s3Ny3Mr1I8heXx7PwEO%2FQQ8z3MvKxu9%2BoKJASPRXtuFiN2tsdCOegESvx10TiPaY45JO2I%2BUIKNwo%2Fu8ctkqgvK55cP1X%2F5RmXS7Iygl1gaAvThc18JCEN82s8QDtzRr%2Bso%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=5,cfOrigin;dur=197 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":"Client authentication failed","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}3.POST https://protocolsoup.com/oauth2/token401 Unauthorized
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
POST /oauth2/token HTTP/2.0 Authorization: Basic ZGVtby1hcHA6bm90LXRoZS1jbGllbnQtc2VjcmV0 Content-Length: 122 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 code=uW9Z1BO9oP4LoAfQnbe2zzc8Q7FQdKqn&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback
Response
HTTP/2.0 401 Unauthorized Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65ba9c75e2c3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:33:35 GMT Fly-Request-Id: 01M95RYP55N6NHX1P8KP1JSSFE-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=XDasVFgiZUdguZW3IEWzNoNzg%2FHw0usLbblHHQaTt%2Bo8B9CLELgervHI9keROxd6ZFkQvQVH6GVh0HTFWwUY8poWCu%2BWZUXxFaiFRiA8hvHH4NFJqGc9LHDm7MfqQQn2UvU%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=197 Vary: Origin Vary: accept-encoding Via: 1.1 fly.io, 1.1 fly.io Www-Authenticate: Basic realm="oauth2" X-Content-Type-Options: nosniff X-Frame-Options: DENY X-Xss-Protection: 1; mode=block {"error":"invalid_client","error_description":"Client authentication failed","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}
Tests
- TestAuthorizationCodeGrantRequiresConfidentialClientAuthentication
./internal/protocols/oauth2
Pass
Implementation
Explainer
What this requires
Yes: a confidential client, or any client that was issued credentials, has to authenticate when it exchanges an authorization code, and the server has to insist on it. This is the first item in the list that RFC 6749 Section 4.1.3 opens with "The authorization server MUST:". Section 3.2.1 states the client's half: "Confidential clients or other clients issued client credentials MUST authenticate with the authorization server as described in Section 2.3 when making requests to the token endpoint."
The decision comes from the registration, not from the request. Whether credentials are required depends on what kind of client the code was issued to, so a request cannot opt out by leaving them off.
Why it exists
The authorization code travels through the browser, where it can leak through history, referrer headers or a compromised redirect. For a confidential client the secret is what makes a stolen code useless: only the party holding the client's credentials can turn the code into tokens. If the server accepts the code without them, the secret protects nothing.
What non-compliance looks like
A server that authenticates only when credentials happen to be present lets anyone redeem a confidential client's code by sending the client_id alone.
At /oauth2/token, a code exchange naming the confidential demo-app with no credentials is answered 400 with error invalid_client and error_description Client authentication failed. A wrong client_secret in the body gets the same. A wrong password over HTTP Basic gets 401 with WWW-Authenticate: Basic realm="oauth2". None of the three uses up the code.
How ProtocolSoup tests it
TestAuthorizationCodeGrantRequiresConfidentialClientAuthentication obtains a code for a confidential client through /oauth2/authorize and presents it three times without valid authentication, expecting the three responses above. It then presents the same code with the correct HTTP Basic credentials and expects tokens, which also shows the refusals did not consume it.
The captured passing exchange is confidential-client-authenticates: demo-app redeems its code over HTTP Basic. The failing one, confidential-client-does-not-authenticate, records all three refusals for a live code.
Related requirements
Also in §4.1.3
- OA-026Is client authentication checked when a client that need not authenticate includes it?
- OA-027Can a client redeem an authorization code that was issued to another client?
- OA-028What does the token endpoint check about the authorization code itself?
- OA-029Must the redirect_uri in a token request match the one in the authorization request?