Implementing basic authentication in ASP NET Web API

Implementing basic authentication in ASP NET Web API

kudvenkat

7 лет назад

424,042 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Prashant Pande
Prashant Pande - 08.07.2017 21:34

Thanks a lot Sir. you are true generous about knowledge...God bless you.

Ответить
Bas Volkers
Bas Volkers - 22.09.2022 14:28

Great example ! Did you forget the try catch in your OnAuthorization method??

Ответить
Belmiris
Belmiris - 15.07.2022 12:30

You make that look so easy! Thanks!.

Ответить
Mohideen Asraf
Mohideen Asraf - 30.05.2022 13:50

What happen if my password have a colon ( : ) symbol ?

Ответить
Raj Kumar Arora
Raj Kumar Arora - 07.12.2021 10:23

Even complex things are simplified at your channel.
May all success comes to your way! Thanks

Ответить
Aneesh KP
Aneesh KP - 31.10.2021 11:10

Dear Sir,
You have given BasicAuthenticationAttribue as the class name but use only the word BasicAuthentication to decorate action method. In the case of enabling CORS you use full class name. Could you please expalin this?

Ответить
Ronald
Ronald - 03.10.2021 21:07

How does this differ from using the IDENTITY FRAMEWORK ?

Ответить
Ronald
Ronald - 03.10.2021 20:49

This is exactly like Clearcats tututorial.

Ответить
Linus Developer
Linus Developer - 26.08.2021 16:30

Allah ap ko Islam ki Dolat se nawaz de.

Ответить
Sampath Kumar Baddipudi
Sampath Kumar Baddipudi - 11.08.2021 21:53

Can you please use VS white theme...

Ответить
Marcio Manini
Marcio Manini - 22.07.2021 03:31

Best Tutorial ever! Thanks a lot

Ответить
Rahul Chaudhari
Rahul Chaudhari - 16.07.2021 17:39

Hello Sir, Could you please tell me how can we implement a code by using basic authentication for logout ..??

Ответить
gregwmay
gregwmay - 22.03.2021 13:31

In a thousand years I could not have figured that out from the Microsoft documentation, yet you had me up and running with actual basic authentication in less than 20 minutes. Thank you thank you thank you!

Ответить
Raj Vijay
Raj Vijay - 11.03.2021 22:43

true genius. Teacher of the year needs to go to you sir. Thanks many tons

Ответить
shubham jain
shubham jain - 17.02.2021 21:36

I am not able to fine Any() method

Ответить
Geoff B
Geoff B - 17.12.2020 01:51

Don't use split() on the decodedAuthToken. It will break if a users password contains the split character.

Ответить
Madhvika Bhatt
Madhvika Bhatt - 15.12.2020 10:05

I passed an authentication header in fiddler but still getting message 401. pls help me

Ответить
NRK
NRK - 23.11.2020 18:02

Thanks a lot guruvu gaaru 🙏

Ответить
Syed Shahed
Syed Shahed - 07.07.2020 16:44

Can I have access to the code of this tutorial. Much appreciated if you provide so. Thanks

Ответить
franciscoarmando
franciscoarmando - 20.05.2020 06:05

You have been my guide, my tutor, my teacher, my way of coding for years!... Thank you so much for so many many hours of teaching... You are The Man!

Ответить
abhilash m
abhilash m - 19.05.2020 09:52

Thank you so much

Ответить
Naod Agere
Naod Agere - 29.04.2020 07:47

Thank you so much!

Ответить
Rohit Sakalle
Rohit Sakalle - 08.04.2020 01:17

Awsome content Just to add to above it's mandatory to use .ToList in Controller otherwise you run into below issue.

{"Message":"An error has occurred.","ExceptionMessage":"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; charset=utf-8'.","ExceptionType":"System.InvalidOperationException","StackTrace":null,"InnerException":{"Message":"An error has occurred.","ExceptionMessage":"The operation cannot be completed because the DbContext has been disposed.","

Ответить
Kero Kero
Kero Kero - 10.03.2020 17:32

Authentication and authorization are not the same. Even though this produces something that seems to work, this is not how it should be done.

Ответить
Ianino
Ianino - 10.01.2020 20:35

Thanks!!

Ответить
JAN N
JAN N - 10.01.2020 07:00

Ok I get most of his videos but I am pretty lost on this one.

Ответить
JISHAN KAZI
JISHAN KAZI - 08.01.2020 14:08

Kuchh samajh nahi aa raha

Ответить
Shafer Hart
Shafer Hart - 14.11.2019 05:03

Why the f am I still applying for .net jobs? lol. Oh right, my first job was .net and recruiters are still calling me with tempting offers. This is way more complicated than it needs to be smh. JS jobs or bust from now on.

Ответить
Igor Veljanoski
Igor Veljanoski - 31.10.2019 15:20

Sir, Thanks a lot for web api tutorials, I've learned so much from you.

Ответить
Vinayak
Vinayak - 08.10.2019 23:40

Is this also called JWT based authentication ??

Ответить
Joshua Adjei
Joshua Adjei - 03.10.2019 14:03

great thanks

Ответить
Sheikh S. Mahmud
Sheikh S. Mahmud - 12.09.2019 04:44

I wanted to confirm. Does .NET Core support basic authentication attributes? I am using .NET version 4.7.2, not .NET Core and followed along with Venkat's tutorial but for some odd reason my authentication doesn't work. Whether I register the authentication attribute on web config or I apply the filter tag [BasicAuthentication] on the controller, it doesn't help. I run the api on the browser using localhost:(port number)/api/employees. What happens is that I get default Google error page saying page isnt working error 401. I even tested on fiddler and same thing. I don't understand, is basic authentication not supported in .NET versions below the CORE? Thanks for confirming and love your videos. And yes, I will always have a great day :)

Ответить
aman barnwal
aman barnwal - 24.08.2019 00:09

what if someone's password contained a ":"?

Ответить
kids World
kids World - 08.08.2019 06:22

Hello Sir, Showing Blog has been removed error message when checking text version. Please Check.

Ответить
Ronit Ghosh
Ronit Ghosh - 02.08.2019 09:47

This is gender discrimination at it's core 😂

Ответить
Diego Cantelli
Diego Cantelli - 05.07.2019 22:50

Keep the good work!!

Ответить
Ninad Potdar
Ninad Potdar - 03.04.2019 14:43

"An exception of type 'System.IndexOutOfRangeException' occurred in EmployeeService.dll but was not handled in user code

Additional information: Index was outside the bounds of the array."


im facing with this error .can you help me with this issue?

Ответить
HARSHITH GOWDA DR
HARSHITH GOWDA DR - 30.03.2019 12:12

Sir can please make one video how to implement SAML 2.0 in .Net

Ответить
Vinita Singh
Vinita Singh - 28.03.2019 16:56

Thank you Sir, Very well explained..

Ответить
إبراهيم عبدربه مرزق اليمني
إبراهيم عبدربه مرزق اليمني - 14.02.2019 11:23

Thank you very much. You are Amazing

Ответить
Derek Mwanza
Derek Mwanza - 09.02.2019 21:41

Faultless - without doubt the best ever online tutorial I have come across, I can see myself spending many hours looking at your other videos. Thank you for all your hard work.

Ответить
Tim Hepworth
Tim Hepworth - 11.01.2019 18:41

Excellent video - thank you

Ответить
김진수 [Kim-Jinsu]
김진수 [Kim-Jinsu] - 18.12.2018 08:54

excuse me, teacher.
I'm tyring this video section about OnAuthorization(BasicAuthenticationAttribute class),
debugging found it actionContext has Authorization == null.
When using fiddler, header doesn't deliver Authorization code.
(Authorization: Basic ZmVtYWxlOmZlbWFsZQ== ).
So i can't certificate my web site.
Anybody who can tell me what's wrong with me?

Ответить
Pietro Zanandrea
Pietro Zanandrea - 11.12.2018 05:07

eu te amo

Ответить
edward lie
edward lie - 03.12.2018 16:27

Do you have video tutorial how to publish rest api on iis. IIS has lot of setting and security that make me hard to learn. Thanks

Ответить