HybridAuth Facebook login error: "Invalid Scopes: offline_access, publish_stream, read_friendlists"

Gitesh Purbia picture Gitesh Purbia · May 7, 2015 · Viewed 9.1k times · Source

I am using the HybridAuth library with CodeIgniter Bonfire for adding login functionality with Facebook . I added the library and all related required files into Bonfire.

After clicking on the Login with Facebook button, I am redirected to the Facebook authorization page, but Facebook gives this error:

Invalid Scopes: offline_access, publish_stream, read_friendlists. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions..

How can I solve this?

Answer

Arman H picture Arman H · Jul 3, 2015

To elaborate on @luschn's answer, the permissions which HybridAuth requests from Facebook by default (as of version 2.4.1) are email, user_about_me, user_birthday, user_hometown, user_website, offline_access, read_stream, publish_stream, read_friendlists.

Here's how to remove those depreciated scopes in your HybridAuth config file:

<?php
return
    array(
        'base_url' => 'http://localhost/your/hybridauth/endpoint/index.php',

        'providers' => array (

            'Facebook' => array (
                'enabled' => true,
                'keys'    => array ( 'id' => 'YOUR-APP-ID', 'secret' => 'YOUR-APP-SECRET-TOKEN' ),
                'scope'   => 'email, user_about_me, user_birthday, user_hometown, user_website, read_stream',
                'trustForwarded' => false
            ),
        ),
    );