Skip to content

Documentation on securing swagger UI endpoint #30067

@mitchdenny

Description

@mitchdenny

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

Metadata

Metadata

Assignees

Labels

doc-enhancementseQUESTeredIdentifies that an issue has been imported into Quest.

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions