Coding Short: Using Bearer Tokens in .NET 8 Identity

preview_player
Показать описание
In .NET 8, Identity has gotten a big refresh. One of the more hidden features of this is being able to use Endpoints to manage Identity (including Login, Registration, etc.) .Let me show you how it works:

You can hire me too! You can reach me at my new website:

00:00 Introduction
00:35 Creating the Project
03:19 Registering with the Default Project
04:29 Using an API
05:37 Problem with Securing the API
06:24 Adding Bearer Token Support
07:31 Creating an API Policy
09:39 Using ApiEndpoints
12:57 Wrapping Up

Example code:

If you like this video, you might like other videos in my Instructional Videos:
Рекомендации по теме
Комментарии
Автор

I recently discovered your account. I must say I just absolutely love how calm, factual and to the point your videos are.

zitronenmelisse
Автор

Thank you! Explaining how to deal with razor page/ui vs. API was very helpful.

bfskguu
Автор

Been reading your blogs\books for decades...grew up on your code...great content as always :)

CarrigansGuitarClub
Автор

like other users i have taken a few of your courses as well - glad i came across you here on YouTube - subscribed with a thumbs up

tonybaker
Автор

Really helpful for me, thanks so much. So appreciate you doing these videos and being so gracious with your time and energy - you're awesome.

harleyAtdk
Автор

I took a few of your courses on Pluralsight and I'm happy to see you here too. Great approach on explaining this clearly.

samuelketels
Автор

I just noticed I wasn't subscribed yet; that is now fixed! It is great to see your subscribers increase further over the last weeks. Your videos deserve a large audience.

robdevoer
Автор

An amazing and pragmatic approach to teach these subjects!

SiberHavoc
Автор

Great video. Simple and short. True to the channel name. You mentioned possibly doing another video for Identity using Windows. I would welcome that.

patannetube
Автор

Great video from a great It educator. Looking forward for a similar video on AAD B2C in .NET 8.0. And, if it is on Blazor web app would be perfect.

abdeslamhidan
Автор

Indeed yes, always great explanations and guidance from you!

CScottEdwardsScottGeek
Автор

Great video. I've been looking for a simplified way of logging in via the API, to then use the API... I'm certainly going to give this a whirl.

leonardvanonselen
Автор

Forgive me if I missed it in your library of videos (I'm still looking, ) but it would be very cool if you could do a video on oauth 2.0 pkce with .Net and Angular where your API endpoints include /authorize, /oauth/token, etc.
Keep up the awesome job you do. I would not be the person I am today without you.

ZimTachyon
Автор

I subscribed. Cool video helps me a lot in my actual project!

pqners
Автор

Thank you for making these shorts. Short and to the point. I hope you don't mind me asking if there is any solution also for using OIDC providers like keycloak or similar?

borisgomiunik
Автор

Thank you for the super clear way that you describe these topics. This is a useful feature that has just saved hours of work. Nice video Sean. I am struggling to use the token that is being created though. I added an api controller and set the Authorize decorator to use the "api" policy name. In postman I am making a GET request with the access_token embedded in the header as bearer. I keep getting 401 though. I tried playing around with sending the token as a JWT but the same thing happens. Can you elaborate how to use the token once it has been created? I would have expected it to be simple enough, perhaps I am just missing something w.r.t implementing the auth in my other controllers? Do you maybe have another video that demonstrates using the JWT? Thank you again, you are an absolute legend, please keep the content coming.

andrejcarstens
Автор

Hi Shawn! I'm glad you have made Youtube channel, I always follow and watch your video on Pluralsight but sadly you teach on Angular subject which not my direction. I hope you also make videos about Blazor sir. anyway hats off to you always, may you have a pleasant day ahead.

rockycaballero
Автор

i understand all this but how do i add this to my project? i want to run a website that gets data from an Api. unfortunately, this didn't help me

aron-gxmh
Автор

Great video but I wish you had shown on a full API Swagger project and then say a Blazor page doing a check that it's authenticated, if not then make a API call to do a refresh token or no joy, to then take them to a signin page. Plenty of video doing this on .net 7, but yet to see a current update from start to finish doing this with .net 8. Hopefully soon once release.

waynehawkins
Автор

Great intro, but still looking forward to the Entra integration video you said you might do ;)

allannielsen