Facebook permissions scope

Issue #14 closed
Former user created an issue

Hi there, Is there any way to set the permissions scope for Facebook authentication? Right now it takes everything possible by default...I looked inside hybrid auth and in the Facebook provider adapter file I found

// default permissions, and alot of them. You can change them from the configuration by setting the scope to what you want/need
    public $scope = "email, user_about_me, user_birthday, user_hometown, user_website, read_stream, offline_access, publish_stream, read_friendlists";

Is there a way to set this up through anvard?

Comments (3)

  1. Steve Birstok

    Hey, if you still haven't figured this out you can set "scope" from your hybridauth.php config file.

    After publishing the configs with:

    php artisan config:publish atticmedia/anvard
    

    Go to

    app/config/packages/atticmedia/anvard/hybridauth.php
    

    You should see:

    <?php
    return array(
      'providers' => array(
        'Facebook' => array(
          'enabled' => true, 'keys' => array()
        )
      )
    );
    

    Add scope like this:

    <?php
    return array(
      'providers' => array(
        'Facebook' => array(
          'enabled' => true, 'keys' => array(), 'scope' => array('email', 'user_about_me', 'user_birthday', '...')
        )
      )
    );
    

    Hope this helps! :)

  2. Log in to comment