Retrieve Facebook User Details With Using Socialite Laravel
I am using Laravel version 5.4.36 and I am using Laravel Sociallite plugin to connect users with Facebook.
Now, I want to get Logged in user information like birth date gender, Address, mobile number, or any permissions given in this Facebook official document.
I have tried the following code
$facebookScope = [ 'user_birthday', 'user_location', ]; $facebookFields = [ 'name', // Default 'email', // Default 'gender', // Default 'birthday', // I've given permission 'location', // I've given permission ]; return Socialite::driver('facebook')->fields($facebookFields)->scopes($facebookScope)->redirect();
Now when I click on login with the Facebook button it shows error like
Invalid Scopes: user_birthday, user_location. 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
I have tried different scopes like field name = age and scope = user_age_range field name = birthday and scope name = user_birthday for field name = friends and field name = user_friends
Am I doing something wrong? Do I need to change something in the Facebook application that I have created for login?
Ok, turns out this is related to review after all - if only indirectly.
You now need to have your app in “dev” mode, to be able to ask even people with a role in the app for those permissions.
Once you set it “live”, it will show the “invalid scopes” error, even if you are testing with a admin or developer account.
The phrasing of the error message is a bit misleading/unlucky in that regard.
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?