RouteClaimsRequirement
not enforced even when token is authenticated and contains required claim
#2293
Replies: 3 comments 9 replies
-
Hello, @Naihan ! Is this a question or a bug?
OK And what's inside of the
And where is located JWT setup? Where and how do you add JWT handler aka AddJwtBearer method? |
Beta Was this translation helpful? Give feedback.
-
I have come across discussions or repo issues suggesting that claim names in the form of links are not supported in Ocelot. This could potentially pose an issue. I will look into related at a later time. TODO → Search for RouteClaimsRequirement |
Beta Was this translation helpful? Give feedback.
-
hay @raman-m It might be a bug... the builder.Services.AddMicrosoftIdentityWebApiAuthentication(builder.Configuration, configSectionName: "AzureAd"); adds a Bearer scheme |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using
RouteClaimsRequirement
in Ocelot with Azure AD and a validated JWT token, Ocelot logs "No authorization needed for upstream path" and does not enforce the claim check, even though:AuthenticationOptions
andRouteClaimsRequirement
Expected behavior, Ocelot should:
RouteClaimsRequirement
c# code
ocelot.json
the jwt contains a claim :
logs show:
full log:
Beta Was this translation helpful? Give feedback.
All reactions