第406章“不可接受”将 JanRain OpenID 库与 Google 一起使用时出错
我正在使用最新的 Janrain openid 库示例,发现过程似乎与 Yahoo、myopenid.com 和其他平台配合得很好...
但我坚持使用 Google 端点(https 分号 // www.google.com/accounts/o8/id)。 Consumer.php 在我重定向到 google 页面之前只返回 406 apache 错误。
我的所有安装都可以在这里找到: http://www.coplango.com/vendor/openid/examples/
- 点击在消费者上尝试消费者示例,但 discovery.php 以同样的方式失败,证明它在发现期间发生...
- 您还可以检查 detector.php 来检查我的安装 - HTTP 获取测试失败并显示 503,因为它试图到达返回 503 的地址。休息就可以了。
我认为这是由于 php-yadis 指定 Accept: application/xrds+xml
标头,但我检查了代码,其他类型也被接受,例如 text/html
和 application/xhtml+xml
。
有人遇到过这个吗?
有什么线索吗?
非常感谢!
I am using the latest Janrain openid library example and the discovery process seems to work well with Yahoo, myopenid.com and others...
But I am stuck with Google endpoint (https semicolon //www.google.com/accounts/o8/id). Consumer.php just returns a 406 apache error, before I am redirected to google's page.
All my installation is available here :
http://www.coplango.com/vendor/openid/examples/
- Click on consumer to try the consumer example, but discovery.php fails the same way,proving it happens during discovery...
- You can also check detect.php to check my installation - The HTTP fetching test fails with a 503 because it tries to reach an address which returns a 503. Rest is fine.
I supposed it was down to php-yadis specifying Accept: application/xrds+xml
header but I checked the code and other types are also accepted such text/html
and application/xhtml+xml
.
Anyone came accross this?
Any clue?
Thank you very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,
我已经进一步调查了,这似乎取决于我的提供者,如果任何包含死亡词“/id”的字符串作为 GET 参数传递,他会返回 406 错误。我花了几天时间才弄清楚这不是 openid 的问题!
作为信息,我正在使用 PlanetHoster,如果其他人遇到过这个问题。我已向他们发送了票务请求并等待他们的答复。
Ok,
I have investigated further and it seems to be down to my provider, who returns a 406 error if any string containing the death word "/id" is passed as GET parameter. Took me days to figure out it was not down to openid !!
For info I am using PlanetHoster, if anyone else ever comes accross this. I have sent them a ticket request and waiting for their answer.
在我的机器上运行消费者示例,我收到以下错误:
这意味着curl无法验证谷歌的https服务器证书。您可以通过向curl提供CA证书来解决此问题,以通过
CURLOPT_CAINFO
验证Google的证书/CURLOPT_CAPATH
,或者 - 更简单 - 停止验证通过CURLOPT_SSL_VERIFYPEER
获取证书。Auth/Yadis/ParanoidHTTPFetcher.php
中的以下更改对我来说完成了后者:当然,您的curl 安装也必须支持 ssl - 检查您的
phpinfo()
。此外,如果禁用CURLOPT_SSL_VERIFYPEER
,CURLOPT_SSL_VERIFYHOST
可能还需要为TRUE
或FALSE
。另请参阅 http://www.openrest.eu/ docs/openid-not-completely-enabled-for-google.php(通过相关 为什么 Google OpenID 提供程序不能与我的服务器上的 PHP-OpenId 配合使用?) 。
running the consumer example at my machine, i get the following error:
this means curl fails verifying google's https server certificate. you can workaround this by either providing curl with CA certificates to verify google's certificate via
CURLOPT_CAINFO
/CURLOPT_CAPATH
, or - easier - stop validating the cert viaCURLOPT_SSL_VERIFYPEER
. the following change inAuth/Yadis/ParanoidHTTPFetcher.php
accomplishes latter for me:of course, your curl installation must also support ssl - check your
phpinfo()
. also, ifCURLOPT_SSL_VERIFYPEER
is disabled,CURLOPT_SSL_VERIFYHOST
may also need to beTRUE
orFALSE
.see also http://www.openrest.eu/docs/openid-not-completely-enabled-for-google.php (via the Related Why doesn't Google OpenID provider work with PHP-OpenId on my server?).
解决方案:
在 .htaccess 文件中放入
SOLUTION:
In the .htaccess file put