ASP.NET Core External Authentication (OAuth, .NET 7 Minimal Apis C#)

preview_player
Показать описание


🕰 Timestamps
00:00 Introduction
00:35 Configuring Client
06:30 Callback Endpoint
11:00 2nd Authentication Scheme
12:43 Return Uri
14:15 State Parameter
17:04 OAuthHandler Internals
19:56 Saving Tokens Option
20:21 SignInScheme Cookie Creation
24:14 Get Tokens from Authentication Properties
25:10 Adding Token Claims to Cookie
26:09 Calling User Information Endpoint
28:32 Claim Actions & Mapping Claims
32:12 Saving Tokens to Database
33:40 Facebook Authentication

👉 Try Rider
RD5K9-4TXXW-KMV3G-NYWSF-3ZSTP

#aspnetcore #authentication #oauth
Рекомендации по теме
Комментарии
Автор

God, I feel so dumb. I needed to implement microsoft auth in my project and there was literaly two outdated guides on msdn which were not helpful at all, now I can understand at least how to setup an external auth and move in the right direction, thank you

dengari
Автор

This video is super DETAILED!! Thank you so much.. there are a lot of famous tech youtuber who have the same topic but nothing comes close to details and information that you provided in this video.

lord_rimuru_sama
Автор

This is how things should be taught. MSFT should hire you to help run their docs team. Many Thanks!

fieryscorpion
Автор

Anton, I can't thank you enough for your presentations! I hope you'll get to the point of publishing PAID classes - will be the first to pay and sign up.

michaelestrinone
Автор

Incredible, like the way you go through Microsoft's source code to understand the why's as well.

schlott
Автор

Hi anton great video, had one question shouldn't we use OIDC in case for external authetication ?

noopd
Автор

You're awesome ! THANK YOU SO MUCH

EzequielRegaldo
Автор

Having a problem. A silly one. At 10:31, when first setting the Callback endpoint, I keep just getting ERR_CONNECTION_REFUSED. I'm on a Mac, using Rider. VPN is off, "Bypass Proxy settings for these hosts and domains" includes localhost. When I run with 'dotnet watch --no-hot-reload', I get 'dotnet watch XExited with error code 138' followed by 'dotnet watch Waiting for a file to change before restarting dotnet...'

TheIBrown
Автор

Thanks for the video. I have a question. Do you validate the token which comes from the external app? If yes then in with moment?

dyrdai
Автор

1:45 ... I am trying to set up oauth2 authentication for a different external api, discogs. Any idea of how I would determine what the first parameter (the authentication scheme) should be in 0 =>..." ? Many thanks for the content.

josephh
Автор

I am just trying to figure out where I could now put some logic that registers this external user in the database using dbContext, since my system has some extra data like system role per user.

BlackBearFTW_
Автор

Loving your videos. Have you thought about doing some on 2FA, also with MFA, and TOTP, FIDO2, SMS, etc?

GraGra
Автор

Thanks, very helpful. Would love to see the own oAuth Server part :)

eduard.schaefer
Автор

Great presentation as always Anton. Thank you for your effort and enthusiasm (and sense of humor) !
A general question on AuthenticationHandlers: Are they part of the Authentication Middleware (app.UseAuthentication) or the Authentication Services ?
This is kind of blurry to me.
I would say that the "Services" registers the Handler and when the Middleware is reached, then the handler is executed. Is that correct statement ?

MrJonnis
Автор

I didn't get your example to work with .net7. I had to use .net6 and then all worked fine. In .net7 I get a stack overflow exception. Do you know why this is?

TheITomG
Автор

what is device flow, while creating github app their is option to select for device flow can you please make video on this

abdulnaveed
Автор

Can I use JWT instead of cookies? I need this for a mobile app.

matthewrossee
Автор

Hi Anton thanks for the awesome Video. Do you have any with SAML SSO? I know most things are similar but i am looking a comprehensive one as the web doesnt have any quality one/

ArisFanaras
Автор

would you make a video that show how to make normal asp core api project with both jwt and cookie auth and refresh token?

AhmedMohammed
Автор

Great video! I noticed in my program.cs that when I tried to call Add() on the OAuth.Scope to allow multiple scopes. It only works if you add the two scopes you want by space in one Add() Method. When I tried using two add methods, it would only show that the openid scope was valid and my request for other resources would fail. Are scopes supposed to be able to add to the collection for each scope that you want?

Jimcbell