我使用 janRain Php 库进行 OpenId 和 yadis 发现,无论我做什么,我都会在 user.openid.org 或我自己的提供商之类的东西中工作,但如果我尝试使用 google 端点,我将无法获取任何发现信息。

即使我运行 janrain 库的发现示例,我也会得到下一个结果 Claimed

Identifier  http://www.google.com/accounts/o8/id
No OpenID services discovered.

如果我在 url 之前添加 https://,也会发生同样的情况。

我的问题可能不是如何让它工作,但如果它实际上可能,我还有什么其他选择(在我的网站上运行,项目中不需要时髦的身份验证)。

为什么 openId 如此#@!#@ 复杂且无文档记录?(注意,我给了 zend_openid 几个小时才能得到相同的结果)

有帮助吗?

解决方案

它在这里工作。一些提示:

  • 据我了解, http(s)://www.google.com/accounts/o8/id 不是 openid 端点,而是 googles 发现 端点。你必须为其提供一个有效的(谷歌)OpenID 标识符,例如 example.blogspot.com, ,它返回声明的标识符、服务器 URL、服务类型等。
  • 我发现示例仅在修复后才起作用 <?<?=discover.php (将它们替换为 <?php<?php echo)。或者,您可以 ini_set('short_open_tag', '1'). 。默认情况下它处于关闭状态 php.ini-recommended.
  • 你的 PHP 安装支持 SSL 吗?看 自述文件, ,具体来说这部分:
Not all PHP installations support SSL.  You can find out if yours
supports SSL by reading the "HTTP Fetching" section of the output of
"examples/detect.php."  If your installation does not support SSL,
then https:// identity URLs and server URLs will not be supported by
the library.  An attempt to use such an identity URL will be
equivalent to using an invalid OpenID.  To enable SSL support,
recompile PHP with OpenSSL support or install the appropriate OpenSSL
module for your platform.  If you are using CURL, CURL will need to be
built with OpenSSL support.

其他提示

这是一个合法的牛肉。谷歌表示,他们支持OpenID,但他们并没有像其他人的工作别人的。 MyOpenID.com,BlogSpot的,AOL,雅虎,WordPress的,MySpace上,的LiveJournal和许多其他所有正确支持标准,它按预期工作。由于做自己的OpenID提供商,你可以建立一个使用CommunityID服务器项目。

/叹息

您需要做一个定向身份请求。通常情况下,仅仅是传递的网址,就好像用户已经进入这...这是一直在过去的工作对我来说(只要你使用支持OpenID2.0库)。

我建议你看一下这个问题: Janrain的PHP,OpenID和谷歌/雅虎

scroll top