3
votes

I installed drupal 7 hybridauth https://www.drupal.org/project/hybridauth. I configured the module for Google, Facebook, Twitter and LinkedIn. They are working well except Google. According to the HybridAuth Module instruction I went to https://code.google.com/apis/console#access. Then I created application using "Create new Client Id" button and set all information that I did for others social login.

After that I tried to login using the google auth link but they shows an error "There was an error processing your request!". I was googling more time. But I can't fix that.

Then I went to see my drupal site's logs. I found the following error message -

Location: DOMAIN-COM/drupalsocialauth/hybridauth/window/Google?destination=node&destination_error=node

Message: Exception: User profile request failed! Google returned an invalid response. in** Hybrid_Providers_Google->getUserProfile() (line 87 of /home/pydream/public_html/drupalsocialauth/sites/all/libraries/hybridauth/hybridauth/Hybrid/Providers/Google.php).

Can you help me to fix it?

Thanks for you time.

3

3 Answers

3
votes

I resolved this thanks to the last comment here: https://groups.google.com/forum/#!topic/hybridauth/dNSUDyWpc5w

Under Your projects at https://code.google.com/apis/console#access

APIs & auth->APIs Enable: Contacts API and Google+ API

and

APIs & auth->Consent Screen Make sure to complete the consent screen and save

Link: https://www.drupal.org/node/2339085#comment-9152359

0
votes

In my situation was not variable hybridauth_provider_Google_scope in variable table. I executed command:

drush vset hybridauth_provider_Google_scope "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"

and now Google auth works properly.

P.S. May be with drush vset hybridauth_provider_Google_scope "https://www.googleapis.com/auth/plus.profile.emails.read" also will work properly. I did not inspect this variant.

0
votes

Try to comment in this file:

/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php

The line:

// curl_setopt($ch, CURLOPT_USERAGENT      , $this->curl_useragent );