使用您自己的域获得可靠 OpenID 的提示

发布于 2024-11-28 05:43:00 字数 1873 浏览 0 评论 0原文

我正在尝试使用我的域名作为标识符来构建基于 OpenID 的个人在线身份。我希望能够完成这一切:

  • http://alvaro.es/ 作为我的标识符。
  • 能够透明地切换提供商。
  • 登录任何接受 OpenID 的第三方站点。
  • 能够提供个人详细信息(电子邮件、时区、头像...)并获得是否将其发送到请求这些信息的网站的提示。
  • 在我自己的(PHP 驱动的)站点中接受 OpenID,无需购买 SSL 托管。

我已阅读常用文档并且我一直在评估多个 OpenID 提供商(Google、Yahoo、myOpenID...甚至运行我自己的服务器)。事实上,我使用 OpenID 一段时间了,并且:

  • 提供商提供的文档非常稀缺,或者根本不提供。
  • 无论我选择哪个提供商,总会有一些网站登录失败(通常没有错误消息)。
  • 我对提供者返回的标识符几乎没有控制(或根本没有)。
  • 我仍然不明白这一切到底是如何运作的。

我正在寻找一般性建议,但我知道这可能是主观的,所以我会提出一些具体问题。


到目前为止,我正在尝试 myOpenId 作为提供者和 LightOpenID 作为消费者。我的问题是:

  1. 我的URL 提供了 HTTP 标头:

    <前><代码> X-XRDS-位置:http://kalvaro.myopenid.com/?xrds=1

    ...以及以下 HTML 标记:

     ;
     ;
    

    正确吗?够了吗?

  2. myOpenID 提供Your Domains,这是一个注册自己域名的功能,但我还不敢测试它(它需要更改 DNS),并且配置表单建议我必须在以下两者之间进行选择http://openid.alvaro.es/usernamehttp://username.alvaro.es/ 作为标识符(不是 http://alvaro.es /)。但是,如果没有此功能,Stackoverflow 仍会将 alvaro.es 报告为我的标识符。我需要使用它吗?

  3. 实现 LightOpenID 时,我将本地用户与 $openid->identity 进行匹配(其中 $openidLightOpenID 的实例)目的)。该属性似乎是用户提供的 URL。正确吗?

  4. 是否有比我选择的更合适的提供者或消费者库?

I'm trying to build a personal OpenID-based online identity using my domain name as identifier. I want to be able to accomplish all this:

  • Make http://alvaro.es/ my identifier.
  • Be able to switch providers transparently.
  • Log into any third-party site that accepts OpenID.
  • Be able to provide personal details (e-mail, time zone, avatar...) and get prompted whether to send them or not to sites that request them.
  • Accept OpenID in my own (PHP-powered) sites without the need of purchasing SSL hosting.

I've read the usual doc and I've been evaluating several OpenID providers (Google, Yahoo, myOpenID... and even running my own server). The fact is that I've been using OpenID for a while and:

  • Providers offer very scarce documentation or none at all.
  • No matter what provider I choose, there are always sites where log-in fails (typically without an error message).
  • I have little control (or none at all) on the identifier returned by the provider.
  • I still can't understand how all this really works.

I'm looking for general advice but I understand that can be subjective so I'll make a few specific questions.


So far, I'm trying out myOpenId as provider and LightOpenID as consumer. My questions are:

  1. My URL provides an HTTP header:

     X-XRDS-Location: http://kalvaro.myopenid.com/?xrds=1
    

    ... and the following HTML tags:

     <link rel="openid.server openid2.provider" href="http://www.myopenid.com/server">
     <link rel="openid.delegate openid2.local_id" href="http://kalvaro.myopenid.com">
    

    Is it correct? Is it enough?

  2. myOpenID provides Your Domains, a feature to register your own domain name but I haven't dared to test it (it needs changes to the DNS) and the configuration form suggests I have to choose between http://openid.alvaro.es/username and http://username.alvaro.es/ as identifier (not http://alvaro.es/). However, Stackoverflow still reports alvaro.es as my identifier without this feature. Do I need to use it?

  3. When implementing LightOpenID, I match the local user against $openid->identity (where $openid is the instance of the LightOpenID object). This attribute appears to be the URL supplied by the user. Is it correct?

  4. Are there more adequate providers or consumer libraries than the ones I chose?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与之呼应 2024-12-05 05:43:00
  1. 这是正确的。这已经足够了。虽然提供 X-XRDS 位置是一件好事,因为它加快了发现过程,但并不是绝对必要的。
  2. 据我了解,当您想在域中拥有多个帐户时,“您的域”非常有用。无论如何,你根本不需要使用它。
  3. 这是正确的。 url 也称为声明标识符,即用户声明的标识符。
  4. 作为 LightOpenID 的作者,我的答案是显而易见的,而且可能有偏见——我创建了它,因为我找不到一个好的现有库。

您可能想知道的其他事项:

  • 委派不适用于 Google 以及使用 select_identifier 的任何其他提供商(即每个帐户都有相同的 url,然后提供商会要求您登录)。
  • 您的委托(如 1. 所示)将允许您透明地切换提供商并登录到任何支持 OpenID 的站点,就像您想要的那样。
  • 至于个人信息,完全取决于提供商,是否发送,支持什么样的个人信息等等。例如,Google不让你选择发送什么,只能选择是否发送(以及网站声称要求的一切)。
  • 有些实现是有缺陷的并且确实失败了。尝试第二次登录,有时可以。
  • 如果您使用委托,那么您的提供商返回的标识符并不重要。您登录的网站应使用您声明的标识符。

至于 openid 的工作原理,请参阅该问题的一些答案

  1. It is correct. It is more than enough. While providing an X-XRDS-Location is a good thing, as it sepeeds up the discovery process, it isn't sctrictly necessary.
  2. As far as I understand it, "Your Domains" is useful when you want to have multiple accounts in your domain. Anyway, you don't need to use it at all.
  3. It is correct. The url is also called a Claimed Identifier, i.e. what the user claims to be.
  4. As the author of LightOpenID, my answer is obvious and possibly biased -- I've created it, because I couldn't find a good, existing library.

Other things you might want to know:

  • Delegation won't work with Google, and any other provider who uses select_identifier (i.e. each account has the same url, and then the provider asks you for your login).
  • Your delegation, as shown in 1., will let you switch providers transparently and log in to any site that supports OpenID, just as you want.
  • As for the personal details, it depends completely on the provider, whether it sends them or not, what kind of personal information it supports, etc.. For example, Google doesn't let you choose what to send, only whether to send something (and everything the website claims to require) at all.
  • Some implementations are buggy and indeed fail. Try logging in for a second time, it works sometimes.
  • The identifier returned by your provider shouldn't matter if you use delegation. The website you're logging into should use your claimed identifier.

As for how the openid works, see some answers to that question on SO.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文