Is client authentication checked when a client that need not authenticate includes it?

Included client authentication is checked on a code exchangeRFC 6749 §4.1.3MUSTRoles: authorization_server

Requirement as recorded in the ProtocolSoup registry

authenticate the client if client authentication is included,

Read §4.1.3 in RFC 6749

Self-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 with HTTP Basic client authentication and client_id in the body as well, which Section 3.2.1 allows. The token endpoint authenticates the client from the Authorization header. 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. 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=OHiEqbYwtmO0VJJRI-Dabg200 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=OHiEqbYwtmO0VJJRI-Dabg 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: a65ba9d3da2f3cdb-MSP
    Content-Type: text/html
    Date: Sun, 06 Dec 2026 13:33:37 GMT
    Fly-Request-Id: 01M95RYR3TFTWG7DX99CMKFWDT-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=QnL59GfUCwq8YbxqQcJz7qMoB%2Bqu1C4AficMqRjEkff8FTOTQgn67GWcCG6b27DqLLHKfwt4EP%2BzwR4kzJn3Whoo9YmQj9IpgC63%2BO6JjdFhFipLrePJ267eX6gv1OKSdtU%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=6,cfOrigin;dur=208
    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="nmQA-K7TLkShL_WITxp5wg">
                
                <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="0f6e63666c6a4f6a776e627f636a216c6062">[email&#160;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="6f0d000d2f0a170e021f030a410c0002">[email&#160;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="abcacfc6c2c5ebced3cac6dbc7ce85c8c4c6">[email&#160;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:'a65ba9d3da2f3cdb',t:'MTc5NjU2NDAxNw=='};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=a65ba9d3da2f3cdb',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. 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: 141
    Content-Type: application/x-www-form-urlencoded
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    client_id=demo-app&code=MN5VLFkjl0bzXutOMRage6DWFKv0tbqY&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: a65ba9e69a453cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:33:40 GMT
    Fly-Request-Id: 01M95RYV1H2MVVXCZ42EGWKC8D-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=9Nfjue80wWvloU2sUAvztDOTE8%2Bjwu5PxbUT7c8X7H6fo1zjM0%2FYy1QmEVTnxbJfMZabCL880r75mf0wgqco5XkdHyNWcb8tbRB2yUfvNjbxyo8xZIl3PwGokrgTorby7os%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=6,cfOrigin;dur=203
    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.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiYmlydGhkYXRlIjoiMTk5MC0wMy0xMiIsImNsaWVudF9pZCI6ImRlbW8tYXBwIiwiZXhwIjoxNzk2NTY3NjIwLCJmYW1pbHlfbmFtZSI6IkpvaG5zb24iLCJnZW5kZXIiOiJmZW1hbGUiLCJnaXZlbl9uYW1lIjoiQWxpY2UiLCJpYXQiOjE3OTY1NjQwMjAsImlzcyI6Imh0dHBzOi8vcHJvdG9jb2xzb3VwLmNvbS9vYXV0aDIiLCJqdGki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OiJyZWZyZXNoLWI2MzgwYmQzMzNjM2NlOGUiLCJzY29wZSI6InByb2ZpbGUiLCJzdWIiOiJhbGljZSIsInR5cGUiOiJyZWZyZXNoIn0.gd1U2N7vbOa0sQKnSKW91-jrTuvDjQTOUFWnLrIqOzN9FcNNx7zJTQ-Uyb4WtN96TLyMiw1j4LFfmzJ1BQYW3a7whcYY4YiyBOO1LY8IhOelga_bg4PnLvyNkRNgNpUeUJGrpIca1OVttGJYEcSDY75jspKByIxaZmK2XNTSMHEEEfsoT5wOZrE2FGTbtovIapPcD9YMkjlnKzIQgCY2qsZAsP9L7tQyaPzVrNPiojkLagz7qT9p6ZKqU4rkI_9Tdma5RoUiuY6tGiYCekgJuWTatNeCRJQIf5Rzt3a_LBqmmAAEePz8apV_2F1lUs2czDRTGwht1EcqdRVSD3YpTA","scope":"profile"}
    

Failing exchange

Rejected, as requiredConformance client

The conformance client obtains an authorization code as public-app, which was issued no client password, and sends the token request with a client_secret all the same. The token endpoint checks the client authentication it was given instead of ignoring it.

Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.

  1. 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: 180
    Content-Type: application/x-www-form-urlencoded
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    client_id=public-app&client_secret=a-secret-nobody-issued&code=qJHm1Hr8wMHQ8tttq8oACPqh7n2HcqSo&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: a65baa05dae83cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:33:45 GMT
    Fly-Request-Id: 01M95RYZXKDMH9YJA66BVVGH7B-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=swkRXuRXJw7nU%2BW80fFp%2BjTojeDkHfavDGTB9%2Fu0134eZWN6Y0A7PSpviOtmCoJx75zUwOxil4Sc5HPi8Bm42LaBbRcrMNTPzZy7QOQNjqkPuAFDRIGqWDXVEuc3O6zseoQ%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"}
    

Tests

Implementation

Explainer

What this requires

Yes: if a token request includes client authentication, the server authenticates the client, whether or not that client was required to authenticate. Included credentials are never decoration. They are either verified or the request fails.

The case this decides is the public client. It was issued no client password, so a password it presents cannot be verified against anything, and the only answer consistent with the rule is invalid_client.

One thing is not client authentication: client_id on its own. RFC 6749 Section 3.2.1 says "A client MAY use the "client_id" request parameter to identify itself when sending requests to the token endpoint." A confidential client may therefore send client_id in the body next to its HTTP Basic credentials, and the server authenticates it from the header.

Why it exists

A server that ignores credentials it does not need hides bugs and attacks alike. A client configured with the wrong secret keeps working and nobody learns the secret is wrong. A request that mixes one client's identifier with another's credentials succeeds as whichever the server happens to read first.

What non-compliance looks like

The common form is a branch that reads: if the client is public, skip authentication. A request from public-app with any client_secret then succeeds, and so does one whose HTTP Basic header names a different client entirely.

At /oauth2/token, a public client that sends client_secret gets 400 invalid_client (Client authentication failed), and 401 with a Basic challenge if it sent a password over HTTP Basic. HTTP Basic for one client with a client_id naming another is 400 invalid_request with client_id names a different client from the one in the Authorization header.

How ProtocolSoup tests it

TestAuthorizationCodeGrantAuthenticatesIncludedClientAuthentication presents a public client's code with a made-up client_secret, then with a made-up Basic password, and expects invalid_client both times; with no authentication the same code is redeemed. For a confidential client it checks that Basic plus a matching client_id succeeds, Basic plus another client's client_id is invalid_request, and Basic plus client_secret in the body is invalid_request.

The captured passing exchange is basic-authentication-with-client-id. The failing one, public-client-includes-a-client-secret, is public-app sending a secret nobody issued.

Related requirements

All RFC 6749 requirements · OAuth 2.0 protocol page