google connect does not work together with facebook connect
« on: January 28, 2018, 06:07:18 PM »
Hello all,

I firstly managed to configure google connect plugin. Facebook was still crashing at that time, the free facebook connect plugin from market.osclass.
Then I did some modifications on OSCFacebook.php and updated to the latest php sdk by running "php composer require facebook/graph-sdk"
Thus, I managed to get Facebook connect working just great. It even found my existing osclass account matching with the FB mail and it linked both FB and osclass acoounts into one. So far so good.

However, once I got facebook to work fine, suddenly google started crashing and crashing!

It first redirects to google page where user is being asked to enter gmail account credentials. Once the google credentials are entered, it throws:

"Facebook SDK returned an error: Cross-site request forgery validation failed. Required GET param "state" missing."


Sometimes, not always, I get the following google connect error in /var/log/apache/error.log:


Code: [Select]
PHP Fatal error: 
Uncaught Google_AuthException: Error fetching OAuth2 access token,
message: 'invalid_grant' in /var/www/html/muzikalnik.com/oc-content/plugins/google_connect/src/auth/Google_OAuth2.php:113
Stack trace:
 /var/www/html/muzikalnik.com/oc-content/plugins/google_connect/src/Google_Client.php(131):Google_OAuth2->authenticate(Array, 'AQBeE855xmTuMMn...')
 /var/www/html/muzikalnik.com/oc-content/plugins/google_connect/connect.php(44): Google_Client->authenticate('AQBeE855xmTuMMn...')
 /var/www/html/muzikalnik.com/oc-content/plugins/google_connect/functions.php(3): include('/var/www/html/m...')
 /var/www/html/muzikalnik.com/oc-content/themes/veronika/header.php(90): gc_login_button()
 /var/www/html/muzikalnik.com/oc-includes/osclass/helpers/hDefines.php(238): require('/var/www/html/m...')
 /var/www/html/muzikalnik.com/oc-content/themes/veronika/main.php(8): osc_current_web_theme_path('header.php')
 /var/www/html/muzikalnik.com/oc-includes/osclass/helpers/hDefines.php(238): require('/var/www/html/m...')
in /var/www/html/muzikalnik.com/oc-content/plugins/google_connect/src/auth/Google_OAuth2.php on line 113, referer: https://muzikalnik.com/user/register

It seems to me like both plugins are somehow sharing the same access token/id and thus one redirects to another.
And vice versa. While google connect was working fine, facebook connect was always redirecting to google.

In summary I don't seem to manage to get both plugins working together, but just one while the other is turned off.



Any ideas would be highly appreciated.


Thank you
« Last Edit: March 27, 2018, 10:04:39 AM by Lyubomir Minchev »

*

MB Themes

Re: google connect does not work together with facebook connect
« Reply #1 on: January 29, 2018, 04:25:03 PM »
@Lyubomir
Your facebook plugin thinks that google request is sent to facebook, so it's bugged.
Try to use our free Facebook Login Plugin.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: google connect does not work together with facebook connect
« Reply #2 on: January 29, 2018, 10:50:23 PM »
Great thanks!

I guess this plugin has been just published today. I could not find it before.

Now both plugins works well together !


Thank you!

*

MB Themes

Re: google connect does not work together with facebook connect
« Reply #3 on: January 29, 2018, 11:09:23 PM »
Cool, leave feedback on it  8)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots