Cookie Authentication and [Authorize]

Turn on cookie authentication in Program.cs, sign users in with claims and SignInAsync, protect actions with [Authorize] and roles, and show who's signed in with User.

Updated

Cheat sheet: Cookie Authentication and [Authorize]
Category
ASP.NET Core
Level
Journeyman
Tags
[Authorize], aspnet-core, Authentication Middleware, Claims and ClaimsPrincipal, Cookie Authentication, c-sharp