In this step by step tutorial, I show you how to secure a .NET Core API with JWT Bearer Authentication, using Azure Active Directory as the Identity and Access Management Layer. I also show you how to write a “secure” API client to call and authenticate to the secured API endpoint.
We use the Microsoft.Identity.Client and Microsoft.AspNetCore.Authentication.JwtBearer packages amongst others.
Level: Intermediate
Code on GitHub: https://github.com/binarythistle/S03E01-Secure-.NET-Core-API
Companion Article: https://dotnetplaybook.com/secure-a-net-core-api-using-bearer-authentication/
My Book: https://www.apress.com/gp/book/9781484262542