I am looking for a way to program a custom authorization filter in ASP.NET 5, because the current implementation depends on the Policy / Requirement, which, in turn, rely solely on the use of Claims, thus on an unmanaged and constantly changing Identity System, which I'm very tired of ( I tried it all deliciously).
I have a large set of permissions (over 200) that I donβt want to code as claims, because I have my own repository for them and a much faster way to check it than to compare hundreds of lines (these are the claims at the end).
I need to pass a parameter in every attribute that needs to be checked against my custom permissions repository:
[Authorize(Requires = enumPermission.DeleteCustomer)]
I know that this is not the most common scenario, but I think this is not an extreme case. I tried to implement it as @leastprivilege described in his excellent post "Security Status in ASP.NET 5 and MVC 6: Authorization", but I ended up on the same walls as the author who even discovered the problem in the ASP.NET repository 5 github that was not closed too clearly: link
Any idea on how to achieve this? Maybe use a different kind of filter? In this case, how?
Vi100 source share