OpenID 授权代码的 HTTP 身份验证 header
HTTP Authentication header for OpenID authorization codes
是否有适合与 OpenID Connect 一起使用的标准 HTTP 身份验证方案?我想到的场景如下:
HTTP 服务要求对用户进行身份验证。一种可能的身份验证方法是使用来自第 3 方 OpenID 提供商的联合身份。该服务作为机密客户端向第 3 方 OpenID 提供商注册,并拥有 client_id 和客户端机密。
当用户尝试访问 HTTP 服务时,服务器以 [=13=] 和 WWW-Authenticate
header 响应,其中包含有关如何向 OpenID 提供商发起身份验证请求的信息:
WWW-Authenticate: OpenIDConnect realm="MyService", client_id="1234-5678", authorization_url="https://provider/authorize"
客户端联系授权端点,进行身份验证,然后获取授权码。然后通过 Authorization
header 在对服务的后续请求中指定代码,例如:
GET / HTTP/1.1
Authorization: OpenIDConnect client_id="1234-5678", code="AAABAAA..."
服务将使用该代码从 OpenID 提供商处获取 ID 令牌,并与客户端建立经过身份验证的 session,例如通过设置 cookie 或返回一组新的凭据以用于后续请求。
OpenIDConnect
方案是我为这个例子编造的。我曾尝试寻找一种标准方法来做类似的事情,但由于没有结果,我得到了以下可能的答案:
- 我搜索的还不够。
- 我想做的是错误的误导。
- 每个人都为此目的实施自己的自定义身份验证方案
我想你一开始并不知道去哪里找。由于 RFC 7353, authentication schemes in HTTP are subject to the IANA HTTP Authentication Scheme Registry. In said registry, you are going to find the OAuth
scheme which is subject to RFC 5849, section 3.5.1 and is looking a lot like what you are looking for. That being said, however, this is for OAuth 1.0. OAUth 2.0 is resorting to the Basic
(RFC 6749) and Bearer
(RFC 6750) 方案。
这完全与授权(通过 OAuth)有关。不过,OpenID 的领域是 authentication。你可能想看看 What's the difference between OpenID and OAuth?
是否有适合与 OpenID Connect 一起使用的标准 HTTP 身份验证方案?我想到的场景如下:
HTTP 服务要求对用户进行身份验证。一种可能的身份验证方法是使用来自第 3 方 OpenID 提供商的联合身份。该服务作为机密客户端向第 3 方 OpenID 提供商注册,并拥有 client_id 和客户端机密。
当用户尝试访问 HTTP 服务时,服务器以 [=13=] 和 WWW-Authenticate
header 响应,其中包含有关如何向 OpenID 提供商发起身份验证请求的信息:
WWW-Authenticate: OpenIDConnect realm="MyService", client_id="1234-5678", authorization_url="https://provider/authorize"
客户端联系授权端点,进行身份验证,然后获取授权码。然后通过 Authorization
header 在对服务的后续请求中指定代码,例如:
GET / HTTP/1.1
Authorization: OpenIDConnect client_id="1234-5678", code="AAABAAA..."
服务将使用该代码从 OpenID 提供商处获取 ID 令牌,并与客户端建立经过身份验证的 session,例如通过设置 cookie 或返回一组新的凭据以用于后续请求。
OpenIDConnect
方案是我为这个例子编造的。我曾尝试寻找一种标准方法来做类似的事情,但由于没有结果,我得到了以下可能的答案:
- 我搜索的还不够。
- 我想做的是错误的误导。
- 每个人都为此目的实施自己的自定义身份验证方案
我想你一开始并不知道去哪里找。由于 RFC 7353, authentication schemes in HTTP are subject to the IANA HTTP Authentication Scheme Registry. In said registry, you are going to find the OAuth
scheme which is subject to RFC 5849, section 3.5.1 and is looking a lot like what you are looking for. That being said, however, this is for OAuth 1.0. OAUth 2.0 is resorting to the Basic
(RFC 6749) and Bearer
(RFC 6750) 方案。
这完全与授权(通过 OAuth)有关。不过,OpenID 的领域是 authentication。你可能想看看 What's the difference between OpenID and OAuth?