How to Authenticate a Blazor Server App with Azure AD

preview_player
Показать описание
Do you want to create a new Blazor Server application and authenticate it using Azure AD?

What sounds simple cost me a whole day to figure out. In this video, I will show you how I made it work.

00:00 Introduction
00:15 Creating a Blazor Server App using Microsoft Identity
01:17 Connect to an Azure App Registration
03:22 Authenticating a User
04:06 Make the Home Page Non-Authenticated
05:48 Show Menu Items only to authenticated Users
07:05 Conclusion

🔥 C#/.NET Bootcamp: The Fundamentals & more (Code FRIENDS10 for 10% OFF)*

📌 .NET Developer Roadmap

📌 YouTube Playlists:

✅ SUBSCRIBE FOR MORE VIDEOS

🚀 CONNECT & SUPPORT

CREDITS

* Affiliate Link: I earn a small commission at no additional cost
Рекомендации по теме
Комментарии
Автор

Thanks Claudio, my department is moving to Azure AD instead of Ping Federate as broker and this helps. Now I have to figure out how to get my tenant administrator to approve the app registration so we can actually log in - It seems that even though the permissions needed in the app registration say admin approval isn't required, I still get a notification after login prompt that admin must approve the app. I think this is because users aren't allowed to approve the app registration's usage of our data so it must be done at the tenant admin level? Ah well, just another gate to open. The other issue I had in an earlier version of this new app was DevOps pipelines that we normally use don't seem to work - publishing directly from VS works fine, but when deploying via DevOps there are errors in the browser and theme is broken. Once we have a development process that works well and can pump out apps efficiently, things change and we have to start from scratch! This is the life... :(

wontonotnow
Автор

Thank you. Can you please make a new video on how to add permissions to the access token (for cases when your app calls a downstream API)?

fieryscorpion
Автор

Great stuff. Thanks for the very clear explanation!!

verbeeckorama
Автор

How do i get the access token in blazor server app build with net 8?

niteshsetin
Автор

Hi, thanks for sharing your knowledge. Can you tell me how to create role-based authorization in a Blazor Server application, please?

shatvani
Автор

Hi, for .net 8, when creating a Blazor App, there is no option to choose 'microsoft identity platform'. So how would I setup if that wizard window doesn't pop up?

Ashandsax
Автор

Thanks for this. I modified your tutorial for the .NET 8 and Blazor Web App which currently doesn't have an authentication template yet... The Log in button gets hung, and there is a debug message that there was a type error "couldn't fetch" at "ai blazor.web.js". Logging in didn't appear to work until I hit the refresh button on the webpage... and I was logged in. Any suggestions on making the logging in a bit smoother?

khaetee
Автор

is it possible to set permission levels?

rasemaier
Автор

Great 🎉 please add new video how to create app registration on azure portal

moatasemkremed
Автор

Dude, can you stop making these facial impressions like you are disgusted?

arrrryyy
Автор

How do i get the access token in blazor server app build with net 8?

niteshsetin