-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
TypeError: Cannot read property 'includes' of undefined #312
Comments
Either specify a configuration value for usePKCE, which when not provided tries to default get enabled based on the response_type. But response_type is only only "resolved" when there's a single one. So, either just
Either way you'll have to be providing it at authenticate time... I think the fix here is resolving usePKCE at request time, in which case it would throw for you at that time if you didn't specify a concrete response type. Not sure when i'll get to this, seems not that critical as there are clear ways for you to move forward. |
Thanks for the quick response. There's absolutely no pressure on my end, I am just poking around a little. I've done OpenID before, but not in as detailed a fashion and never with this library, so many of the terms are new to me. I'm really just reporting as the behaviour seemed somewhat incorrect, I'm not blocked in any way, feel free to close. |
Fixed in v4.2.2 Please consider supporting the library if it provides value to you or your company and this support was of help to you. Supporting the library means, amongst other things, that such support will be available in the future. |
Describe the bug
To Reproduce
Initialise a Passport.js Strategy using
openid-client
.When creating the new Client, include more than one response type in
response_types
When creating the new Strategy, do not specify
response_type
inoptions.params
, or specify no options.Expected behaviour
No TypeError.
Environment:
Additional context
Seems to be due to the code in
resolveResponseType()
inlib/helpers/client.js
. If there is more than one code inresponse_types
, it returnsundefined
. The same is true ofresolveRedirectUri()
.passport_strategy.js
seems to wantthis._params.response_type
to be an array, since it is calling.includes()
everywhere. Or perhaps it is by design that it is using the string method.includes()
? This would seem strange to me. Or perhaps I should never be adding additionalresponse_types
in Client metadata without specifyingresponse_type
inparams
when constructing a new Strategy, which would avoid the call to resolve the response type from the client ?The text was updated successfully, but these errors were encountered: