I’ve got everything installed (the module, HybridAuth library and colorbox) and setup and Twitter is working great to authenticate users. After setting up Facebook and trying to login I get the error “There was an error processing your request“ and the message in my log says “Exception: Authentification failed! Facebook returned an invalide user id. in Hybrid_Auth::initialize() (line 156 of /home/fillmore/public_html/dev/sites/all/libraries/hybridauth/Hybrid/Auth.php).”
I traced my steps setting up the Facebook app and the module’s Facebook settings and everything looks correct. Is there anything else I need to do beyond setting up the Facebook app and entering the necessary information into the HybridAuth Facebook setup screen? I've never created a Facebook app before and the only part of the process that I was unsure about was the Hosting URL: https://frozen-sands-1400.herokuapp.com/ Is it ok to use "heroku" as the app hosting provider? Facebook doesn't seem to give me any other choice.
My internet search "hybridauth Facebook returned an invalide user id" led me here https://developers.facebook.com/docs/howtos/login/getting-started/ so I added the code to my html file but it had no effect.
Thank you for your help and thanks for this great module!
Scott
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | report_error.JPG | 48.99 KB | zakmail007 |
| facebook-app.jpg | 102.53 KB | Sc0tt | |
| drupal-hybridauth.jpg | 78.67 KB | Sc0tt |
Comments
Comment #1
duozerskScott,
After doing dome research on your issue it appears that it is in the HybridAuth library itself, not in the Drupal module code.
https://groups.google.com/forum/#!topic/hybridauth/R2rfDe_6O2c
It was fixed on GitHub and there are pull requests to the main library code:
https://github.com/hybridauth/hybridauth/pull/41
https://github.com/hybridauth/hybridauth/pull/70
From comments it looks like you just need to replace the files in hybridauth\Hybrid\thirdparty\Facebook with the latest Facebook SDK files.
Hope it helps.
Thanks
AndyB
Comment #2
duozerskSo to fix this issue you need to download https://github.com/dorongutman/hybridauth/archive/master.zip and then replace these 4 files:
sites\all\libraries\hybridauth\hybridauth\Hybrid\Providers\Facebook.php
sites\all\libraries\hybridauth\hybridauth\Hybrid\thirdparty\Facebook\base_facebook.php
sites\all\libraries\hybridauth\hybridauth\Hybrid\thirdparty\Facebook\facebook.php
sites\all\libraries\hybridauth\hybridauth\Hybrid\thirdparty\Facebook\fb_ca_chain_bundle.crt
Thanks
AndyB
Comment #3
kvhdude commentedJust want to note that i am also seeing the same issue (even after updating hybridauth library to latest (Feb 9 2013).
Exception: Authentication failed! Facebook returned an invalid user id. in Hybrid_Auth::initialize() (line 147 ..... apps/drupal/htdocs/sites/all/libraries/hybridauth/hybridauth/Hybrid/Auth.php)
thanks
/jerry
Comment #4
kvhdude commentedSorry for reviving this closed thread. It appears my issue was caused by the associated FB app inadvertently marked to be in sandbox mode. posting here so it might help others.
/jerry
Comment #5
duozerskJerry,
Thanks for the update!
AndyB
Comment #6
jooplaan commentedSorry to open this issue (again). I get the same error:
"Exception: Authentication failed! Facebook returned an invalid user id. in Hybrid_Auth::initialize() (line 147"
Steps to reproduce:
Now open another tab, go to Facebook and log out. Then close the tab and try to log in on the website using the HybridAuth module. It works!
So I only get the error, when I am already logged into Facebook. I am using the latest version of the HybridAuth library.
Any idea's how to fix this?
Comment #7
duozerskJoop,
Can you please try to reproduce this behavior on the demo site? http://andrewberezovsky.ru/demo/hybridauth7/
Cause if it works fine on the demo site - then something is wrong on your site installation, and not in the module code. We need to figure out where the issue comes from.
Thanks
AndyB
Comment #8
jooplaan commentedThanks. On the demo website it seems not a problem to login when I am already logged in to Facebook. So the problem seems on my side. Any pointers how to debug this? I tried disabling the modules I installed after Hybrid_Auth, but the problem remains the same.
Comment #9
duozerskJoop,
First of all, get the latest 7.x-2.x-dev release and see if the issue is present with it.
Thanks
AndyB
Comment #10
jooplaan commentedUsing the latest 7.x-2.x-dev release and the latest HybridAuth library the problem was solved.
Thanks!
Comment #11
duozerskThen closed (fixed).
Comment #12
ajaynimbolkar commentedHi
Can any one help me with this issue of
"Authentication failed! Facebook returned an invalid user id." in drupal 6 website
I am using
HybridAuth 6*2.0 module as well as downloaded latest HybridAuth library from git hub version as hybridauth-2.2.2.
I have also created application id and secreate key of the Facebook and this application not in sandbox.
please suggest what was wrong
Looking help....
Thanks,
Ajay
Comment #13
Vultures commentedLooks like it's not a HybridAuth issue.
We fixed the same issue on our side by modifying FB library from github.
If anyone has a better idea of how to fix this issue, don't hesitate to post it here :)
Comment #14
ajaynimbolkar commentedHi Vultures,
I have try solution provide by you #13 but it was not working,Could you please provide your library in zip or some location where i can download and check the same.
As well as provide version of hybrid library your using.
looking for help.
Thanks,
Ajay
Comment #15
arun ak commentedHi,
I am also facing the same issue. But in my case this issue happening only when I move the functionality in to the server.
In my local everything is working fine.
Looking help....
Thanks
Comment #16
ajaynimbolkar commentedHi Arun,
Could you please provide me version of module as well as version of library you using?
Or you can also provide me link.
Thanks,
Ajay
Comment #17
zakmail007 commentedI am facing the same issue please see attached image. I tried above solutions but still not working.
I am working on localhost using WAMP server. its very urgent for me.
Comment #18
tomtech commentedI just encountered this issue.
I tried some of the solutions posted here and elsewhere, though I skipped some as too insecure.
For me the issue was this:
1) I specified a whitelist IP address in IPv4 format.
2) the server was talking to Facebook over IPv6.
IPv4 <> IPv6
The solution for me was to add the IPv6 address to the whitelist.
After that, the issue was resolved in my case.
Comment #19
zeroduh commentedMaybe this helps: https://www.drupal.org/node/2614912#comment-10745384
Comment #20
anybodyIf you should run into these problems please see and comment #2684015: Authentication failed! Facebook returned an invalid user id