非常教程

HTTP参考手册

标题 | Headers

WWW-Authenticate

HTTP WWW-Authenticate响应标头定义了应该用来访问资源的认证方法。

所述WWW-Authenticate报头与一个一起发送401 Unauthorized响应。

Header type

Response header

Forbidden header name

no

句法

WWW-Authenticate: <type> realm=<realm>

指令

<type> 认证类型。常见的类型是“基本”。IANA 维护认证方案列表 .realm = <realm> 保护区的描述。如果未指定领域,则客户端通常会显示格式化的主机名。

例子

通常,服务器响应包含一个如下所示的WWW-Authenticate标头:

WWW-Authenticate: Basic

WWW-Authenticate: Basic realm="Access to the staging site"

有关如何配置 Apache 或 nginx 服务器以使用 HTTP 基本身份验证为您的站点密码保护的示例,另请参阅 HTTP 身份验证。

产品规格

Specification

Title

RFC 7235, section 4.1: WWW-Authenticate

HTTP/1.1: Authentication

RFC 7617

The 'Basic' HTTP Authentication Scheme

HTTP

超文本传输协议( HTTP,HyperText Transfer Protocol ) 是互联网上应用最为广泛的一种网络协议。所有的 WWW 文件都必须遵守这个标准。