Matching scope claims #39
Replies: 3 comments 5 replies
-
you're referring to a spec item that defines how the client can request multiple scopes in an authorization request using url-encoded parameters; that is different from the server passing back granted scopes in a JWT token; in fact for the latter, there is no formal definition but since we are dealing with multiple values in a JWT, the obvious thing to do is pass them back in an array; in your setup, the space delimited value right now is treated as a single string value (with a space); if you can make your server pass back scope values in an array, you can inspect the individual scope values |
Beta Was this translation helpful? Give feedback.
-
Hi. Thanks for the quick response. Indeed, that section of the RFC does refer to the client request, however it is also referenced in the response (Section 5.1)
I'm using Auth0, and it returns multiple scopes as a single space separated string, which I think matches the above. rfc7662 also specifies the token introspection response which includes:
I also found an example in rfc7662 which matches the above format
Of course, I could be reading these wrong. But to me it looks like the scope should be a single string, with multiple scopes separated by space. Matt |
Beta Was this translation helpful? Give feedback.
-
OK. I don't think that will be practical for me. I will look for an alternative solution to handle the scope validation. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm using mod_oauth2 and am having trouble validating the scope from a JWT.
I have a JWT with the following scope claim:
"scope": "scopeA scopeB",
If I have the following config in my apache.conf, the request passes authorization:
Require oauth2_claim "scope:scopeA scopeB"
And I see the following entries in the log (with debug turned on)
But, if I only require one of the scopes:
Require oauth2_claim "scope:scopeA"
it fails authorization
Similarly, if I swap the order of the required scopes
Require oauth2_claim "scope:scopeB scopeA"
authorization also fails.
I'm using mod_oauth2.x86_64 3.2.3-1.el8
Looking at https://www.rfc-editor.org/rfc/rfc6749#section-3.3 it says:
Am I missing something? I thought that all of these configurations should pass authorization.
Thanks
Matt
Beta Was this translation helpful? Give feedback.
All reactions