如何使用OpenID Connect WebFinger端点? [英] How to use the OpenID Connect WebFinger Endpoint?

查看:510
本文介绍了如何使用OpenID Connect WebFinger端点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读此处的说明,其中说:


WebFinger - 根据用户的电子邮件地址或其他信息,为给定用户启用动态发现OpenID Connect提供程序。

WebFinger — Enables dynamic discovery of the OpenID Connect provider for a given user, based on their email address or some other information.

有人能给出一个如何工作的例子(描述有些抽象)吗?

Can someone give an example of how this works (Description is somewhat abstract)?

推荐答案

WebFinger是 RFC7033 中定义的协议。 第3.1节中有一个完整的示例:

WebFinger is a protocol defined in RFC7033. There is a complete example in section 3.1:


3.1。 OpenID Connect的身份提供商发现

假设Carol希望使用
OpenID Connect访问她访问的网站进行身份验证。她会在网站上提供她的OpenID
连接标识符,例如carol@example.com。访问过的网站
将执行WebFinger查询,查找OpenID Connect
提供程序。由于该网站只对一个特定的链接
关系感兴趣,因此WebFinger资源可能会将rel参数用作第4.3节中描述的

Suppose Carol wishes to authenticate with a web site she visits using OpenID Connect. She would provide the web site with her OpenID Connect identifier, say carol@example.com. The visited web site would perform a WebFinger query looking for the OpenID Connect provider. Since the site is interested in only one particular link relation, the WebFinger resource might utilize the "rel" parameter as described in Section 4.3:

GET /.well-known/webfinger?
        resource=acct%3Acarol%40example.com&
        rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer
        HTTP/1.1
 Host: example.com

服务器可能会这样回复:

The server might respond like this:

HTTP/1.1 200 OK
 Access-Control-Allow-Origin: *
 Content-Type: application/jrd+json

{
   "subject" : "acct:carol@example.com",
   "links" :
   [
     {
       "rel" : "http://openid.net/specs/connect/1.0/issuer",
       "href" : "https://openid.example.com"
     }
   ]
 }

由于rel参数仅用于过滤资源返回的链接关系
,响应中的其他名称/值对,
将返回包括任何别名或属性的b。此外,由于
不支持rel参数,因此客户必须
不要假设links数组只包含请求的链接
关系。

Since the "rel" parameter only serves to filter the link relations returned by the resource, other name/value pairs in the response, including any aliases or properties, would be returned. Also, since support for the "rel" parameter is not guaranteed, the client must not assume the "links" array will contain only the requested link relation.

这篇关于如何使用OpenID Connect WebFinger端点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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