1
votes

I'm using the HybridAuth module in Drupal to provide facebook and google single-sign-on with Drupal.

The Google SSO sign on works just fine but the Facebook SSO results in the following error:

Fatal error: Class 'Facebook\Facebook' not found in /var/www/mydrupalsite/sites/all/libraries/hybridauth/hybridauth/Hybrid/Providers/Facebook.php on line 56

The code causing the problem is as follows:

use Facebook\Exceptions\FacebookSDKException;
use Facebook\Facebook as FacebookSDK;
.
.
.
$this->api = new FacebookSDK([
        'app_id' => $this->config["keys"]["id"],
        'app_secret' => $this->config["keys"]["secret"],
        'default_graph_version' => 'v2.8',
        'trustForwarded' => $trustForwarded,
]);

$this->api = new FacebookSDK... is line 56

I have the following structure under my libraries directory:

├── hybridauth
│   ├── additional-providers
│   │   ├── hybridauth-500px
│   │   │   └── Providers
│   │   ├── hybridauth-amazon
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-beatsmusic
│   │   │   └── Providers
│   │   ├── hybridauth-bitbucket
│   │   │   └── Providers
│   │   ├── hybridauth-citrix
│   │   │   └── Providers
│   │   ├── hybridauth-Dataporten
│   │   │   └── Providers
│   │   ├── hybridauth-deezer
│   │   │   └── Providers
│   │   ├── hybridauth-digitalocean
│   │   │   └── Providers
│   │   ├── hybridauth-disqus
│   │   │   └── Providers
│   │   ├── hybridauth-draugiem
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-dribbble
│   │   │   └── Providers
│   │   ├── hybridauth-dropbox
│   │   │   └── Providers
│   │   ├── hybridauth-drupaloauth2
│   │   │   └── Providers
│   │   ├── hybridauth-freeagent
│   │   │   └── Providers
│   │   ├── hybridauth-github
│   │   │   └── Providers
│   │   ├── hybridauth-gitlab
│   │   │   └── Providers
│   │   ├── hybridauth-goodreads
│   │   │   └── Providers
│   │   ├── hybridauth-google-openid
│   │   │   └── Providers
│   │   ├── hybridauth-humanitarianid
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-Identica
│   │   │   └── Providers
│   │   ├── hybridauth-instagram
│   │   │   └── Providers
│   │   ├── hybridauth-lastfm
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-latch
│   │   │   └── Providers
│   │   ├── hybridauth-mailchimp
│   │   │   └── Providers
│   │   ├── hybridauth-mailru
│   │   │   └── Providers
│   │   ├── hybridauth-mixcloud
│   │   │   └── Providers
│   │   ├── hybridauth-murmur
│   │   │   └── Providers
│   │   ├── hybridauth-odnoklassniki
│   │   │   └── Providers
│   │   ├── hybridauth-paypal
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-paypal-openid
│   │   │   └── Providers
│   │   ├── hybridauth-pinterest
│   │   │   └── Providers
│   │   ├── hybridauth-pixelpin
│   │   │   └── Providers
│   │   ├── hybridauth-pixnet
│   │   │   └── Providers
│   │   ├── hybridauth-plurk
│   │   │   └── Providers
│   │   ├── hybridauth-qq
│   │   │   └── Providers
│   │   ├── hybridauth-rdio
│   │   │   └── Providers
│   │   ├── hybridauth-rhapsody
│   │   │   └── Providers
│   │   ├── hybridauth-sina
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-skyrock
│   │   │   └── Providers
│   │   ├── hybridauth-slack
│   │   │   └── Providers
│   │   ├── hybridauth-soundcloud
│   │   │   └── Providers
│   │   ├── hybridauth-stackexchange
│   │   │   └── Providers
│   │   ├── hybridauth-steam
│   │   │   └── Providers
│   │   ├── hybridauth-strava
│   │   │   └── Providers
│   │   ├── hybridauth-tumblr
│   │   │   └── Providers
│   │   ├── hybridauth-twitchtv
│   │   │   └── Providers
│   │   ├── hybridauth-vimeo
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-vkontakte
│   │   │   └── Providers
│   │   ├── hybridauth-wargaming
│   │   │   └── Providers
│   │   ├── hybridauth-weibo
│   │   │   └── Providers
│   │   ├── hybridauth-wordpress
│   │   │   └── Providers
│   │   ├── hybridauth-xing
│   │   │   └── Providers
│   │   ├── hybridauth-xuite
│   │   │   └── Providers
│   │   ├── hybridauth-yahoo-openid
│   │   │   └── Providers
│   │   ├── hybridauth-yammer
│   │   │   ├── Providers
│   │   │   └── thirdparty
│   │   ├── hybridauth-yandex
│   │   │   └── Providers
│   │   └── Install.html
│   ├── CHANGELOG
│   ├── composer.json
│   ├── contributing.md
│   ├── hybridauth
│   │   ├── config.php
│   │   ├── Hybrid
│   │   │   ├── Auth.php
│   │   │   ├── Endpoint.php
│   │   │   ├── Error.php
│   │   │   ├── Exception.php
│   │   │   ├── index.html
│   │   │   ├── Logger.php
│   │   │   ├── Provider_Adapter.php
│   │   │   ├── Provider_Model_OAuth1.php
│   │   │   ├── Provider_Model_OAuth2.php
│   │   │   ├── Provider_Model_OpenID.php
│   │   │   ├── Provider_Model.php
│   │   │   ├── Providers
│   │   │   ├── resources
│   │   │   ├── StorageInterface.php
│   │   │   ├── Storage.php
│   │   │   ├── thirdparty
│   │   │   ├── User_Activity.php
│   │   │   ├── User_Contact.php
│   │   │   ├── User.php
│   │   │   └── User_Profile.php
│   │   ├── index.php
│   │   └── live.php
│   └── README.md
└── README.txt

My PHP knowledge is a bit sketchy here and I don't know how to resolve this.

1
I am experiencing the same issue. What PHP version are you using? - W.M.

1 Answers

0
votes

As a temporary solution you can downgrade to Hybridauth v2.7.0 . The issue you're facing is related to an issue in latest release.