Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force login via ?prompt=login query string #16

Open
martinlaukkanen opened this issue Sep 12, 2016 · 5 comments
Open

Force login via ?prompt=login query string #16

martinlaukkanen opened this issue Sep 12, 2016 · 5 comments

Comments

@martinlaukkanen
Copy link

martinlaukkanen commented Sep 12, 2016

Hi,

How can I inject options that will force login on each authentication attempt?

Manually you would just append: ?prompt=login to the url.

E.g.:
https://login.live.com/oauth20_authorize.srf?response_type=code&redirect_uri=[.....]&prompt=login

But passing that to the 'authorizationURL' option results in a malformed URL as the prompt query string param is malformed; e.g.: https://login.live.com/oauth20_authorize.srf?prompt=login?response_type=code&redirect_uri=[...]

I can see exactly what it's doing (string concatenation) but can't see where in the code?

Thanks,

martinlaukkanen added a commit to martinlaukkanen/passport-windowslive that referenced this issue Oct 1, 2016
In order to enable forced login prompting parameter, e.g.: &prompt=login, see Issue jaredhanson#16.
@martinlaukkanen
Copy link
Author

Okay a bit of learning on my side, and I've added this functionality in the above pull request, can be used to force login as follows:

app.get('/auth/windowslive',
passport.authenticate('windowslive', { scope: ['wl.signin', 'wl.basic'], prompt: 'login' }));

@vhmth
Copy link

vhmth commented Aug 22, 2017

Hey @martinlaukkanen can you link to where that value for prompt is documented? Looking here, it seems like the valid values don't include login:

https://stackoverflow.com/a/14393492/696130

@vhmth
Copy link

vhmth commented Aug 22, 2017

It seems like I can't force the selection no matter what. I think authorizationParams needs to be implemented here.

@martinlaukkanen
Copy link
Author

Hi, not sure where I originally found that for the above pull request, but a quick look at the MS documentation and they list a few parameters not detailed in the stackoverflow link above:

https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code

That document refers to the new MS Auth endpoints and not necessarily the old Live/Passport endpoints, but that option works for both in my tests.

@vhmth
Copy link

vhmth commented Aug 25, 2017

Ah thanks @martinlaukkanen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants