You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
The strategy delivered by openid-client does not have access to all params such as userinfo-object because the library openid-client does a check on the number of parameters sent into the callback function. Because the callback function uses destructuring of the params, the number of parameters equals 0 and thus the userinfo-object of openid-client is not appended in the parameters. This is very unexpected behavior, as it "works" when putting the verify function directly in the constructor super call where the parameters are declared separately (tokenset, userinfo, done) => {}. This is unwanted as I would really like to stay idiomatic and use the framework as it is meant to be used.
Expected behavior
Ideally, I would be able to declare the params (tokenset, userinfo) in the validate function, as I am trying to do, and still have the openid-client correctly interpret the correct amount of parameters.
Minimal reproduction of the problem with instructions
In the below screenshot we see the check that adds the userinfo object if the length of the parameters of the verify/validate function is large enough. In our case when using the Nest PassportStrategy validate function, the destructuring of params results in this._verify.length // => 0.
Here the destructuring happens:
What is the motivation / use case for changing the behavior?
PassportModule should be able to support openid-client (OpenID Connect) which covers strategies for a wide range of IdPs such as Okta and OneLogin.
Environment
Nest version: 6.10.1
The text was updated successfully, but these errors were encountered:
The only thing I can suggest is to simply copy & paste the passport.strategy.ts file into your project and adjust the callback call to your requirements. There are tons of various passport strategies and adapting all of them with one class is simply impossible (not enough flexible).
I'm submitting a...
Current behavior
The strategy delivered by
openid-client
does not have access to all params such asuserinfo
-object because the libraryopenid-client
does a check on the number of parameters sent into the callback function. Because the callback function uses destructuring of the params, the number of parameters equals 0 and thus theuserinfo
-object ofopenid-client
is not appended in the parameters. This is very unexpected behavior, as it "works" when putting the verify function directly in the constructor super call where the parameters are declared separately(tokenset, userinfo, done) => {}
. This is unwanted as I would really like to stay idiomatic and use the framework as it is meant to be used.Expected behavior
Ideally, I would be able to declare the params (tokenset, userinfo) in the validate function, as I am trying to do, and still have the
openid-client
correctly interpret the correct amount of parameters.Minimal reproduction of the problem with instructions
In the below screenshot we see the check that adds the userinfo object if the length of the parameters of the verify/validate function is large enough. In our case when using the Nest PassportStrategy validate function, the destructuring of params results in
this._verify.length // => 0
.Here the destructuring happens:
What is the motivation / use case for changing the behavior?
PassportModule should be able to support
openid-client
(OpenID Connect) which covers strategies for a wide range of IdPs such as Okta and OneLogin.Environment
The text was updated successfully, but these errors were encountered: