ASP.NET Core 8.0 - Cookies And Claims Project

One of my most popular articles is ASP.NET Core 3.1 - Users Without Identity which describes a cookie authentication scheme without the Authentication Type - Individual Accounts (ASP.NET Core Identity framework) template. I developed the Cookies And Claims Project (CACP) to demonstrate a simple cookie authentication scheme and claim-based authorization with a clear and modifiable design by implementing two hard coded users. The CACP is developed with Visual Studio 2022 and the MS Long Term Support (LTS) version .NET 8.0 framework. All Errors, Warnings, and Messages from Code Analysis have been mitigated.

Attempts to browse pages protected by authentication before logging in redirects to the Login page. A successful login creates a ClaimsPrincipal with the NameIdentifier and Name ClaimTypes. The Name claim is read and displayed by the _LoginPartial.cshtml partial view in the /Pages/Shared folder. The Administrator login adds a custom Administrator ClaimType to the ClaimsPrincipal. The Administrator ClaimType is required to access pages in the /Pages/Admin folder. If the Member login attempts to browse the Admin page, the user is redirected to the Access Denied page.

The first project I published back in 2019, was the ASP.NET Core 2.2 - Bootstrap Native Project (BNP). The BNP implemented Bootstrap Native and form validation with native JavaScript rather than jQuery. I developed, refactored, and implemented utilities in all my projects with Bootstrap Native and native JavaScript since. The CACP implements utilities like an AES Cipher, Password Hasher, native JavaScript client form validation, password requirements UI, Bootstrap Native message modal generator, loading/spinner generator, SignalR online user count, and an automatic idle logout for users with administration permissions.

V1.0.0 - MIT License - Free Access Fee - - 1,561,839 bytes



Not accepting new comments.

Submit your comment. Comments are moderated.

User Image.
DisplayedName - Member Since ?

Change Log

v1.0.0 - 2024-06-22
-- Initial Release