Which cache headers must a response that contains tokens carry?

Cache-Control no-store and Pragma no-cache on responses with tokensRFC 6749 §5.1MUSTRoles: authorization_server

Requirement as recorded in the ProtocolSoup registry

The authorization server MUST include the HTTP "Cache-Control" response header field [RFC2616] with a value of "no-store" in any response containing tokens, credentials, or other sensitive information, as well as the "Pragma" response header field [RFC2616] with a value of "no-cache".

Read §5.1 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 sends demo-app's authorization request and redeems the code authenticated over HTTP Basic. The token response carries Cache-Control: no-store and Pragma: no-cache. The sign-in between the two requests is not recorded.

Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.

  1. 1.GET https://protocolsoup.com/oauth2/authorize?client_id=demo-app&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=w32y5rMCeAUXLSB2P0ogTQ200 OK

    TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2

    Request

    GET /oauth2/authorize?client_id=demo-app&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback&response_type=code&scope=profile&state=w32y5rMCeAUXLSB2P0ogTQ HTTP/2.0
    Accept: text/html
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    

    Response

    HTTP/2.0 200 OK
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65babc7df3e3cdb-MSP
    Content-Type: text/html
    Date: Sun, 06 Dec 2026 13:34:57 GMT
    Fly-Request-Id: 01M95S167MP1ZMS5CKJCVTYE1C-ord
    Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
    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=AfJjf1QFpIlow55brD5ZvbFo4ACW%2BdyIKA9HQofFVzPNmR%2Fqkglqt6rE56SHCj1bCZnI37kPUs22qIiyD%2B4Zj1dwLg5RbSlJydVlvRUqTEpq25Pj70sThQra7Aq9lUjRKog%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=4,cfOrigin;dur=201
    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
    
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <title>Login - Protocol Showcase</title>
        <style>
    
            * { box-sizing: border-box; margin: 0; padding: 0; }
            body {
                font-family: 'Segoe UI', system-ui, sans-serif;
                background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
                min-height: 100vh;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #e4e4e7;
                padding: 16px;
            }
            .container {
                background: rgba(255, 255, 255, 0.05);
                backdrop-filter: blur(10px);
                border: 1px solid rgba(255, 255, 255, 0.1);
                border-radius: 16px;
                padding: 28px;
                width: 100%;
                max-width: 420px;
                box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            }
            @media (min-width: 480px) {
                body { padding: 0; }
                .container { padding: 40px; }
            }
            .logo {
                text-align: center;
                margin-bottom: 30px;
            }
            .logo h1 {
                font-size: 24px;
                font-weight: 600;
                color: #fff;
            }
            .logo p {
                color: #a1a1aa;
                font-size: 14px;
                margin-top: 8px;
            }
            .client-info {
                background: rgba(99, 102, 241, 0.1);
                border: 1px solid rgba(99, 102, 241, 0.2);
                border-radius: 8px;
                padding: 16px;
                margin-bottom: 24px;
                text-align: center;
            }
            .client-info span {
                color: #a5b4fc;
                font-size: 14px;
            }
            .client-info strong {
                color: #fff;
            }
            .form-group {
                margin-bottom: 20px;
            }
            label {
                display: block;
                font-size: 14px;
                font-weight: 500;
                margin-bottom: 8px;
                color: #d4d4d8;
            }
            input[type="email"], input[type="password"], input[type="text"] {
                width: 100%;
                padding: 12px 16px;
                border: 1px solid rgba(255, 255, 255, 0.1);
                border-radius: 8px;
                background: rgba(0, 0, 0, 0.2);
                color: #fff;
                font-size: 16px;
                transition: all 0.2s;
            }
            input:focus {
                outline: none;
                border-color: #6366f1;
                box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
            }
            button {
                width: 100%;
                padding: 14px;
                background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
                border: none;
                border-radius: 8px;
                color: #fff;
                font-size: 16px;
                font-weight: 600;
                cursor: pointer;
                transition: transform 0.2s, box-shadow 0.2s;
            }
            button:hover {
                transform: translateY(-2px);
                box-shadow: 0 10px 20px -10px rgba(99, 102, 241, 0.5);
            }
            .error {
                background: rgba(239, 68, 68, 0.1);
                border: 1px solid rgba(239, 68, 68, 0.2);
                color: #fca5a5;
                padding: 12px;
                border-radius: 8px;
                margin-bottom: 20px;
                font-size: 14px;
            }
            .demo-users {
                margin-top: 24px;
                padding-top: 24px;
                border-top: 1px solid rgba(255, 255, 255, 0.1);
            }
            .demo-users h3 {
                font-size: 14px;
                color: #a1a1aa;
                margin-bottom: 12px;
            }
            .demo-user {
                background: rgba(0, 0, 0, 0.2);
                border: 1px solid rgba(255, 255, 255, 0.05);
                border-radius: 8px;
                padding: 12px;
                margin-bottom: 8px;
                cursor: pointer;
                transition: all 0.2s;
            }
            .demo-user:hover {
                background: rgba(99, 102, 241, 0.1);
                border-color: rgba(99, 102, 241, 0.2);
            }
            .demo-user .name {
                font-weight: 500;
                color: #fff;
            }
            .demo-user .email {
                font-size: 12px;
                color: #71717a;
            }
            .scopes {
                margin-top: 16px;
                font-size: 12px;
                color: #71717a;
            }
            .scopes span {
                display: inline-block;
                background: rgba(99, 102, 241, 0.1);
                padding: 4px 8px;
                border-radius: 4px;
                margin: 2px;
            }
    
        </style>
    </head>
    <body>
        <div class="container">
            <div class="logo">
                <h1>Protocol Showcase</h1>
                <p>OAuth 2.0 Authorization</p>
            </div>
            
            <div class="client-info">
                <span>Signing in to <strong>Demo Application</strong></span>
            </div>
    
            <!-- ERROR -->
    
            <form method="POST" action="/oauth2/authorize">
                <input type="hidden" name="login_request_id" value="SP9ez9n4sXu6TrXdtISdZA">
                
                <div class="form-group">
                    <label for="email">Email</label>
                    <input type="email" id="email" name="email" placeholder="[email protected]" required>
                </div>
                
                <div class="form-group">
                    <label for="password">Password</label>
                    <input type="password" id="password" name="password" placeholder="password" required>
                </div>
                
                <button type="submit">Sign In</button>
            </form>
    
            <div class="demo-users"><h3>Demo Users (click to autofill)</h3><div class="demo-user" data-email="[email protected]" data-password="4bbw3nqtTsR9az7s2albdeeu" onclick="fillCredentials(this.dataset.email || '', this.dataset.password || '')"><div class="name">Alice (Standard User)</div><div class="email"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6e0f02070d0b2e0b160f031e020b400d0103">[email&#160;protected]</a></div></div><div class="demo-user" data-email="[email protected]" data-password="6PdvnYFdfrvoyxTXbzmHF9c1" onclick="fillCredentials(this.dataset.email || '', this.dataset.password || '')"><div class="name">Bob (Standard User)</div><div class="email"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8be9e4e9cbeef3eae6fbe7eea5e8e4e6">[email&#160;protected]</a></div></div><div class="demo-user" data-email="[email protected]" data-password="ETi7vCbBBwojO-wKkmBZp81Q" onclick="fillCredentials(this.dataset.email || '', this.dataset.password || '')"><div class="name">Admin (Elevated Permissions)</div><div class="email"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6706030a0e0927021f060a170b024904080a">[email&#160;protected]</a></div></div></div>
    
            <div class="scopes">
                Requested scopes: <span>profile</span>
            </div>
        </div>
    
        <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script>
            function fillCredentials(email, password) {
                document.getElementById('email').value = email;
                document.getElementById('password').value = password;
            }
        </script>
    <script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/vce701823e78c4301a35b7e07294d87301792088814092" integrity="sha512-UKNk8GbxkABxKcXYuLkO16EleLGUkcvJWtpSNmExE0Too3ZaFAxTscNWEc1OdAv5/BikHawapSCaiD2XCmp+Bw==" data-cf-beacon='{"version":"2024.11.0","token":"4e68ea7d404d48c4b57e5a383f411883","spa":2}' crossorigin="anonymous"></script>
    <script>(function(){function c(){var b=a.contentDocument||(a.contentWindow&&a.contentWindow.document);if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a65babc7df3e3cdb',t:'MTc5NjU2NDA5Nw=='};var l=window.parent.location,o;try{o=new URL(l.origin).origin}catch(e){try{o=new URL(new URL(l.href).origin).origin}catch(e){o=''}}var u='/cdn-cgi/challenge-platform/scripts/jsd/main.js?ray=a65babc7df3e3cdb',a=document.createElement('script');a.src=o?new URL(u,o).href:u;document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>
    </html>
  2. 2.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 ZGVtby1hcHA6OXh2TTdNYXZPSXYyc0xoODFBUnBLNHRabUJKV2ZVSnA=
    Content-Length: 122
    Content-Type: application/x-www-form-urlencoded
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    code=lW4ECtH2_rswbEOM9-uXlnyL5yec_pPd&grant_type=authorization_code&redirect_uri=https%3A%2F%2Fprotocolsoup.com%2Fcallback

    Response

    HTTP/2.0 200 OK
    Cache-Control: no-store
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65babda9bfb3cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:35:00 GMT
    Fly-Request-Id: 01M95S195CT9G9HHQXRA3Q1QB0-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=%2B3AzRcPuipPLV%2BWjEAIR%2B17DYGj4kSLwkzfDlA%2BOaII5SSaSCCoX3D1ebXpRcuUPFfl8sgcO%2FfQ0Rb0zw7mjpNoRMBuhb%2Fr3yxsd6ElsClOkiety%2FEmob9iJ8vqf16Qaz5U%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=2,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
    
    {"access_token":"eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoiYXQrand0In0.eyJhdWQiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2F1dGgyL3Jlc291cmNlIiwiYmlydGhkYXRlIjoiMTk5MC0wMy0xMiIsImNsaWVudF9pZCI6ImRlbW8tYXBwIiwiZXhwIjoxNzk2NTY3NzAwLCJmYW1pbHlfbmFtZSI6IkpvaG5zb24iLCJnZW5kZXIiOiJmZW1hbGUiLCJnaXZlbl9uYW1lIjoiQWxpY2UiLCJpYXQiOjE3OTY1NjQ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TY0MTAwLCJpc3MiOiJodHRwczovL3Byb3RvY29sc291cC5jb20iLCJqdGkiOiJyZWZyZXNoLWViMWU5YmMzZmZiNTJlZjEiLCJzY29wZSI6InByb2ZpbGUiLCJzdWIiOiJhbGljZSIsInR5cGUiOiJyZWZyZXNoIn0.auuKJ-VDOCimpPJZYwOIgnd2uBJYfq5G722Kx6NzntCjCr5sg4fIOEH4hXo1HOpwRo_zOM0rQJuAkoCh8aEjAMyPIWT_-DwFP71lkbpnc7LvVnx6-MfLfnXITs1KLZ0WvgUiXeSZNRMq4so9k9m6zBVzrrquZuqPSMDdeP7KYfwXRPRvm-jutOQW1SzBy5-FcEO1fmxDkGdFZG5vVScoOjsWFxu1CNm3Ia_QTIulowf9v1xNeG-F1nxGm8sP_owmb0STCCv74WLGObi0geVYIzE1UX_P8Tc8Bsnyo7pM3LbBuBtOGEqnCMoDwEAhmx3Lg_C-Qe9REPDBPmiiUhca5A","scope":"profile"}
    

Failing exchange

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

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

A response that contains tokens must carry two cache headers, Cache-Control: no-store and Pragma: no-cache. They go on "any response containing tokens, credentials, or other sensitive information". That covers more than the token endpoint's success response. An implicit grant response has a token in its redirect, and an introspection response describes one.

no-store tells every cache between the server and the client, including the client's own, not to keep the response. Pragma: no-cache is the HTTP/1.0 equivalent, kept for old intermediaries.

Why it exists

HTTP responses are cacheable unless they say otherwise, and a token response is a bearer credential in plain JSON. A browser cache, a corporate proxy or a CDN that stores it has stored something that grants access until it expires. The person who finds it later, on a shared machine or in a cache dump, does not need to attack anything.

What non-compliance looks like

A token endpoint that returns only Content-Type. Nothing fails in testing, because caches rarely store POST responses by default. The exposure appears with the implicit grant, with a misconfigured reverse proxy, or with a client that fetches tokens through a caching layer.

Setting the headers only on success is another form. An error response can carry sensitive detail too, and applying one rule everywhere is simpler.

How ProtocolSoup tests it

Every JSON response of the OAuth 2.0 endpoints is written through one function that sets both headers, so success and error responses carry them alike. TestTokenResponsesAreMarkedNoStore checks the successful response of the authorization_code, refresh_token and client_credentials grants for exactly no-store and no-cache. It then runs an implicit grant and checks the 302 whose Location fragment holds the access token: that response carries both headers too.

The captured passing exchange, no-store-on-the-token-response, is a code exchange by demo-app whose response headers are checked the same way. No failing exchange is captured, because the requirement governs the server's response and no request is refused under it.

Related requirements

All RFC 6749 requirements · OAuth 2.0 protocol page

Which cache headers must a response that contains tokens carry? · RFC 6749 §5.1 | ProtocolSoup