miled / wordpress-social-login

WordPress Social Login
http://miled.github.io/wordpress-social-login/
MIT License
401 stars 233 forks source link

Problem with Social Login to Facebook #265

Closed Bigspecialk closed 4 years ago

Bigspecialk commented 6 years ago

In trying to setup Facebook login I get the below message.

Invalid Scopes: user_friends. 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

It appears there is an issue in asking for the user_friends.

Any ideas on how to fix?

GrandmasterGrogu commented 6 years ago

Yeah, the problem is the plugin is ignoring the contacts import is disabled and sending the request for user’s friends anyway. So the solution is to either use the contacts feature and get the permission for your app on facebook, or for someone to add the logic to the code.

GrandmasterGrogu commented 6 years ago

Specifically, user_friends should probably be removed here I am guessing, and then added in only if the user enabled the contacts feature.

https://github.com/miled/wordpress-social-login/blob/9c5987a661d88ac44dde70285dfc87b8b9594d63/hybridauth/library/src/Provider/Facebook.php#L45

Bigspecialk commented 6 years ago

Thank you for the help. I tried looking for that file in the Plugin and couldn't find it to edit. Do you know if it would be called something else?

pacificip commented 6 years ago

+1

s3w47m88 commented 6 years ago

+1 The Plugin is unusable without this issue being resolved.

marcelomoreira1973 commented 6 years ago

There is a filter to fix this. wsl_hook_alter_provider_scope

Example add_filter( 'wsl_hook_alter_provider_scope', 'virtus_wsl_hook_alter_provider_scope', 10, 2 );

function virtus_wsl_hook_alter_provider_scope( $provider_scope, $provider ) { if ( $provider == 'Facebook' ) { $provider_scope_new = str_replace( ', user_friends', '', $provider_scope ); return $provider_scope_new;
} return $provider_scope; }

sarvarkhuja commented 5 years ago

As @alexxgathp said " user_friends " should be removed. but the directory was changed you can find it in wsl.providers.php:line 46 in the directory wordpress-social-login\wordpress-social-login\includes\settings "default_api_scope" => "email, public_profile, user_friends",

plugin version is 2.3.3

omerdes commented 4 years ago

delete " , public_profile, user_friends","