What must a resource server check before it serves a request with an access token?
Access token validated for expiry and scope by the resource serverRFC 6749 §7MUSTRoles: resource_server
Requirement as recorded in the ProtocolSoup registry
The resource server MUST validate the access token and ensure that it has not expired and that its scope covers the requested resource.
Read §7 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 a client_credentials access token as machine-client, with scope api:read api:write, and presents it to GET /oauth2/resource as a Bearer token. The token is valid, unexpired, and its scope has meaning at this resource.
Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.
1.GET https://protocolsoup.com/oauth2/resource200 OK
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/resource HTTP/2.0 Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiYXQrand0In0.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiY2xpZW50X2lkIjoibWFjaGluZS1jbGllbnQiLCJjbGllbnRfbmFtZSI6Ik1hY2hpbmUtdG8tTWFjaGluZSBDbGllbnQiLCJleHAiOjE3OTY1Njc3ODUsImlhdCI6MTc5NjU2NDE4NSwiaXNzIjoiaHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL29hdXRoMiIsImp0aSI6Imp0aS01NzU4NTI0ZmYxNDA2NDRhIiwibmJmIjoxNzk2NTY0MTg1LCJzY29wZSI6ImFwaTpyZWFkIGFwaTp3cml0ZSIsInN1YiI6Im1hY2hpbmUtY2xpZW50In0.X5xvRPjIbaClXu0auOPd2JwO6RxVKzuRQVSTYLV0Zvhry8f4smB4TdBy9Hd-GwuCtmxy4e_zISAlwZZStt-pu354LuhjPK7gHHdIfA0JhmmVB5PNYDPnLKfAAYXIWbQ9bxsqYHsJ9sYvOTuVZyThvyzoq_CUcB4QF4NTd02Uc2abvY_rxLoNsrdbgFOz0shNBK--GgeasKZKRj2bM1hS7Ve7XlLzUp1pLiB55b6uxaiT4tKyHIohSXhC8NPfwh4RGCasM6J0hwxuvK5f9UGMon-0-U9jutau7yulMXzBaDIOh_oXqQvPVtxg9M1UxCjKCBP1NTsRgJ2qmpxX17mrHg Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 200 OK Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65badf41da13cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:36:26 GMT Fly-Request-Id: 01M95S3X4ZXKEYWVVEK6E0V417-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=fXrHlV9GvT6wJmOWGptG5IkC1qYwHMI5A%2FLrPkzjeGF0EvwDJH4nCWlfmbFa9yWlp90k4DHnx3%2BtUgM5W1KU3cL6wkVosuKbRikdYFDjhOuxn3%2F66zThp7U9K8k0LEyiyS8%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=4,cfOrigin;dur=198 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 {"data":"protected resource payload","dpop_bound":false,"scope":"api:read api:write","sub":"machine-client","token_type":"Bearer"}
Failing exchange
Rejected, as requiredConformance client
The conformance client obtains a client_credentials access token as machine-client and presents it to GET /oauth2/resource with the last four characters of its signature replaced, so it no longer validates. The resource answers 401 invalid_token. An expired token and a token whose scope does not cover the resource are refused the same way, with 401 and with 403 insufficient_scope; this authorization server issues neither on request, so the self-test covers them.
Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.
1.GET https://protocolsoup.com/oauth2/resource401 Unauthorized
TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2
Request
GET /oauth2/resource HTTP/2.0 Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiYXQrand0In0.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiY2xpZW50X2lkIjoibWFjaGluZS1jbGllbnQiLCJjbGllbnRfbmFtZSI6Ik1hY2hpbmUtdG8tTWFjaGluZSBDbGllbnQiLCJleHAiOjE3OTY1Njc3ODksImlhdCI6MTc5NjU2NDE4OSwiaXNzIjoiaHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL29hdXRoMiIsImp0aSI6Imp0aS04MTZhNDNiOGM3OTRkZWZhIiwibmJmIjoxNzk2NTY0MTg5LCJzY29wZSI6ImFwaTpyZWFkIGFwaTp3cml0ZSIsInN1YiI6Im1hY2hpbmUtY2xpZW50In0.MaPOcbmmxJtKReY6lFKyhVJpiPF94tXWPyDjS9o7YpbNk_bE41a_2huYELyjRws7hiKLSD_79_Q75ts0vW55kormx6RHFCW-s7gOEMdZc4SXN2PDh8RFaZvOJvNlJMP8x_l0fR83DBDb77ZA1RsVt8OfQ5Ogzbyja3ORbs532zxjmagiCsESY2xbgeGzqwh9uObWFCY2CDJP7iKUmaumNlsJRJ7FKMM0E_EV7cIz4fyd0qa7kLiH4FzNIFpD5lQS3RGWBEo31WN1sjALtOAcgS-_UbVDxy_zY03k_-KiTezSB1Bdedz_55Ciwz3TGEeKckP5bTO4SNp8DS5sURAAAA Host: protocolsoup.com User-Agent: ProtocolSoup-Conformance-Client/1
Response
HTTP/2.0 401 Unauthorized Cache-Control: no-store Cf-Cache-Status: DYNAMIC Cf-Ray: a65bae0d1a343cdb-MSP Content-Type: application/json Date: Sun, 06 Dec 2026 13:36:30 GMT Fly-Request-Id: 01M95S412TA286PJMC5X73ZF0R-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=G%2BwO1CYao%2Fn2wXzkbM2tGbclaQgw9ajlbxwFoI%2B2jh1jX7Alba6JdIh1VNwgXg%2FUG1DJPjOIb5S5kAyAcrScCSEt9wUZGrgsAIXNKcg%2FYyzl68OJgZeQJjDWi6nKd5ClPEw%3D"}]} Server: cloudflare Server-Timing: cfCacheStatus;desc="DYNAMIC" Server-Timing: cfEdge;dur=5,cfOrigin;dur=227 Speculation-Rules: "/cdn-cgi/speculation" Vary: Origin Vary: accept-encoding Via: 1.1 fly.io, 1.1 fly.io Www-Authenticate: Bearer error="invalid_token" X-Content-Type-Options: nosniff X-Frame-Options: DENY X-Xss-Protection: 1; mode=block {"error":"invalid_token","error_description":"invalid or expired access token"}
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
- TestProtectedResourceChecksValidityExpiryAndScope
./internal/protocols/oauth2
Pass
Implementation
Explainer
What this requires
A resource server must check three things before it serves a request: that the access token is valid, that it has not expired, and that its scope covers the resource the request is for. This is the only requirement RFC 6749 places on the resource server, and the rest of the sentence says how little it prescribes: the methods "are beyond the scope of this specification but generally involve an interaction or coordination between the resource server and the authorization server."
Validity depends on the token's form. For a signed JWT it means checking the signature against the authorization server's keys, the issuer and the audience. For an opaque token it means asking the authorization server. Scope is the check most often forgotten: a token can be genuine, current and issued for this resource server, and still not authorize this request.
Why it exists
The resource server is where delegated access is spent. Every limit set earlier in the flow, the lifetime the server chose and the scope the user approved, only binds if the resource server enforces it. An authorization server can issue perfectly scoped tokens to no effect if the API accepts any token that verifies.
What non-compliance looks like
An API that verifies the signature and stops. Expired tokens work until the key rotates, and a token granted for reading can write. Another form checks scope at the gateway for some routes and not others.
How ProtocolSoup tests it
/oauth2/resource validates a JWT access token as RFC 9068 Section 4 lists: the typ header, iss, aud, the signature and exp, and then the server's revocation list. Any failure is 401 with WWW-Authenticate: Bearer error="invalid_token". It then requires at least one scope value that has meaning at this resource. A token whose scope is empty, or holds only values that belong to the SSF or SCIM resources, is answered 403 with error insufficient_scope.
TestProtectedResourceChecksValidityExpiryAndScope mints four kinds of token for this resource: a good one (200), one with an altered signature (401 invalid_token), one already expired (401 invalid_token), and three whose scope does not cover the resource (403 insufficient_scope, with nothing returned).
The captured passing exchange, valid-token-with-covering-scope, presents a machine-client token and receives the resource. The failing one, token-that-does-not-validate, presents the same kind of token with the end of its signature replaced. The authorization server issues neither expired tokens nor tokens with a non-covering scope on request, so those two cases are shown by the self-test only.