All Projects → christiansparre → BlazorAuthenticationSample

christiansparre / BlazorAuthenticationSample

Licence: MIT license
A sample showing some of the ASP.NET Core Blazor authentication features (also some testing...) 🚀

Programming Languages

C#
18002 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to BlazorAuthenticationSample

BestForYouRecipes
Best For You recipes site in Blazor
Stars: ✭ 63 (-19.23%)
Mutual labels:  aspnetcore, blazor
Awesome-Nuget-Packages
📦 A collection of awesome and top .NET packages sorted by most popular needs.
Stars: ✭ 87 (+11.54%)
Mutual labels:  aspnetcore, dotnetcore
DNZ.SEOChecker
SEO Checker and Recommander Plugin (like wordpress Yoast) for ASP.NET Core.
Stars: ✭ 18 (-76.92%)
Mutual labels:  aspnetcore, dotnetcore
Home
Home for Blazor Extensions
Stars: ✭ 51 (-34.62%)
Mutual labels:  aspnetcore, blazor
PugetSound
PugetSound allows you and your group to enjoy music together using Spotify.
Stars: ✭ 52 (-33.33%)
Mutual labels:  aspnetcore, dotnetcore
GatewayService
GatewayService (Ocelot).
Stars: ✭ 19 (-75.64%)
Mutual labels:  aspnetcore, dotnetcore
ant-design-blazor
Ant Design for Blazor (WIP)
Stars: ✭ 23 (-70.51%)
Mutual labels:  aspnetcore, blazor
Aspnet Core 3 Registration Login Api
ASP.NET Core 3.1 API for User Management, Authentication and Registration
Stars: ✭ 173 (+121.79%)
Mutual labels:  aspnetcore, dotnetcore
TheLastTime
C# .NET 5 Blazor WebAssembly Progressive Web Application that tracks when was the last time you did something
Stars: ✭ 23 (-70.51%)
Mutual labels:  aspnetcore, blazor
MASA.Blazor
Blazor component library based on Material Design. Support Blazor Server and Blazor WebAssembly.
Stars: ✭ 469 (+501.28%)
Mutual labels:  dotnetcore, blazor
AspNetCore6Experiments
ASP.NET Core Blazor BFF with Azure AD and Razor page
Stars: ✭ 43 (-44.87%)
Mutual labels:  aspnetcore, blazor
SimpleSocial
A simple social network web application using ASP.NET Core 3.1
Stars: ✭ 16 (-79.49%)
Mutual labels:  aspnetcore, dotnetcore
AsteroidsWasm
Collection of applications based on a single C# .NET Standard project running in: Blazor Client (WebAssembly), Blazor Server, Electron, WPF, WinForms, Xamarin
Stars: ✭ 136 (+74.36%)
Mutual labels:  dotnetcore, blazor
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (-39.74%)
Mutual labels:  aspnetcore, blazor
Identity.dapper
Identity package that uses Dapper instead EntityFramework for use with .NET Core
Stars: ✭ 234 (+200%)
Mutual labels:  aspnetcore, dotnetcore
BlazoredLocalStorage
This library has been moved to the Blazored org
Stars: ✭ 26 (-66.67%)
Mutual labels:  aspnetcore, blazor
Dotnetcore
.NET 5 Nuget Packages.
Stars: ✭ 146 (+87.18%)
Mutual labels:  aspnetcore, dotnetcore
Architecture
.NET 6, ASP.NET Core 6, Entity Framework Core 6, C# 10, Angular 13, Clean Code, SOLID, DDD.
Stars: ✭ 2,285 (+2829.49%)
Mutual labels:  aspnetcore, dotnetcore
MvcControlsToolkit.Core
Core Code for MvcControlsToolkit packages
Stars: ✭ 13 (-83.33%)
Mutual labels:  aspnetcore, dotnetcore
dotnetcore-image
Solution of .NET Core GDI+(Image) on Linux/Docker
Stars: ✭ 22 (-71.79%)
Mutual labels:  aspnetcore, dotnetcore

Not really maintaining this anymore, see https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-3.1 for the official ASP.NET Core Blazor authentication and authorization. It's quite comprehensive

ASP.NET Core Blazor (Server side) Authentication Sample

This sample shows some more "complex" and "real world" scenarios for handling Authentication and Authorization with ASP.NET Core server side Blazor.

The idea was to organize the sample a bit more like a real app, and just go a tiny step further than the built in template that comes in the box.

It's a work in progress... 🤷‍♂️

Structure

The app is comprised of few "parts". The App part and the Account part, plus a few other things.

Account part

The Account part contains pages to register and and sign in etc.

A little note is the SignIn page where there is a little extra hacky step as you cannot set cookies from Blazor easily. See for yourself 🤣

App part

In the App you need to be authenticated. This was done by adding @attribute [Authorize] to _Imports.razor in the App/Pages so all pages in that folder require authorization.

There is also a Sidebar menu that uses an AuthorizeView to trigger and "administrator" section of the menu based on roles.

Data

When started the app sets up some test users, see Startup.cs for those.

Unit tests

There is a few tests of some of the custom components as I also wanted to explore Unit Testing of Blazor Components.

The tests are using a slightly modified version of Steve Sanderson's BlazorUnitTestingPrototype. See my fork here. Also see Steve's blog post about the testing prototype.

Ideas

  • Would like to see if one could make a component to "generalize" some of the code around Resource-based authorization
  • Explore some more testing, I think Steve's prototype is a nice foundation
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].