首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

WWW-Authenticate

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

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

Header type

Response header

Forbidden header name

no

句法

代码语言:javascript
复制
WWW-Authenticate: <type> realm=<realm>

指令

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

例子

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

代码语言:javascript
复制
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

扫码关注腾讯云开发者

领取腾讯云代金券