I have the following cenario:
-> WebAPi wicth gives me a custom Permission Manager that has methods to check wheter user can access some resource or not.
-> After the login I call that WebAPI and store the PermissionManager.
-> On each action I would check using "[Authorize("ResouceName")]
" against the PermissionManager.
I´ve read a lot of docs, but just can´t figure out how to correct implement this.
Challanges:
*What's best way to store the PermissionManager class? Cache?
*I´ve tried out the building it using IAuthorizationRequirement
. But how to access the Policy name given in the "Autorize("ResourceName")"?
*Would be good not to store the users resources at Claims. Given that this application has a lot of resources and I´m using cookies to persist claims.
Any tips and suggestions would be apreciated.