什么是“境界”在基本认证中 [英] What is the "realm" in basic authentication

查看:153
本文介绍了什么是“境界”在基本认证中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在php网站上设置基本身份验证,并在上面找到了这个页面。 php手册显示设置。标题中的领域是什么意思?

I'm setting up basic authentication on a php site and found this page on the php manual showing the set up. What does "realm" mean here in the header?

header('WWW-Authenticate: Basic realm="My Realm"');

是否是要求的页面页面?

Is it the page page being requested?

推荐答案

来自RFC 1945(HTTP / 1.0) RFC 2617(HTTP / 1.1引用的HTTP身份验证)


发出质询的所有
身份验证方案都需要realm属性(不区分大小写)。领域值
(区分大小写)与被访问的
服务器的规范根URL相结合,定义了保护空间。这些领域
允许将服务器上受保护的资源划分为一组
的保护空间,每个保护空间都有自己的身份验证方案和/或
授权数据库。领域值是一个字符串,通常是由原始服务器分配的
,它可能具有特定于认证方案的附加语义

The realm attribute (case-insensitive) is required for all authentication schemes which issue a challenge. The realm value (case-sensitive), in combination with the canonical root URL of the server being accessed, defines the protection space. These realms allow the protected resources on a server to be partitioned into a set of protection spaces, each with its own authentication scheme and/or authorization database. The realm value is a string, generally assigned by the origin server, which may have additional semantics specific to the authentication scheme.

简而言之,同一领域中的页面应共享凭据。如果您的凭据适用于具有领域My Realm的页面,则应该假设相同的用户名和密码组合应该适用于具有相同领域的另一个页面。

In short, pages in the same realm should share credentials. If your credentials work for a page with the realm "My Realm", it should be assumed that the same username and password combination should work for another page with the same realm.

这篇关于什么是“境界”在基本认证中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆