Support scope as an array #385
balazsorban44
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Feel free to propose a PR, the only correct way is to
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you for this awesome library!
Currently, the
scope
inAuthorizatinoParameters
can only be of typestring
.https://github.com/panva/node-openid-client/blob/772306cc82b72ace9361f4a945249a5c35a8f921/types/index.d.ts#L138
This is merely a suggestion, but since the
claims
property has also special handling, I was wondering if we could make an exception forscope
as well since it is an often-used parameter.Related: nextauthjs/next-auth#2511 (comment)
I am happy to open a PR implementing this if the author approves of the idea!
Relevant code is probably here:
https://github.com/panva/node-openid-client/blob/772306cc82b72ace9361f4a945249a5c35a8f921/lib/client.js#L84-L86
I have seen scopes being sent with separators like
,
+
,,
.node-oauth
usesquerystring.stringify()
:https://github.com/ciaranj/node-oauth/blob/a7f8a1e21c362eb4ed2039431fb9ac2ae749f26a/lib/oauth2.js#L174
, which produces something like this:
?scope=openid&scope=email
new URLSearchParams({scope: ["openid", "email"]})
produces,
.Is there any consequence to choose any concatenating over the other? Is this something that can be interpreted differently from Provider to Provider and so that is the reason scope as an array isn't supported?
Beta Was this translation helpful? Give feedback.
All reactions