When must a token response include the scope parameter?

scope in the response when the issued scope differs from the requestRFC 6749 §3.3MUSTRoles: authorization_server

Requirement as recorded in the ProtocolSoup registry

If the issued access token scope is different from the one requested by the client, the authorization server MUST include the "scope" response parameter to inform the client of the actual scope granted.

Read §3.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 requests a client_credentials token as machine-client with scope=api:read not-registered. The second value is not registered for the client, so the issued scope differs from the requested one, and the token response carries scope=api:read.

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: 61
    Content-Type: application/x-www-form-urlencoded
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    grant_type=client_credentials&scope=api%3Aread+not-registered

    Response

    HTTP/2.0 200 OK
    Cache-Control: no-store
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65ba5306e653cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:30:27 GMT
    Fly-Request-Id: 01M95RRYJ77R175GWEZPYV2J4H-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=xSHnvRe%2FQAGrOa4Mk7ECHqsxo6uCf8%2Fzuxw%2Bztqyo6%2BM3MiXcacMksAnfKGVfoYcOM00hRxgPpIOqiB4uTEhQ7FBC3ULjHUECEGnE%2B6NEMF4jf4lbuB2ZFnXEfZnTtlMV9Q%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=4,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.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiY2xpZW50X2lkIjoibWFjaGluZS1jbGllbnQiLCJjbGllbnRfbmFtZSI6Ik1hY2hpbmUtdG8tTWFjaGluZSBDbGllbnQiLCJleHAiOjE3OTY1Njc0MjcsImlhdCI6MTc5NjU2MzgyNywiaXNzIjoiaHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL29hdXRoMiIsImp0aSI6Imp0aS1kNjBjY2NiNGVhMjIyMDdjIiwibmJmIjoxNzk2NTYzODI3LCJzY29wZSI6ImFwaTpyZWFkIiwic3ViIjoibWFjaGluZS1jbGllbnQifQ.ZQSuK-4wS4SYbbtilhwVrfjcB3ZYw5EupOBGGsL4PM8u9Y3hGxy1-NGSWgE-OlJYM4SCcAsNEYruYIf9H8poivwyDVNXkRyOJ_r9y-lnSLWDDjx867xH22R8z2u5t7MGRlhF_HrX7GQkYT810OR40TrfoHj4CJZZi9TjzUe-zvh2q5LwFapKOfzfLoBM3P8algaD236hRpOgR7ejQueWUsJBHDWddPxOPQQM9OYoyecuRaO_AO1Dpk8RkDr9-7SiymgbPe-Ruffd6vlmaMSrzB85I2N5VvYHBTGbTAOZCj0IszkxJlrkiBwZMJHPvifE8Gc0c5xfU-zI-qHXumclRA","token_type":"Bearer","expires_in":3600,"scope":"api:read"}
    

Failing exchange

Not captured: The requirement says what the authorization server accepts or sends. No request a client sends is refused under it.

Tests

Implementation

Explainer

What this requires

A token response must include scope whenever the access token's scope differs from the scope the client requested. The server is allowed to grant less. RFC 6749 Section 3.3: "The authorization server MAY fully or partially ignore the scope requested by the client, based on the authorization server policy or the resource owner's instructions." What it may not do is keep the difference to itself. The scope parameter of the token response then carries the scope actually granted.

When the two are identical the parameter is optional. Section 5.1 defines it as "OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED." A server can meet both rules by always including it.

Why it exists

The client plans its API calls from the scope it believes it has. If it asked for read and write and was given read, it needs to learn that from the token response and not from a failed write an hour later. Access tokens are opaque to the client by design, so the response parameter is the only place it can look.

What non-compliance looks like

A server narrows the scope, because the client is not registered for one value or the user unticked a box, and returns a token response with no scope member or with the requested scope echoed back. The client proceeds as if everything was granted and the mismatch surfaces as authorization errors at the resource server.

How ProtocolSoup tests it

This server limits the requested scope to the values registered for the client and includes scope in every token response that has one. TestTokenResponseNamesTheScopeWhenItDiffersFromTheRequest checks three grants. A client_credentials request for api:read not-registered returns scope api:read, and the access token's own scope claim says the same. An authorization code request for profile not-registered yields a token response with scope profile. An implicit request for the same scope returns scope=profile in the fragment.

The captured passing exchange, scope-narrowed, is machine-client asking for api:read not-registered and receiving "scope":"api:read". No failing exchange is captured, because the requirement governs the server's own response and no request is refused under it.

Related requirements

All RFC 6749 requirements · OAuth 2.0 protocol page