I want to create a custom AuthorizeAttribute that does the following:
- If the requested URL contains the query parameter id, normal authorization is required
- If the requested URL does not contain the query parameter id, no authorization is required
Reading https://learn.microsoft.com/en-us/aspnet/core/security/authorization/iauthorizationpolicyprovider?view=aspnetcore-3.1 does not make things very clear in this particular case.
Reading How do you create a custom AuthorizeAttribute in ASP.NET Core? also does not make things clear as it depends on claims.