# Http Headers info :::info 因為想知道 Yarp (Reverse Proxy) 如何把認證過的使用者資訊直接往下傳遞給 Api,稍微問了一下 ChatGPT ::: ### 關於 HTTP Header 規範與常見 Header,可以參考以下文件: - HTTP/1.1 規範:https://tools.ietf.org/html/rfc2616 - HTTP/2 規範:https://tools.ietf.org/html/rfc7540 - HTTP Header Fields 規範:https://www.iana.org/assignments/message-headers/message-headers.xhtml - 常見 HTTP Header:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers ### 一些業界慣例與建議可以參考以下資源: - OWASP Secure Headers Project:https://owasp.org/www-project-secure-headers/ - IETF Best Current Practice for HTTP Header Field Usage:https://tools.ietf.org/html/bcp222 ### well-known HTTP headers - Proxy-Authenticate: 是一個回應標頭 (response header),用於代理伺服器驗證,當代理伺服器要求用戶端進行身份驗證時,伺服器端回傳 407 Proxy Authentication Required 狀態碼並附上此 header,提示用戶端需要通過身份驗證才能訪問該代理。常見的身份驗證方式包括 Basic Authentication、Digest Authentication 等。 - Proxy-Authorization: 是一個回應標頭 (request header),用於向代理伺服器傳遞身份驗證資訊。當代理伺服器回傳 407 Proxy Authentication Required 狀態碼時,用戶端需要在後續的請求中帶上此 header,附上經過加密的使用者名稱和密碼,以完成身份驗證。常見的身份驗證方式包括 Basic Authentication、Digest Authentication 等。 ### 其他參考資料 https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#authentication_schemes 微軟的 Microsoft.Net.Http.Headers.HeaderNames 類別中也有常用的 headers key 可以參考
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up