-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ocelot doesn't handle correctly RouteClaimsRequirement with a key as an Url #679
Copy link
Copy link
Open
Copy link
Labels
AuthorizationOcelot feature: AuthorizationOcelot feature: AuthorizationSummer'26Summer 2026 releaseSummer 2026 releasebugIdentified as a potential bugIdentified as a potential buggood first issueShould be pretty easy to doShould be pretty easy to dohelp wantedNot actively being worked on. If you plan to contribute, please drop a note.Not actively being worked on. If you plan to contribute, please drop a note.medium effortLikely a few days of development effortLikely a few days of development effortproposalProposal for a new functionality in OcelotProposal for a new functionality in Ocelot
Milestone
Metadata
Metadata
Assignees
Labels
AuthorizationOcelot feature: AuthorizationOcelot feature: AuthorizationSummer'26Summer 2026 releaseSummer 2026 releasebugIdentified as a potential bugIdentified as a potential buggood first issueShould be pretty easy to doShould be pretty easy to dohelp wantedNot actively being worked on. If you plan to contribute, please drop a note.Not actively being worked on. If you plan to contribute, please drop a note.medium effortLikely a few days of development effortLikely a few days of development effortproposalProposal for a new functionality in OcelotProposal for a new functionality in Ocelot
Type
Fields
Give feedbackNo fields configured for Bug.
While creating JWT for a user in my authentication service I use
System.Security.Claims.ClaimTypesstatic class with defined string constants for various claims. So,ClaimTypes.Role == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role":Then, when for some Route in RouteClaimsRequirement I write:
"http://schemas.microsoft.com/ws/2008/06/identity/claims/role" : "Admin"Such Route just disappears somewhere in the guts of middleware (I didn't manage to track down where this happens) and a request results in 404 because a route is not found:
When I use my own claim type like "Role", this works fine. So I assume there are some issues with (de)serialization of a string containing colons or slashes, basically as any URL.
Specifications