Answer the question
In order to leave comments, you need to log in
How to set authorization policy for ASP.NET core request?
I need to set an authorization policy for a request depending on the parameters of the request.
Using 'AuhtorizeAttribute' seems like a good idea at first glance, because you can set the 'Policy' property there, but there's no access to the 'HttpContext'.
Answer the question
In order to leave comments, you need to log in
Write your own middleware only.
As an example
https://docs.microsoft.com/en-us/aspnet/core/secur...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question