第406章“不可接受”将 JanRain OpenID 库与 Google 一起使用时出错

发布于 2024-08-05 18:21:47 字数 750 浏览 7 评论 0原文

我正在使用最新的 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/htmlapplication/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 技术交流群。

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

发布评论

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

评论(3

美羊羊 2024-08-12 18:21:47

好吧,

我已经进一步调查了,这似乎取决于我的提供者,如果任何包含死亡词“/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.

李不 2024-08-12 18:21:47

在我的机器上运行消费者示例,我收到以下错误:

Got no response code when fetching https://www.google.com/accounts/o8/id
CURL error (60): SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

这意味着curl无法验证谷歌的https服务器证书。您可以通过向curl提供CA证书来解决此问题,以通过CURLOPT_CAINFO验证Google的证书/CURLOPT_CAPATH,或者 - 更简单 - 停止验证通过 CURLOPT_SSL_VERIFYPEER 获取证书。 Auth/Yadis/ParanoidHTTPFetcher.php 中的以下更改对我来说完成了后者:

--- ParanoidHTTPFetcher.php.orig        2009-04-22 02:31:20.000000000 +0800
+++ ParanoidHTTPFetcher.php     2009-09-30 22:35:24.093750000 +0800
@@ -127,6 +127,9 @@
                         Auth_OpenID_USER_AGENT.' '.$curl_user_agent);
             curl_setopt($c, CURLOPT_TIMEOUT, $off);
             curl_setopt($c, CURLOPT_URL, $url);
+
+            // don't verify server cert
+            curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE);

             curl_exec($c);

当然,您的curl 安装也必须支持 ssl - 检查您的 phpinfo()。此外,如果禁用 CURLOPT_SSL_VERIFYPEERCURLOPT_SSL_VERIFYHOST 可能还需要为 TRUEFALSE

另请参阅 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:

Got no response code when fetching https://www.google.com/accounts/o8/id
CURL error (60): SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

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 via CURLOPT_SSL_VERIFYPEER. the following change in Auth/Yadis/ParanoidHTTPFetcher.php accomplishes latter for me:

--- ParanoidHTTPFetcher.php.orig        2009-04-22 02:31:20.000000000 +0800
+++ ParanoidHTTPFetcher.php     2009-09-30 22:35:24.093750000 +0800
@@ -127,6 +127,9 @@
                         Auth_OpenID_USER_AGENT.' '.$curl_user_agent);
             curl_setopt($c, CURLOPT_TIMEOUT, $off);
             curl_setopt($c, CURLOPT_URL, $url);
+
+            // don't verify server cert
+            curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE);

             curl_exec($c);

of course, your curl installation must also support ssl - check your phpinfo(). also, if CURLOPT_SSL_VERIFYPEER is disabled, CURLOPT_SSL_VERIFYHOST may also need to be TRUE or FALSE.

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?).

红焚 2024-08-12 18:21:47

解决方案:

在 .htaccess 文件中放入

SecFilterEngine Off

SOLUTION:

In the .htaccess file put

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