RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.69k stars 1.24k forks source link

OperationSecurityScopeProcessor looks at Roles but not Policy in AuthorizeAttribute #1674

Open hansmbakker opened 5 years ago

hansmbakker commented 5 years ago

OperationSecurityScopeProcessor looks at Roles of an AuthorizeAttribute but ignores it if there are no roles given. It does not work if the AuthorizeAttribute has a Policy property but no Roles.

How does this work with https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies?view=aspnetcore-2.1?

RicoSuter commented 5 years ago

Either you write your own OperationSecurityScopeProcessor or we have to enhace the existing one so that it supports more scenarios..