I use :

  1. hybridauth 7.x-2.x-dev
  2. hybridauth Libraries 2.9.6 at https://github.com/hybridauth/hybridauth/releases
  3. Download HybridAuth library and unpack it into "sites/all/libraries/hybridauth" folder; for recent library versions you also need to install composer dependencies - either execute composer install in the library directory or use composer dependency management approach suitable for your project
  4. To Goolge: You must enable (or re-enable for some users) Google Google+ API, Contacts API , create OAuth 2.0 client ID. You must set Authorized Redirect URIs to http://your-domain/hybridauth/endpoint?hauth.done=Google
    You must set Authorized JavaScript Origins to http://your-domain
  5. To Facebook: Go to https://developers.facebook.com/apps, create App (if not exist). You Must Add Product, and choose Facebook Login for Website Platform to set Callback URL to http://your-domain/hybridauth/endpoint?hauth_done=Facebook.
  6. On tab Other settings on http://your-domain/admin/config/people/hybridauth: You must Choose: "Don't allow duplicate email addresses, add new identity to the existing account and login" for login with existing user (if not, you will get Error message: 'You are trying to login with email address of another user.')
  7. Edit function hybridauth_get_config line 894, file hybridauth.module
    function hybridauth_get_config() {
    ...
     $config = array(
                'base_url' => url('hybridauth/endpoint', array('absolute' => TRUE, 'language' => _hybridauth_language_default())),
                'providers' => array(),
                'debug_mode' => $hybridauth_debug,
                'debug_file' => $logfile,
            );
    // Adding codes for Google & Facebook Login
    + if (stripos($_GET['q'], 'hybridauth/window/') !== FALSE) {
    +           $config['base_url'] = url('hybridauth/endpoint', array('absolute' => TRUE));
    +       }
    
            if ($proxy = variable_get('hybridauth_proxy', NULL)) {
                $config['proxy'] = $proxy;
            }
    ....
    }
    

Comments

trong.nguyen.tcec created an issue.

fgvlasov’s picture

Hello, in my website i've done form login for Google and VK but i have a big problem with Facebook. There is a mistake from logs:

Warning: file_exists(): open_basedir restriction in effect. File(/var/www/user_busy/vendor/autoload.php) is not within the allowed path(s): (/var/www/user_busy/data:.) в функции Hybrid_Provider_Model->autoLoaderInit() (строка 150 в файле /var/www/user_busy/data/www/busy-project.com/sites/all/libraries/hybridauth/hybridauth/Hybrid/Provider_Model.php).

in function autoLoaderInit() , which Require autoload.php for 3rd party libraries. I don`t see anywhere in library this file: autoload.php

Callback URL: https://mysite/hybridauth/endpoint?hauth.done=Facebook is working.

I have last Hybridauth Libraries 2.16.0