Passport Strategy: Additional parameters for the authorization request #735
-
As I understand it, in order to always show a login prompt is to include a prompt: 'login' in the authorization request. After checking the source code for the passport implementation // prettier-ignore
/**
* Return extra parameters to be included an authorization request.
*/
authorizationRequestParams<
TOptions extends
passport.AuthenticateOptions = passport.AuthenticateOptions,
>(
// @ts-ignore
req: express.Request, options: TOptions,
): URLSearchParams | Record<string, string> | undefined {
return {}
} Is this currently being worked on? or am I missing something? Exampleapp.get('/login', passport.authenticate(server.hostname, { prompt: 'login' })) Edit: Add example usage |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
It was not currently worked on, no, but I missed that @types/passport and apparently even the passport docs mention Nevertheless, I've updated the strategy in https://github.com/panva/openid-client/releases/tag/v6.1.6 to use the options (scope, prompt, and passReqToCallback). But the intention remains that for anything non-passport you need to overload this method to take effect. |
Beta Was this translation helpful? Give feedback.
It was not currently worked on, no, but I missed that @types/passport and apparently even the passport docs mention
scope
andprompt
which is what lead you to believe it would be handled out of the box, despite that not being the case in e.g. https://github.com/jaredhanson/passport-oauth2Nevertheless, I've updated the strategy in https://github.com/panva/openid-client/releases/tag/v6.1.6 to use the options (scope, prompt, and passReqToCallback). But the intention remains that for anything non-passport you need to overload this method to take effect.