-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Passing user specified parameter to authorizationParams() #81
Comments
I just realized I could do this instead
Is there any side effect from Javascript closure? |
+1 for a way to allow arbitrary parameters in the authorisation URL. For instance, if What @soichih suggests with |
Agreed, and there is also the claims parameter which doesn't seem to be supported at the moment. The most convenient way to support it would be giving it as an option like you do with |
A workaround here is to directly pass any custom params into the authorization URL. These will be merged into the authorization URL this package generates: passport-oauth2/lib/strategy.js Lines 229 to 230 in a02839a
|
In a case you even cannot pass data as @soichih sugests, you can access the request object using this ugly nasty never-use-that way: passportOAuth.Strategy.prototype.authorizationParams = function() {
const req = passportOAuth.Strategy.prototype.authorizationParams.caller.arguments[0];
// do whatever you need
} I will create a pull request to avoid this ugly hack, hope it will be merged soon. |
Hello.
My oauth2 provider handles multiple idP(s), and I can specify which one to use by setting "selected_idp" parameter to authorize URL
I see that I can add arbitrary parameters to authorize URL by overriding authorizationParams() function, but this function doesn't allow accessing user request parameter.
Can you add an additional option parameter to authenticate() so that I could do something like
??
The text was updated successfully, but these errors were encountered: