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
{{ message }}
Repository navigation
[Bug] ScopeAuthorizationHandler only checks first scope claim #1707
Which version of Microsoft Identity Web are you using?
1.23.1
Where is the issue?
Web API
[x ] Protected web APIs (validating tokens)
Is this a new or an existing app?
This is a new app or an experiment.
Context
Using Okta, scopes are separated into multiple claims. Imo, this is the correct representation once parsed and in the claims collection (not space delimited).
When the ScopeAuthorizationHandler runs, it only checks for the first claim. If the first claim is one of the claims listed in the RequiredScope attribute, then the request is authorized. If the first claim is not in the RequiredScope attribute, then it is not authorized.
Expected behavior
All scopes (in all scope claims) should be tested such that, if a scope in any of the claims is listed in the RequiredScope attribute, then the request is authorized; otherwise, it should not be authorized.
Actual behavior
Only the first claim is tested. So, the authorization becomes based on the claim order which is incorrect.
Activity
jennyf19 commentedon Apr 20, 2022
Released in 1.24.0.