Some development teams want to expose Swagger UI in production (our templates only expose it in development by default) - but still want to limit who can see the swagger document. We need some documentation that discusses approaches for doing this. Conventional wisdom on Stack Overflow probably isn't correct where folks use middleware with varying degrees of correctness.
Instead it is possible with more recent versions of Swashbuckle to do this:
app.MapSwagger().RequireAuthorization("policyname");
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 148470
Some development teams want to expose Swagger UI in production (our templates only expose it in development by default) - but still want to limit who can see the swagger document. We need some documentation that discusses approaches for doing this. Conventional wisdom on Stack Overflow probably isn't correct where folks use middleware with varying degrees of correctness.
Instead it is possible with more recent versions of Swashbuckle to do this:
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
Associated WorkItem - 148470