Skip to content

Align /token responses with RFC 6749 cache and Basic encoding - #272

Open
Mehrn0ush wants to merge 2 commits into
CycloneDX:mainfrom
Mehrn0ush:docs/token-pragma-and-basic-encoding
Open

Mehrn0ush wants to merge 2 commits into
CycloneDX:mainfrom
Mehrn0ush:docs/token-pragma-and-basic-encoding

Conversation

@Mehrn0ush

@Mehrn0ush Mehrn0ush commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Pragma: no-cache on successful token responses alongside existing Cache-Control: no-store, per RFC 6749 section 5.1
  • Document in the basicAuth scheme that API key identifier and secret are each application/x-www-form-urlencoded encoded before userid:password and Base64, per RFC 6749 section 2.3.1
  • Align the token success example in auth/readme.md with the same Pragma header

Closes #271

Context

RFC 6749 section 5.1 requires both Cache-Control: no-store and Pragma: no-cache on responses that include tokens. OpenAPI previously only declared Cache-Control.

RFC 6749 section 2.3.1 requires form-encoding each credential before building the Basic header. That step matters for secrets containing :, @, or other reserved characters. auth/readme.md already described it; the OpenAPI basicAuth description did not.

Add Pragma: no-cache beside Cache-Control: no-store, and document form-urlencoded encoding of client credentials before Basic.

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
@oej

oej commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

@taleodor what do you think?

@taleodor

Copy link
Copy Markdown
Contributor

I think we shouldn't merge this. Pragma is deprecated in RFC 9111 and dropped in OAuth 2.1. I don't think we should mandate a legacy header.

@taleodor

Copy link
Copy Markdown
Contributor

Alternatively, maybe remove Pragma completely from PR and just keep encoding part?

@Mehrn0ush

Copy link
Copy Markdown
Contributor Author

Good catch — agreed. RFC 6749 includes Pragma: no-cache for HTTP/1.0 compatibility, but RFC 9111 deprecates it and OAuth 2.1 dropped it in favor of Cache-Control: no-store alone. I’ll remove the Pragma requirement from this PR and keep the Basic credential encoding clarification.

RFC 9111 deprecates Pragma and OAuth 2.1 requires only
Cache-Control: no-store. Keep the Basic form-urlencoded
encoding clarification.

Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.com>
@Mehrn0ush

Copy link
Copy Markdown
Contributor Author

Thanks @taleodor — that makes sense. I’ve removed the Pragma requirement from this PR and kept the Basic form-urlencoded encoding clarification.

@oej

oej commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Are we ready to merge @taleodor ?

@oej oej added the Prio 1 label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align /token with RFC 6749 Pragma and Basic credential encoding

3 participants