Hybridauth - PHP - Facebook返回无效的用户ID [英] Hybridauth - PHP - Facebook returned an invalid user id

查看:206
本文介绍了Hybridauth - PHP - Facebook返回无效的用户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我从2周前以来就使用了脸书,并没有任何变化,今天早上我发现它不起作用。我试图将Facebook应用程序(id和秘密密钥)切换到另一个也在之前工作的应用程序,但仍然发生相同的情况。我也试图运行与hybridauth一起提供的示例,它们也不工作,所以我知道不是从我身边的配置,也不是从Facebook应用程序配置。



这是什么告诉我,当我尝试登录:



错误!
身份验证失败。用户已取消认证或提供商拒绝连接。



原始错误消息:验证失败!




  • 可以根据与我的服务器相关的某些事情发生吗?

  • Facebook在过去24小时内对API做了任何改变?

  • 任何人都尝试了类似的东西?



更新:
我从一个星期前就开始工作,为了让它工作,我发现其他与之前相同问题的人(不到1个月前),他们修复17天前通过更新Facebook PHP SDK。



以下是GitHub的链接,您可以在其中看到更改以解决此问题:



https://github.com/F21/hybridauth/commit/ 3b115ee3abb5afbf44c37082e63aa8b056bf550c



有了这个,我设法让所有的工作,但现在发生同样的错误,即使这些变化(一个星期之后)。 p>

解决方案

我有一个类似的问题,我相信在我的情况下,我找到了解决方案,也许会帮助别人。 (CURLOPT_CONNECTTIMEOUT)



HybridAuth错误(无效用户)非常通用,基本上它看起来如果卷曲返回的东西,如果没有,给出该错误,但真正的原因不是



我最后做的是下载Facebook php sdk并使用默认示例 https://github.com/facebook/facebook-php-sdk/blob/master/examples/example.php



(将密钥更改为我的应用程序)



在这一点上,我能够看到新的在使用HybridAuth时,以前没有显示的错误消息



PHP致命错误:未捕获CurlException:6:名称查找超时



这指向我这篇文章 http://milkcodes.blogspot.com/2010/12/php-fatal-error-u ncaught-curlexception.html ,它谈到在base_facebook.php中增加CURL的超时时间,我做了和Voila!开始工作。



许多帖子中的基本问题是CURL连接主要负责这些问题(https,超时,nslookup等)。



一个很好的方法来快速找出它是通过保留测试脚本与fb sdk方便调试。



在base_facebook。 php about line 133

  public static $ CURL_OPTS = array(
CURLOPT_CONNECTTIMEOUT => 30,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT =>'facebook-php-3.2',


Well I had hybridauth working and login correctly using facebook since 2 weeks ago, I did not any change and this morning I found that it was not working. I tried to switch the facebook app (id and secret key) to another one which was also working before, but is still happening the same. I also tried to run the examples which comes with hybridauth, and they are not working neither, so i know is not per a configuration from my side, and neither from the facebook app configuration.

This is what is telling me when i try to login:

Error! Authentification failed. The user has canceled the authentication or the provider refused the connection.

Original error message: Authentification failed! Facebook returned an invalide user id.

  • Can be happening per something related with my server?
  • Has facebook done any change on their API during the last 24 hours?
  • Any one has experimented something similar?

UPDATED: I have it working just since 1 week ago, to get it working I found other people with the same problem before (less than 1 month ago), they fixed it 17 days ago by updating the Facebook PHP SDK.

Here is the link to GitHub where you can see the changes to fix this problem:

https://github.com/F21/hybridauth/commit/3b115ee3abb5afbf44c37082e63aa8b056bf550c

With this, I managed to get everything working, but now is happening the same error even with these changes (after one week working).

解决方案

I had a similar problem and I believe in my case I found the solution and maybe it would help someone else. (CURLOPT_CONNECTTIMEOUT)

HybridAuth error (invalid user) is very generic, basically it looks if the curl returns something and if not, gives that error, but the real reason is not visible in the error message.

What I ended up doing is downloading the facebook php sdk and using the default example https://github.com/facebook/facebook-php-sdk/blob/master/examples/example.php

(Changed the keys to my app)

At that point I was able to see new error messages that were not showing before when using HybridAuth

PHP Fatal error: Uncaught CurlException: 6: name lookup timed out

That pointed me to this article http://milkcodes.blogspot.com/2010/12/php-fatal-error-uncaught-curlexception.html that talks about increasing the timeout of CURL in base_facebook.php which I did and Voila! started working again.

The underlying issue in many posts is that CURL connectivity is mostly responsible for these issues (https, timeout, nslookup, etc..)

A good way to quickly figure it out is by keeping a test script with fb sdk handy for debugging.

in base_facebook.php around line 133

public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 30,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 60,
    CURLOPT_USERAGENT      => 'facebook-php-3.2',

这篇关于Hybridauth - PHP - Facebook返回无效的用户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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