No video

Authenticate .NET Core with Azure AD

  Рет қаралды 20,474

Tim Burris

Tim Burris

Күн бұрын

Пікірлер: 30
@bradleylund6563
@bradleylund6563 6 ай бұрын
You are a legend! Thanks so much for the video, exactly what I was looking for :)
@TimBurris
@TimBurris 6 ай бұрын
Glad I could help!
@milacayn921
@milacayn921 11 ай бұрын
Thank you! this video is much easier to follow than other videos related to the same topic.
@TimBurris
@TimBurris 11 ай бұрын
Glad it was helpful!
@CatMucius
@CatMucius 11 ай бұрын
Thanks for the explanation, Tim! One note, though: adding users and groups to the list isn't enough to limit access to the app, you need also to go to the "Properties" tab of the Enterprise Application and enable the "Assignment required" option. Otherwise, all user accounts in the tenant can sign in. Had you used another user account of the same tenant for your negative test (instead of Microsoft account), you'd notice that it succeeds to sign in as well.
@TimBurris
@TimBurris 11 ай бұрын
Good point! thank you for the feedback!
@JuanPabloRussi
@JuanPabloRussi 4 ай бұрын
Thnaks, Bro! you are the best.
@ShotMuse
@ShotMuse 11 ай бұрын
Great explanation, very helpful thanks.
@TimBurris
@TimBurris 11 ай бұрын
You are welcome, I'm glad you found it useful!
@PratapSingh-op8hi
@PratapSingh-op8hi Жыл бұрын
Thank you! It is helpful.
@mithunbobade1
@mithunbobade1 5 ай бұрын
Great Video, Just a doubt, is it the same process for delegated permission?
@user-nw8oi9vn9y
@user-nw8oi9vn9y 4 ай бұрын
Do I use the same nuget identity package if I want to allow multi tenant and MS accounts ?
@norbertcsibi7720
@norbertcsibi7720 10 ай бұрын
What happens if I want to get AAD b2b to be able to sign in? I assume I`d need a multi-tenant selected and do I need to do something extra for the X org to be able to sign in into my app?
@arihadi2287
@arihadi2287 7 ай бұрын
Hi Tim, thanks for the great tutorial video. by the way, I try using your code in Program.cs but there's an error that says "No authenticationScheme was specified, and there was no DefaultChallengeScheme found.". I'm not sure why since we already define the authentication in AddAuthentication method. Did I miss something?
@TimBurris
@TimBurris 6 ай бұрын
Hopefully by now you have gotten past the scheme error. I pulled the code and tested again just now and I am not getting any error. Additionally, I don't recall running into that error anytime in the past. A quick google search yields a number of different causes, so it's hard to know which one you might have been encountering
@aavishar
@aavishar 8 ай бұрын
THanks man
@TimBurris
@TimBurris 7 ай бұрын
You're welcome!
@user-hk7st1sl4m
@user-hk7st1sl4m 7 ай бұрын
Hey nice video, but can you tell how we can do the single sign on using azure.
@TimBurris
@TimBurris 7 ай бұрын
I must be misunderstanding the question. This demonstration is authenticating with Azure, can you elaborate on your question?
@tagetget2148
@tagetget2148 Жыл бұрын
thank you for this video. Is it possible to return some claims from AzureAD using this method ?
@TimBurris
@TimBurris Жыл бұрын
absolutely, you can have the Groups that the User is a member of automatically flow into Claims of type Role, or you can use custom logic to map them how you want. here is an example walk through damienbod.com/2021/02/01/implement-app-roles-authorization-with-azure-ad-and-asp-net-core/
@RidaRamadan
@RidaRamadan 7 ай бұрын
Hi Thank you for the video. Can you please explain how to hook up with our custom pages? I need to redirect to a checkpoint before redirecting to the main page. I need the get the user's email to get his ID from the Db. Can you please help with that?
@TimBurris
@TimBurris 7 ай бұрын
absolutely! the short answer is, in your .AddMicrosoftIdentityWebApp call, you can hook into an "OnTokenValidated" callback event. With that you'll have access to all the claims that Azure AD put in, including the email address. Using that email address lookup your user and then add your User ID as a claim so that you can access it during page requests. I just created a branch in the git repo that demonstrates exactly that. here is the branch: github.com/TimBurris/DemoAzureActiveDirectory/tree/local-database-user-lookup DISCLAIMER: I put all the code directly into Program.cs, but in the real world I always have OnTokenValidated invoke a custom class to do all the real work.
@RidaRamadan
@RidaRamadan 7 ай бұрын
@@TimBurris Thank you so much. Subscribed. :)
@RidaRamadan
@RidaRamadan 7 ай бұрын
@@TimBurris Hi. I applied the configurations and it seems to be ok. But how can I get the UserId from the db in program.cs. And can you please explain invoking a custom class from OnTokenValidated?
@TimBurris
@TimBurris 7 ай бұрын
to use a custom class, you could create an instance in the OnTokenValidated either by directly "newing it up" like: var service= new CustomClaimService() or using Dependency Injection: var service = ctx.HttpContext.RequestServices.GetService(); regardless how you construct, you would then just pass the TokenValidationContext like this: return service.AssignClaims(ctx); then, inside of you CustomClaimService you could make a database call or do anything you needed
@hamedamin9324
@hamedamin9324 2 жыл бұрын
can you add a logout button in the next video please
@aavishar
@aavishar 8 ай бұрын
Please create a video on using Microsoft authentication library with .net core api .
@TimBurris
@TimBurris 7 ай бұрын
That's a good idea, I'll see if can throw one together. in the next few weeks
.Net Core Web API Azure AD Authentication and Authorization
28:20
AzureTeach•Net
Рет қаралды 71 М.
Is Blazor Better than React?
14:25
Gavin Lon
Рет қаралды 47 М.
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 3,9 МЛН
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 7 МЛН
How to use Microsoft Identity (Azure AD) to Authenticate Your Users
11:21
API Authentication with OAuth using Azure AD
26:35
Azure Power Lunch
Рет қаралды 122 М.
The Ultimate .NET Version Guide
14:35
Claudio Bernasconi
Рет қаралды 25 М.
React and ASP.NET Core Identity Authentication
32:16
Coding with Tom
Рет қаралды 14 М.
Zabbix - Monitoring and Alerting with  @AwesomeOpenSource
18:23
OneMarcFifty
Рет қаралды 67 М.
Building Beautiful Blazor Websites in .NET 8
1:01:47
Devessence
Рет қаралды 13 М.
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 3,9 МЛН