MENU

Fun & Interesting

The Simplest Way to Add Keycloak Authentication to Your .NET API

Milan Jovanović 14,593 lượt xem 4 months ago
Video Not Working? Fix It Now

Want to master Clean Architecture? Go here: https://bit.ly/3PupkOJ
Want to unlock Modular Monoliths? Go here: https://bit.ly/3SXlzSt
Join a community of 1000+ .NET developers: https://www.patreon.com/milanjovanovic

Learn how to secure your .NET API with Keycloak authentication in the most straightforward way possible with the help of .NET Aspire. In this tutorial, I'll show you how to integrate Keycloak JWT bearer authentication into your ASP.NET application with just a few lines of code. No complicated setup or confusing configuration files - just clean, simple implementation that you can add to your project today. Whether you're building a new API or adding security to an existing one, this guide will help you implement robust authentication without the usual headaches.

Building Async APIs in ASP.NET Core - The Right Way
https://www.milanjovanovic.tech/blog/building-async-apis-in-aspnetcore-the-right-way

Check out my courses:
https://www.milanjovanovic.tech/courses

Read my Blog here:
https://www.milanjovanovic.tech/blog

Join my weekly .NET newsletter:
https://www.milanjovanovic.tech

Chapters
0:00 The app we're using
1:06 Adding the Keycloak service
3:06 Configuring Keycloak realm
5:20 Getting an access token (JWT)
6:46 Adding Authentication in API
9:54 Understanding backchannel auth
11:14 Examining distributed traces

Comment