strongloop / loopback-example-passport

LoopBack example for facebook login
Other
185 stars 134 forks source link

Available option for google auth: consent/select-account #6

Closed nowherenearithaca closed 7 years ago

nowherenearithaca commented 10 years ago

In the providers.json file, there are some options you can pass down to passport's google auth stuff that can force getting consent again, or showing the account chooser. This might be of interest (it worked for me).

Specifically, you can add a line like this to providers.json for google-login

"authOptions":{"prompt": "args"},

where

args=consent: user will be prompted to allow app whatever permissions are implied by the "scope" parameter, even if they did so the last time they logged in

args=select_account: show the account chooser every time

supposedly, you can combine them, too:

args=select_account+consent

but this didn't work for me: probably because it escaped the "+" maybe you send an array there or something - I'll check the code

In my case, I couldn't figure out why it wasn't prompting me, and it was because I had logged into google in another window, and had logged into only one account.

This may be useful only in early development mode, but maybe there's a use-case where you want to intermittently get their consent again or something.

Reference (this is noted in the passport source code): http://stackoverflow.com/questions/14384354/force-google-account-chooser/14393492#14393492

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.