6

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?

Arman H
  • 5,488
  • 10
  • 51
  • 76
Gitesh Purbia
  • 1,094
  • 1
  • 12
  • 26

4 Answers4

8

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
            ),
        ),
    );
Arman H
  • 5,488
  • 10
  • 51
  • 76
5

All those scopes/permissions are deprecated since years - which is exactly what the error message tells you, they just don´t exist. You need to check out the Facebook docs to find out which permissions exactly you need. The API Reference is a good place to find out.

andyrandy
  • 72,880
  • 8
  • 113
  • 130
2

current answer of @Arman H would not work, IF YOU DEFINE email in scope you will receive public profile and email adress

<?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',
                'trustForwarded' => false
            ),
        ),
    ); 
edgarmtze
  • 24,683
  • 80
  • 235
  • 386
  • I believe you receive the public profile no matter what you request. Were you trying to NOT get the public profile? – Arman H Oct 21 '15 at 00:32
1

simply goto app advance settings and upgrade your app version, it should be at least 2.7

enter image description here

Ilya Yaremchuk
  • 2,007
  • 2
  • 19
  • 36
M Ismail
  • 43
  • 1
  • 9