passport-facebook icon indicating copy to clipboard operation
passport-facebook copied to clipboard

Rerequest special permissions

Open stefanoschrs opened this issue 9 years ago • 7 comments

Hello is there a way to pause the login process until the user has given the special permissions? I have this code that asks the user every time he logs in for the permissions but I want it to not let him continue until he accepts them

    router.get('/auth/facebook',          passport.authenticate('facebook', { 
      authType: 'rerequest', 
      scope: [
        'email', 
        'read_insights'
      ] 
    }));

stefanoschrs avatar Jul 08 '15 15:07 stefanoschrs

AuthType: rerequest doesn't seem to work

vrangasayee avatar Dec 03 '15 12:12 vrangasayee

See this and specifically in the section "Re-asking for Declined Permissions"

This is because once someone has declined a permission, the Login Dialog will not re-ask them for it unless you explicitly tell the dialog you're re-asking for a declined permission.

You do this by adding the auth_type: rerequest flag to your FB.login() call:

mrbatista avatar Feb 26 '16 10:02 mrbatista

app.get('/auth/facebook', passport.authenticate('facebook', { authType: 'rerequest', scope: ['user_friends', 'manage_pages'] }));

rerequest doesnt seem to be working.

Any other solution around this? I can manually redirect user to grant permission page again. But if there is a shortcut, then please let me know.

swapnil002 avatar Aug 24 '16 06:08 swapnil002

rerequest is not working. How do you redirect user to grant permission page again ?

vallettea avatar Feb 10 '17 12:02 vallettea

2017-06 rerequest is not working

wzup avatar Jun 14 '17 07:06 wzup

{authType: 'reauthenticate'} Works for me 👍

WeiChienHsu avatar May 06 '18 22:05 WeiChienHsu

@WeiChienHsu reauthenticate is different from rerequest:

  • rerequest asks the user for permissions again
  • reauthenticate forces the user to enter their password again (see https://developers.facebook.com/docs/facebook-login/reauthentication)

TrevorBurnham avatar Jan 04 '21 23:01 TrevorBurnham