What form must the error_uri of a token error response have?
Token error_uri conforms to the URI-reference syntaxRFC 6749 §5.2MUSTRoles: authorization_server
Requirement as recorded in the ProtocolSoup registry
Values for the "error_uri" parameter MUST conform to the URI-reference syntax and thus MUST NOT include characters outside the set %x21 / %x23-5B / %x5D-7E.
Read §5.2 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
Not captured: The requirement constrains an error response, so every exchange that shows it is a refusal. The failing exchange is that response.
Failing exchange
Rejected, as requiredConformance client
The conformance client sends four token requests, each with a value that carries a double quote, a backslash or a non-ASCII character where the token endpoint might echo it: an unknown grant_type, an unknown client_id, a made-up authorization code and, as machine-client, an unregistered scope. In each error response, error and error_description stay within %x20-21 / %x23-5B / %x5D-7E and error_uri within %x21 / %x23-5B / %x5D-7E.
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: 47 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=public-app&grant_type=%22%C3%A9%22%5C
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bac32192a3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:35:14 GMT Fly-Request-Id: 01M95S1PVYFA225TB51ZHWWWAS-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=RPOPyZeGL%2FOo2HKXPPO8qyAD%2BRcQLuwrzy4W8WEp%2FCEAePXjN2QLgrWMY4x4sqyRhKj26xSobjLu7CY3Rh%2FePOgVJLgXRVq0mIUGz8bwFWPjIKAOVND%2BP59ad4iWN1FFgJU%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=236 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":"unsupported_grant_type","error_description":"Grant type not supported","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: 62 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=%22%C3%A9%22%5C&code=x&grant_type=authorization_code
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bac385e063cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:35:15 GMT Fly-Request-Id: 01M95S1QT69W6WPW9EAF7T2QG5-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=tW5Qb8rIo5tLNyTK%2FuM1ow8GNMGrPv69JVEHTaotIXD8hp5GBQIeXhfLWDrLCTWMT%2BineQy6URUrfuukDvnZTA%2FjOHdBE8aX%2BeAe23of4OpSPd7UHpMBi8HkkTNdxZ4nhmk%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,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 {"error":"invalid_client","error_description":"Unknown client","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}3.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: 126 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=public-app&code=%22%C3%A9%22%5C&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: a65bac3e999c3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:35:16 GMT Fly-Request-Id: 01M95S1RSDRMGXTSTMMGA9XDHS-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=yZGxawcPWdWyCK2%2B0%2BUagOmSFyMW6EsSH%2B15b3GFJDILepwVeakxS4NygV2LZXL9MMlqaewIQTJyPs91RCNOXbdLywYXURvrS20e%2F0ZMiCIMYZGVKYmhpeiW6lhYK%2FP3yJw%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,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 {"error":"invalid_grant","error_description":"invalid authorization code","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}4.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 Authorization: Basic bWFjaGluZS1jbGllbnQ6TTdCa0JKX2lLOEdwNFJlRjFTdkdDcWx1eE1uMnlTcnU= Content-Length: 51 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 grant_type=client_credentials&scope=%22%C3%A9%22%5C
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bac44de633cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:35:17 GMT Fly-Request-Id: 01M95S1SRN597T2M3B66971XA3-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=EcZ%2BCVQQ9AlnStzo3dBKBDs0Xg2vNPHHQ%2B6vpOVLEk9InIwF8HqpESVTmI2dEBK%2BHOlB1DSqHyCDDwiWoZHiBkeOjn2lpY3zacFpguXji%2FT7pZ1xb8Oc8P1GMuhrv576xTc%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=202 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_scope","error_description":"None of the requested scopes are permitted for this client","error_uri":"https://datatracker.ietf.org/doc/html/rfc6749#section-5.2"}
Tests
- TestTokenErrorParametersUseTheAllowedCharacters
./internal/protocols/oauth2
Pass
Implementation
Explainer
What this requires
The error_uri of a token error response must be a URI-reference, and because of that it must stay within %x21 / %x23-5B / %x5D-7E. That is the set allowed for the error code and description with the space removed as well, since a URI cannot contain one.
error_uri is optional. Section 5.2 defines it as "A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error." A server that sends one is pointing a developer at documentation.
Why it exists
Clients and developer tools display the value as a link or log it. A value that is not a valid URI-reference cannot be followed. One containing a space or a quote breaks whichever syntax carries it: this same parameter is used in redirect URIs at the authorization endpoint, and other specifications reuse it in WWW-Authenticate headers.
What non-compliance looks like
Free text in the field, such as a sentence telling the developer to see the documentation, or a URL with unencoded spaces from a page title. A subtler defect is a link that is syntactically fine and leads to a page that says nothing about the error returned.
How ProtocolSoup tests it
Each error code this server returns has one fixed error_uri, a link to the section of the specification that defines the code. A token endpoint invalid_grant carries https://datatracker.ietf.org/doc/html/rfc6749#section-5.2; invalid_target links to RFC 8707 Section 2; the DPoP codes link to RFC 9449. The values are constants, so no request can change them.
TestTokenErrorParametersUseTheAllowedCharacters checks the error_uri of about twenty refused requests: every character must be in the set, the value must contain no space, and it must parse as a URI.
Only a failing exchange is captured, because the requirement constrains an error response. error-parameters-of-refused-requests records four refusals and checks the error_uri of each.