I have a slight problem with user permissions in my Facebook login flow. I am able to ask for permissions only during first login to my App. But problem is if user logged into app remove permission for email address in his Facebook settings. I am not able to get this permission back and i am getting undefined email address. How can i check permissions during loggin a in some cases ask these permissions back ? Can someone help me ? Thank you very much
Asked
Active
Viewed 265 times
1
1 Answers
0
You can use return_scopes
to get the list of authorized permissions in the login process:
FB.login(function(response) {
if (response.authResponse) {
//user just authorized your app
console.log(response);
}
}, {scope: 'email,public_profile', return_scopes: true});
You can get the currently authorized permissions with /me/permissions
: https://developers.facebook.com/docs/graph-api/reference/user/permissions
If you want to re-authorize permissions later, try to use FB.login
with the permissions again. Just use "rerequest":
FB.login(function(response) {
if (response.authResponse) {
//user just authorized your app
console.log(response);
}
}, {scope: 'email,public_profile', auth_type: 'rerequest'});
More information:

andyrandy
- 72,880
- 8
- 113
- 130
-
Maybe i wasnt specifici enough, but i am not able to invoke permissions dialog for mail. User once permitted it but after some time he denied it in FB settings. So now my app is thinking he still got permission and getting undefined email address. I can invoke it for permissions user didnt accept before, – Pogasta Mar 11 '16 at 12:00
-
i added more information and code, take a look at "auth_type", it´s explained in the docs. – andyrandy Mar 11 '16 at 14:16