I am trying to understand the ASP.NET policy-based authorization mechanism, and I understood that I need to do the following:
- Set up a policy
- Assign requirements to that policy
- Define authorization handlers to these requirements which perform the actual validation (And return whether the requirements were fullfilled or not)
- Add the authorization handlers to the dependency injection mechanism
However, reading the ASP.NET documentation, I understand I might need to set up an IAuthorizationService as well. I failed to understand why that is needed for from the ASP.NET documentation.
Do I have to set one up? What should it do? Is that an alternative to the policy and authorization handlers I am setting up or a required addition to them?