Can a public client use the client credentials grant?

Client credentials grant used only by confidential clientsRFC 6749 §4.4MUSTRoles: authorization_server

Requirement as recorded in the ProtocolSoup registry

The client credentials grant type MUST only be used by confidential clients.

Read §4.4 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 requests a client_credentials token as machine-client, a confidential client, authenticating over HTTP Basic.

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/token200 OK

    TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2

    Request

    POST /oauth2/token HTTP/2.0
    Authorization: Basic bWFjaGluZS1jbGllbnQ6TTdCa0JKX2lLOEdwNFJlRjFTdkdDcWx1eE1uMnlTcnU=
    Content-Length: 29
    Content-Type: application/x-www-form-urlencoded
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    grant_type=client_credentials

    Response

    HTTP/2.0 200 OK
    Cache-Control: no-store
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65bab061e9a3cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:34:26 GMT
    Fly-Request-Id: 01M95S07Z1AZQC0FDMBFG85WQH-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=aVhLCMdP1liJ%2BXstcZtJc8PAGFGRXqQvRTR0h%2BMHgnE7vNKbEv2nf7zfPeaI%2BELK0HsT15Sdt4t3BI2VIiGdQDX%2FRUyuitvXbuAQ%2BjfeMVpKOqKfy1CIpy3rSZB4XAyWQE4%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=6,cfOrigin;dur=204
    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.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiY2xpZW50X2lkIjoibWFjaGluZS1jbGllbnQiLCJjbGllbnRfbmFtZSI6Ik1hY2hpbmUtdG8tTWFjaGluZSBDbGllbnQiLCJleHAiOjE3OTY1Njc2NjYsImlhdCI6MTc5NjU2NDA2NiwiaXNzIjoiaHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL29hdXRoMiIsImp0aSI6Imp0aS1lODU0NGYyMzU3OGJiZmM5IiwibmJmIjoxNzk2NTY0MDY2LCJzY29wZSI6ImFwaTpyZWFkIGFwaTp3cml0ZSIsInN1YiI6Im1hY2hpbmUtY2xpZW50In0.iZ8FILC2efCBQnJc1E_SfTnM8mZZIDZr-de3X9W9jPoBqKvWQACoITpQUB_Rc8IjrsmsDpjuHBsJ-KjvdTcAGZhsNVNqE3V4LMq6BkTR9GXURClZpq7iZaVxIiomKXO_DuQoY-JtqOgvMrbZ7KGo7etewbMZ-I_19XjgcSLZTNbTDe3gNPeqXLq8R3sQO0mgvmMh37lSFh0J_Gfoxv6teevLzPRtOb4ciVxB7Vo5SaZhM9ceNGIuCdB38JUT8w_htdVL4eJKYwA-1MbXC5CurJ62xyqkQq59UQsQ56otyTd9gLsWmUs6Ks5zsx2kTPliTwP44yXDH_d4NRIUicj3fA","token_type":"Bearer","expires_in":3600,"scope":"api:read api:write"}
    

Failing exchange

Rejected, as requiredConformance client

The conformance client requests a client_credentials token as public-app, a public client, naming itself in client_id. A public client cannot be authenticated, and the token endpoint issues nothing.

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: 50
    Content-Type: application/x-www-form-urlencoded
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    client_id=public-app&grant_type=client_credentials

    Response

    HTTP/2.0 400 Bad Request
    Cache-Control: no-store
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65bab129b023cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:34:28 GMT
    Fly-Request-Id: 01M95S09XCHJC6PCVE8HGFEKXE-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=blRku9B1h6q2UQ8ntK9tImwPsg3qma%2FOfSWOzA%2BZsezLX%2FLHSUVlEWfU6EcGCruuPeuVv5NPspEcYyauOAn8Lcx38gnqfyN4WtQF7eDu15qQ1Di%2BrUBwCPuYiWebutzWUNg%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=3,cfOrigin;dur=198
    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":"The client credentials grant is for confidential clients; a public client cannot authenticate","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 Glass

Tests

Implementation

Explainer

What this requires

No: a public client cannot use the client credentials grant, which is for confidential clients only. In this grant the client's own credentials are the authorization grant: there is no resource owner, no code and no redirect, and the token is issued to whoever proves it is the client. A public client cannot prove that. RFC 6749 Section 2.1 defines it as "incapable of maintaining the confidentiality of their credentials" and "incapable of secure client authentication via any other means."

For a server this is a rule about registration as much as about requests. A public client should not be registered for the grant, and if one is, the token endpoint still refuses it.

Why it exists

Take away the authentication and nothing is left of the grant. A public client's identifier is known to anyone who has looked at the application, so a token issued on the identifier alone is a token for anybody. The grant typically carries the client's own privileges, with no user consent step to limit them, which makes the mistake worse than in the user-delegated grants.

What non-compliance looks like

It usually comes from registration, not from the token endpoint. A dynamic registration endpoint accepts grant_types containing client_credentials together with token_endpoint_auth_method none, and the token endpoint then finds the grant in the client's allowed list and issues a token for a bare client_id.

At /oauth2/token, a client_credentials request naming a public client is answered 400 with error invalid_client and error_description The client credentials grant is for confidential clients; a public client cannot authenticate. Over HTTP Basic with an empty password the status is 401.

How ProtocolSoup tests it

TestClientCredentialsGrantIsRefusedForPublicClients registers a public client whose grant types include client_credentials, the misconfiguration above, and requests a token with client_id in the body and then over HTTP Basic. Both are invalid_client. The seeded public-app is refused as well.

The captured passing exchange, confidential-client, is machine-client authenticating over HTTP Basic and receiving a token. The failing one, public-client, is public-app naming itself in client_id.

Related requirements

All RFC 6749 requirements · OAuth 2.0 protocol page

Can a public client use the client credentials grant? · RFC 6749 §4.4 | ProtocolSoup