Swagger is really a cool tool to document and test out REST API's. This blog tells about steps to enable Swagger on a Dot Net Core Application along with Authentication as well. In this demo, I am using Azure Active Directory OAuth 2 Authentication to protect my Web API from unauthenticated access. We will be enabling OAuth 2 Authentication on our Swagger UI as well so that we can authenticate using Swagger and then invoke our APIs successfully. OAuth 2 Authentication works by using Bearer Token to validate the caller and provide access to resource. This requires us to register an Application in the Active Directory tenant, which will be used for authentication of the API, and we will use the same app to authenticate Swagger as well. Lets get started - Assuming you have a Dot Net Core Web API that's authenticated via Azure Active Directory OAuth 2 Authentication. Azure Active Directory Application Registration - We need to set up our Active Directory Application so th...