Adapter capabilities

 User authenticationYES
 User profileYES
 User contacts listYES
 User feed newsYES
 Post page wallYES
 Access provider APIYES

Adapter specifications

 ID Facebook
 Protocol OAuth 2
 Keys registeration
 Dev documentation
 Based on Facebook PHP SDK
 Since HybridAuth 1.0.1
 Wrapper ./Hybrid/Providers/Facebook.php
Callback URL


  • PHP 5.4 or greater
  • Composer (optional)


Hybridauth can be installed with Composer. Run this command:

composer require hybridauth/hybridauth

However, there are other ways to install hybridauth library:

  1. If you clone hybridauth library and then run composer install:
    • Composer will download facebook/graph-sdk library and generate a vendor/autoload.php file.
    • Hybridauth will include this file and start using the classes that library provides.
  2. If you clone hybridauth library without composer installation (not recommended):
    • You need to download and put it under /Hybrid/thirdparty/ directory.
    • Make sure that /Hybrid/thirdparty/Facebook/autoload.php exists.
    • Hybridauth will include this file and start using the classes that library provides.

Configuration & Usage

    $config = array(
      "base_url" => "",
      "providers" => array (
        "Facebook" => array (
          "enabled" => true,
          "keys"    => array ( "id" => "PUT_YOURS_HERE", "secret" => "PUT_YOURS_HERE" ),
          "scope"   => ['email', 'user_about_me', 'user_birthday', 'user_hometown'], // optional
          "photo_size" => 200, // optional

    require_once( "/path/to/hybridauth/Hybrid/Auth.php" );

    $hybridauth = new Hybrid_Auth( $config );

    $adapter = $hybridauth->authenticate( "Facebook" );

    $user_profile = $adapter->getUserProfile();

For Facebook you can configure several extra options:

  • scope: An array (or comma-separated list) of permissions you want to request from the user. See the Facebook docs for a full list of available permissions: .
    Default: scope = email, public_profile
  • photo_size: The width and height of user picture in pixels. Default: photo_size = 150

Registering application

  1. Go to and create a new application by clicking "Create New App".
  2. Fill out any required fields such as the application name and description.
  3. Put your website domain in the Site Url field.
  4. Once you have registered, copy and past the created application credentials (App ID and Secret) into the HybridAuth config file.
  5. You also need to add a valid Oauth redirect URI ( This should be the social login callback url of your website (ie. NOTE: The underscore (_) in the callback url. Other HybridAuth callbacks use 'hauth.done', but the Oauth client in the Facebook SDK doesn't accept this.