307 credential forwarding
20After a login POST, a 307 redirect preserves the method and body, potentially sending user credentials to the client.
The password remains outside the app.
Key idea: Do not forward a credential-bearing POST.
Rules & examples
Do not forward a credential-bearing POST.
- Authorization servers MUST NOT use HTTP 307 to redirect requests that may contain user credentials.
- For HTTP redirection of such requests, servers SHOULD use 303 See Other.
- 303 unambiguously rewrites POST to GET. 302 does not guarantee the same behavior.
This is about a specific HTTP behavior, not a broken encryption channel. Even an honest client should never receive a user’s authorization-server password through a redirected request.
Sources
New to this? Start hereA quick picture + helpful background
A key is different from permission.
An app, a person, and a server have different roles. Follow who asks, who grants permission, and who checks the credential. A key in the drawing is an analogy, not a literal protocol field.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
For redirects of potentially credential-bearing requests, HTTP 307 is prohibited and 303 is recommended to avoid forwarding the POST body.
Read the updated RFC section ↗