What does the token endpoint check about a refresh token?
Refresh token validated before tokens are issuedRFC 6749 §6MUSTRoles: authorization_server
Requirement as recorded in the ProtocolSoup registry
validate the refresh token.
Read §6 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 obtains tokens as public-app and refreshes with the refresh token it was issued.
Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.
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 Content-Length: 713 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=public-app&grant_type=refresh_token&refresh_token=eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiSldUIn0.eyJjbGllbnRfaWQiOiJwdWJsaWMtYXBwIiwiZXhwIjoxNzk3MTY4OTY1LCJpYXQiOjE3OTY1NjQxNjUsImlzcyI6Imh0dHBzOi8vcHJvdG9jb2xzb3VwLmNvbSIsImp0aSI6InJlZnJlc2gtMjhkMjI4YTBmYjNmMjdjMyIsInNjb3BlIjoicHJvZmlsZSIsInN1YiI6ImFsaWNlIiwidHlwZSI6InJlZnJlc2gifQ.hVVFQFtmZLk0bWBPpdMZBSIr9ogke6SNy74CqaQRNuROlHDoNj6U-2GpF0PK_t0RXl-kZw6QNmr-PXLoR1JNVBq3JgK0QMg8BSIiZzxxMtAo-dQlRcVcBPdoipzhWakV2TNOvL086XsubUsnfEwrCZOGPy13e0cXccTS1sN_rYyuQLfYEqmW9K2Vk03iZu8c_pzy4i7zXbyJ1EFvGtojiLxMiv4qk5WFBV4FRspjrTiRKRK4IUlJBHjXjwi0rld3cFxOgk0qTsK3OiG44u907hBoX0H_NXj6jVMDySjRoQ3_1xpYatePz7vC4PfgzGI-zpasv1iRh0gDFGSuLEPbyQ
Response
HTTP/2.0 200 OK Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bad771ef33cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:36:06 GMT Fly-Request-Id: 01M95S39MR680TJ8X54FXA3XDV-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=kbGNC0ebWov6KtiA2gDd7ztq1LnpibHz1E9odgXheeMJJlMiZXJBYLacnFzjc6LExlD6gFutL%2FD7efH5A73JP%2FmLaqcPnEJiTk3cb0NrkPNZImLCWycF479cY1EUBLCnPE4%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=3,cfOrigin;dur=227 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.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiYmlydGhkYXRlIjoiMTk5MC0wMy0xMiIsImNsaWVudF9pZCI6InB1YmxpYy1hcHAiLCJleHAiOjE3OTY1Njc3NjYsImZhbWlseV9uYW1lIjoiSm9obnNvbiIsImdlbmRlciI6ImZlbWFsZSIsImdpdmVuX25hbWUiOiJBbGljZSIsImlhdCI6MTc5NjU2NDE2NiwiaXNzIjoiaHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL29hdXRoMiIsImp0aSI6Imp0aS03ZTQ0Y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JlZnJlc2gtYmE4ZGZjMzY1MjRjMzc3MCIsInNjb3BlIjoicHJvZmlsZSIsInN1YiI6ImFsaWNlIiwidHlwZSI6InJlZnJlc2gifQ.HeDAtaDDD55tbrOjnUDJJQSd_EkoXVyTjg733vHoIO3axyLwLsKRv1zx0j8ZPcEvhiwe4iAsKgbOaZyOs3LAmO8vBs-UWS48y5ZhcyAcc_QILf1Lncczj6DhOdbLleGUd0YnnamJSpwW1yaO7f3EW_-R4_jaOCph3eNsj9P_RWQny9RSfoshbo5NHY3ndvLnGkmIk1DxTt01wH6w0LD8gt2uM7mehzKMDmpQ8pcrcqJ4ZK8MajMVcNMZ6CjOcZRXEW9hIAY53tcGouFwrJPmyAhn4MlzKDm3GuIQI3hNPuRtnUe6HNnM4mTgKcur4Bw1VAVwGUTANa9L2KpoQrnReQ","scope":"profile"}
Failing exchange
Rejected, as requiredConformance client
The conformance client obtains tokens as public-app and sends three refresh requests with values that are not a valid refresh token: a made-up string, the access token it was issued, and the issued refresh token with its last two characters replaced.
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: 79 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=public-app&grant_type=refresh_token&refresh_token=not-a-refresh-token
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bad9c98693cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:36:12 GMT Fly-Request-Id: 01M95S3FFEFWX7TYNMDQ52WMQA-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=Q9rQKPqo3RdUVTC2EK8Ct3tk54rMjjL4IkX5PqAOxQszWPugyNhM1tlRA2l3MFgIJYpZN%2Btci%2BwYG4eHHGlHOltazHmD499%2Fc4EwED9QDOHR9HDxDl22pu440yWoom1fh4k%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=4,cfOrigin;dur=196 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 refresh token","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: 1315 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=public-app&grant_type=refresh_token&refresh_token=eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiYXQrand0In0.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiYmlydGhkYXRlIjoiMTk5MC0wMy0xMiIsImNsaWVudF9pZCI6InB1YmxpYy1hcHAiLCJleHAiOjE3OTY1Njc3NzEsImZhbWlseV9uYW1lIjoiSm9obnNvbiIsImdlbmRlciI6ImZlbWFsZSIsImdpdmVuX25hbWUiOiJBbGljZSIsImlhdCI6MTc5NjU2NDE3MSwiaXNzIjoiaHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL29hdXRoMiIsImp0aSI6Imp0aS1mZjk4MzBjMGEwMmQ0ZmFlIiwibG9jYWxlIjoiZW4tQVUiLCJtaWRkbGVfbmFtZSI6Ik1hcmllIiwibmFtZSI6IkFsaWNlIEpvaG5zb24iLCJuYmYiOjE3OTY1NjQxNzEsIm5pY2tuYW1lIjoiQWxpIiwicGljdHVyZSI6Imh0dHBzOi8vd3d3LnByb3RvY29sc291cC5jb20vdS9hbGljZS9hdmF0YXIucG5nIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiYWxpY2UiLCJwcm9maWxlIjoiaHR0cHM6Ly93d3cucHJvdG9jb2xzb3VwLmNvbS91L2FsaWNlIiwic2NvcGUiOiJwcm9maWxlIiwic3ViIjoiYWxpY2UiLCJ1cGRhdGVkX2F0IjoxNzk2NTYyNjkzLCJ3ZWJzaXRlIjoiaHR0cHM6Ly9hbGljZS5leGFtcGxlLmNvbSIsInpvbmVpbmZvIjoiQXVzdHJhbGlhL1N5ZG5leSJ9.SWnWXu4AphIgqO75T3txf63CAuiT4gjjvNbjM8RgS4mS4S-PxbOaM7YRDgxubwX4RUxNBFdOKTxQsWTYatjqFqzBXg8sGpnFQQ763SPiE4MkVWSDKf-swJoMpBxGnex9FhQX0t6CF7apqNTGIEXlnZzxbAf_Q5bd11QoOBfr8HdSS0gZdcg_XW8o20xW_hPz62pnF1BetqaaWT69t48YAKNiIv8xZMQ1ptypjseinN0u4Sf6C5SzoLirpyiwqin1rnOLATz62cMVy23_ke8BR-q8KrkQTdXLasQ7vC34QA-AaNCQ1r3_n5-DEfa_XnYkIva6KyFvVeeehnBg40xegQ
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bada2eead3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:36:13 GMT Fly-Request-Id: 01M95S3GERJ936VPJKVE4S7M2N-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=ERHeqKKb0ATURfFli05TsKaWXMpu84RbU8Fmks3pPBheqI8OU79Yl0wwXqQPKh5MoyU%2FEeH0zmfd%2FCBuxKlQuAgBXzf50HSKKNSlLHF5WWPV%2B3wd6HSzWBOz1TjSuLlNOn0%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=4,cfOrigin;dur=205 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 refresh token","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: 713 Content-Type: application/x-www-form-urlencoded Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1 client_id=public-app&grant_type=refresh_token&refresh_token=eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiSldUIn0.eyJjbGllbnRfaWQiOiJwdWJsaWMtYXBwIiwiZXhwIjoxNzk3MTY4OTcxLCJpYXQiOjE3OTY1NjQxNzEsImlzcyI6Imh0dHBzOi8vcHJvdG9jb2xzb3VwLmNvbSIsImp0aSI6InJlZnJlc2gtMTllZWMzM2RkMWE4ZDBkNCIsInNjb3BlIjoicHJvZmlsZSIsInN1YiI6ImFsaWNlIiwidHlwZSI6InJlZnJlc2gifQ.YTfKOEGQrwSeSFfbV4pkyCJg0jJxb6cVZ9pER2QnjdC_2jmrVHhLG_70-Wzm-lW1dYp-T9D_WbrdrTt_XY3ZqrBPP9D_E8OtGzuH2-F9lVz96xoQT-0j0i9uT9rK01UjaPc6LW1GnJbfYen5YxoslAkOBhLlhb2QmYN3GPliIMEpHjE7b6SJgdZ83tonBKhod4TcQqcfGT0MiP5cAObctZlPBvqDGVtCv7WkqpsdsuwdSskWw4QnotaZa9QC8_avSHWJJPj3zIAjfdWhIIbOJn6xQf8v7fextyccAPCbrjRPwtCWco-kP5Oa-ChaQBtB6EG2H3DqfBKnHrmVAzXHAA
Response
HTTP/2.0 400 Bad Request Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bada91c2d3cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:36:14 GMT Fly-Request-Id: 01M95S3HDYY6A96PRFE1GYJ4JX-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=NT3yH3OTf31q%2FsLULcxNOUHfb9W2ACXHs50SaLDGeKYBwBKE4Qxwafs7eS0zAXGWOZZ35vOBFtXYYgqV2dQn2tPzhDwM3%2Fx13ZIqx1OyhMPfT7thXWSoKeHXyLnfYkfGhl4%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=4,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_grant","error_description":"invalid refresh token","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 GlassTests
- TestRefreshGrantValidatesTheRefreshToken
./internal/protocols/oauth2
Pass
Implementation
Explainer
What this requires
The token endpoint checks that a refresh token is one this server issued and that it is still good. The RFC puts it in three words, "validate the refresh token", and leaves the method to the server. Whatever the token's form, the server must be able to tell a live one from one that has expired, been revoked or been replaced, and from a string it never issued.
When a server rotates refresh tokens, the old one becomes invalid at the moment the new one is issued, and validating includes refusing it from then on.
Why it exists
A refresh token stands in for the resource owner's approval over a long period. Every way that approval can end, whether the user revokes access, the token ages out or it is rotated away, has to take effect at this check, because nothing else stands between the token and a new access token.
Section 10.4 explains what rotation adds: "If a refresh token is compromised and subsequently used by both the attacker and the legitimate client, one of them will present an invalidated refresh token, which will inform the authorization server of the breach."
What non-compliance looks like
A self-contained refresh token validated by signature alone. If the token is a signed JWT and the server checks only the signature and expiry, revocation and rotation do nothing: the old token still verifies. The same mistake accepts any JWT signed with the same key, an access token for example.
At /oauth2/token each of those is answered 400 with error invalid_grant and error_description invalid refresh token.
How ProtocolSoup tests it
Refresh tokens here are JWTs signed by the server, but a valid signature is not what makes one good. It has to be present in the Mock IdP's store, which is where rotation and revocation remove it. TestRefreshGrantValidatesTheRefreshToken presents a made-up string, an access token, a correctly signed refresh token that was never issued, an expired one, and a real one with its last two characters changed. All are invalid_grant. It then uses a real token once, presents it again after rotation, and presents another after revoking it at /oauth2/revoke; both are refused.
The captured passing exchange is issued-refresh-token. The failing one, refresh-tokens-the-server-does-not-hold, sends a made-up value, an access token and an altered refresh token.