This repository contains the Swashbuckle addons for custom ordering of controllers and adding authentication/authorization information to Swagger API documentation along with a complementary MVC filter authorization filter designed to secure an API call with more than one policy which are part of the NuGet package TGolla.Swashbuckle.AspNetCore.
because if you forget and add a space, the process will fail and it will appear to you that the policy does not exist
I faced this problem myself now and solved it by trimming the policy on this line
var authorized = await authorization.AuthorizeAsync(context.HttpContext.User, policy.Trim());
I changed it from
var authorized = await authorization.AuthorizeAsync(context.HttpContext.User, policy);
to
var authorized = await authorization.AuthorizeAsync(context.HttpContext.User, policy.Trim());
To avoid the problem when using blanks such as
[AuthorizeOnAnyOnePolicy($"{Policies.Admin}, {Policies.Employee}")]