Skip to content

Cannot understand the AllowedScopes options #1739

Answered by ggnaegi
andreuwz asked this question in Q&A
Discussion options

You must be logged in to vote

@andreuwz As far as I understand it, the second example is giving you the expected result, since the test scope isn't included in the token's scopes.
https://github.com/ThreeMammals/Ocelot/blob/develop/src/Ocelot/Authorization/ScopesAuthorizer.cs

 if (!matchesScopes.Any())
            {
                return new ErrorResponse<bool>(
                    new ScopeNotAuthorizedError($"no one user scope: '{string.Join(',', userScopes)}' match with some allowed scope: '{string.Join(',', routeAllowedScopes)}'"));
            }

as for the first example, the error must be somewhere else, since you have some matching scopes (by the way it's an interesting debate: #231)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by raman-m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Initially seen a question could become a new feature or bug or closed ;)
2 participants
Converted from issue

This discussion was converted from issue #1619 on October 17, 2023 19:17.