?
This document uses PHP Chinese website manual Release
HTTP WWW-Authenticate
響應(yīng)標(biāo)頭定義了應(yīng)該用來訪問資源的認(rèn)證方法。
所述WWW-Authenticate
報(bào)頭與一個(gè)一起發(fā)送401
Unauthorized
響應(yīng)。
Header type | Response header |
---|---|
Forbidden header name | no |
WWW-Authenticate: <type> realm=<realm>
<type> 認(rèn)證類型。常見的類型是“基本”。IANA 維護(hù)認(rèn)證方案列表 .realm = <realm> 保護(hù)區(qū)的描述。如果未指定領(lǐng)域,則客戶端通常會(huì)顯示格式化的主機(jī)名。
通常,服務(wù)器響應(yīng)包含一個(gè)如下所示的WWW-Authenticate
標(biāo)頭:
WWW-Authenticate: Basic WWW-Authenticate: Basic realm="Access to the staging site"
有關(guān)如何配置 Apache 或 nginx 服務(wù)器以使用 HTTP 基本身份驗(yàn)證為您的站點(diǎn)密碼保護(hù)的示例,另請(qǐng)參閱 HTTP 身份驗(yàn)證。
Specification | Title |
---|---|
RFC 7235, section 4.1: WWW-Authenticate | HTTP/1.1: Authentication |
RFC 7617 | The 'Basic' HTTP Authentication Scheme |