Basic Authentication in Dotnet API

preview_player
Показать описание
Learn how to secure your Dotnet API with Basic Authentication. In this video I show how to set up your own custom Basic Authentication Handler, add claims, access those claims, and some simple Role Based Authorization.

Github repo with code from video:

More info on Role Based Authorization:

Follow me on social media!

Check out my blog!
Рекомендации по теме
Комментарии
Автор

first 45 seconds and this guy already has a better video than most people out there on basic authentication. why is that so? Thank you so much. you do an awesome job with the necessary info upfront and than examples. I will be passing your videos around to colleges

T.N.T.
Автор

after 47 seconds I got a lot more useful information compare to few hours on udemy... Thank you!!!

alexander
Автор

Can't thank you enough. Finally an easy video on basic auth on my .NET 8 API, got it all up and working, and even makes my swagger work nicely.

snowglider-xn
Автор

A very nice channel, simple and clear explanations. I just discovered it. Thank you for the videos.

eser-sahin
Автор

Very nice tutorial !
One mention, in the handler code, at line 50, when you wrote username != “like” && password != “subscribe” you shouldn’t use the AND operator but rather the OR operator.
With the AND operator, if just one is different and the other is equal it will pass with a success result.
If you put OR, if either one is different and one is equal, it will fail (as it should because both need to be equal in order to succeed).

themcr
Автор

Thank you very much for this I need it so bad and i just cannot find the right one until i saw yours!!!

thomasyuen
Автор

Thank you very much! You helped me a lot and your explanation is amazing.

isabelabianca
Автор

Great, by the way I watched that you can implement authorization through middlewares. Is this an old approach or it is more about your preferences ?

nestormartinez
Автор

Hi, thank you. Just one question, I'm getting 403

JorgeBenavidesQ
Автор

i have to fill the property AuthenticationSchemes of the authorize attibut like this : = "BasicAuthentication") otherwise i have a 404 not found response instead of 401

foudilbenouci
Автор

nce video.I need to authenticate an api which has username and password.I will try this basic authentication.

srikalyanlingamaneni
Автор

I want to see the using clauses.
The code is not in the link!

itze_
Автор

Why do people act as if BASIC auth doesnt exist. I dont want OAuth for an internal api that is IP restricted. Im the developer and if I decide basic auth is "secure enough" its up to me. Infuriates me searching for something so simple and Microsoft being like "Have you heard about OAuth and identity". Yes, i have used them many times, it just isnt needed now!

AlexStewart-nhgc
Автор

how to use AD Authentication in this setup?

wheelogger