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
papugamichal opened this issue
Nov 28, 2019
· 1 comment
· May be fixed by #1478
Assignees
Labels
acceptedBug or feature would be accepted as a PR or is being worked onbugIdentified as a potential bugproposalProposal for a new functionality in OcelotWinter'25Winter 2025 release
If you add scopes to AllowedScopes Ocelot will get all the user claims (from the token) of the type scope and make sure that the user has all of the scopes in the list.
This is a way to restrict access to a Route on a per scope basis.
Token contains Scope: "A"
Defined route AllowedScopes: "A", "B"
Ocelot should reject request to be fair with documentation.
Actual Behavior / Motivation for New Feature
Example
Token contains Scope: "A".
Defined route AllowedScopes: "A", "B"
Ocelot allow to pass request, even when token do not contains all required scopes!
Change proposal
Change: var matchesScopes = routeAllowedScopes.Intersect(userScopes).ToList();
To: var matchesScopes = routeAllowedScopes.All(e => userScopes.Contains(e));
Or, change misleading information in documentation.
Specifications
Version: 13.5.2, 19.0.2
Subsystem: ASP.NET Core 2.1, .NET 7
The text was updated successfully, but these errors were encountered:
raman-m
added
bug
Identified as a potential bug
proposal
Proposal for a new functionality in Ocelot
needs feedback
Issue is waiting on feedback before acceptance
accepted
Bug or feature would be accepted as a PR or is being worked on
and removed
needs feedback
Issue is waiting on feedback before acceptance
labels
Aug 24, 2023
raman-m
changed the title
Ocelot forward ReRoute when userScopes contains Any from routeAllowedScopes, but docs says that it should contains all of them
Ocelot forwards Route when userScopes contains Any from routeAllowedScopes, but docs says that it should contains all of them
Aug 24, 2023
acceptedBug or feature would be accepted as a PR or is being worked onbugIdentified as a potential bugproposalProposal for a new functionality in OcelotWinter'25Winter 2025 release
Expected Behavior / New Feature
Allowed Scopes documentation says:
ScopesAuthoriser | Line 36
Example:
Token contains Scope: "A"
Defined route AllowedScopes: "A", "B"
Ocelot should reject request to be fair with documentation.
Actual Behavior / Motivation for New Feature
Example
Token contains Scope: "A".
Defined route AllowedScopes: "A", "B"
Ocelot allow to pass request, even when token do not contains all required scopes!
Change proposal
Change:
var matchesScopes = routeAllowedScopes.Intersect(userScopes).ToList();
To:
var matchesScopes = routeAllowedScopes.All(e => userScopes.Contains(e));
Or, change misleading information in documentation.
Specifications
The text was updated successfully, but these errors were encountered: