Skip to content
0:00 / 0:00

#asp.netcoreidentity#bearertokens#cookieauthentication

.NET 8 Authentication with Identity in a Web API with Bearer Tokens & Cookies ๐Ÿ”’

Patrick God

84K subscribers โ€ข 3 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

186K views3 years ago1 recommendation

Web developmentSecurityHTTP, REST and GraphQLWeb and application security

Patrick God shows how to configure ASP.NET Core Identity in .NET 8 to support both bearer tokens and cookie authentication.

๐Ÿš€ Master .NET & Blazor here: dnwa.net/3UqG4Zm --- ๐Ÿ’– Support me on Patreon for exclusive source code access: patreon.com/_PatrickGod ๐Ÿš€ Get the .NET 8 Web Dev Jump-Start Course for FREE: dotnet8.patrickgod.com Table of Contents: .NET 8 Authentication with Identity in a Web API ๐Ÿ”’ Official Announcement Create a Web API Project Add an Entity Framework DataContext Register the IdentityDbContext Add Authentication with Identity Add & run code-first migrations Run the App Configure Swagger to test the Authentication Test the Authentication with Swagger What about Cookie Authentication? #DotNet #Identity #WebAPI

Why it's here

1 person recommends this

What people say. Recommended as a helpful tutorial for implementing the new .NET 8 Identity authentication APIs.

u/Soldjaboy52in r/dotnet โ€ข Recommends

On โ€œ.NET Identity Documentation has broken meโ€

I feel your pain, what helped me the most was Raw Coding's auth series then supplemented with these few videos for .net 8 changes: (Honestly cant remember which ones were truly useful) link to this video link to this video link to this video However they all expect you to use EF, which might not be what you want to do, then I can't help you. (Its really annoying to be forced into a seemingly unrelated technology) When you use the built in login endpoint pass in a query parameter useCookies=true or smth like that

u/To-heebin r/dotnet โ€ข Mentions

How to Add Authentication to .NET 8 CRUD API I created a CRUD API with .Net 8, but I want to add authentication to the application so some routes of the CRUD API can be protected by Auth. I check resources like this Auth tutorial for .net8 but I don't understand how to integrate it with what I have already. I am using Postgres for my DB.