SharePoint Config

Ari Bakker's thoughts on customising and configuring SharePoint

Archive for August, 2018

Configure Swagger to authenticate against Azure AD

with 2 comments

If you are building a Web API secured by Azure AD you will need to authenticate to test the API. Configuring OAuth 2 in Swagger allows you to authenticate using the Swagger UI and test the API with the necessary authentication headers.

The steps to configure this are:

  1. Create a Web API project
  2. Register an Azure AD (AAD) app for the Web API
  3. Update the Web API project to use Azure AD authentication
  4. Register an AAD app for the Swagger web site
  5. Grant permissions for the Swagger AAD app to access the Web API AAD app
  6. Generate a Client Secret for the Swagger AAD app
  7. Enable OAuth2 implicit flow on the Swagger AAD app
  8. Add Swagger to the Web API

Written by Ari Bakker

August 27th, 2018 at 10:51 am

Posted in Uncategorized