All Projects → JeepNL → Blazor Wasm Identity Grpc

JeepNL / Blazor Wasm Identity Grpc

Licence: mit
Blazor WASM, IdentityServer4, Kestrel Web Server, Entity Framework Code First SQLite Database with Multiple Roles, Additional User Claims & gRPC with Roles Authorization.

Projects that are alternatives of or similar to Blazor Wasm Identity Grpc

Modernarchitectureshop
The Microservices Online Shop is an application with a modern software architecture that is cleanly designed and based on.NET lightweight technologies. The shop has two build variations. The first variant is the classic Microservices Architectural Style. The second one is with Dapr. Dapr has a comprehensive infrastructure for building highly decoupled Microservices; for this reason, I am using Dapr to achieve the noble goal of building a highly scalable application with clean architecture and clean code.
Stars: ✭ 154 (+152.46%)
Mutual labels:  grpc, sqlite, identityserver4
Rustwasm Addon
🦀 + 🕸 + 🦊 // A web-extension to reverse a string. Yep.
Stars: ✭ 41 (-32.79%)
Mutual labels:  webassembly, wasm
Json2excel
Generate excel file from json data
Stars: ✭ 40 (-34.43%)
Mutual labels:  webassembly, wasm
Vxformgenerator
The library contains a component, that nests itself into the Blazor EditForm instead of a wrapper around the EditForm. The component is able to generate a form based on a POCO or a ExpandoObject. Because of this architecture the library provides the developer flexibility and direct usage of the EditForm.
Stars: ✭ 60 (-1.64%)
Mutual labels:  webassembly, wasm
Sql.js
A javascript library to run SQLite on the web.
Stars: ✭ 9,594 (+15627.87%)
Mutual labels:  sqlite, wasm
Photon
⚡ Rust/WebAssembly image processing library
Stars: ✭ 963 (+1478.69%)
Mutual labels:  webassembly, wasm
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+14765.57%)
Mutual labels:  webassembly, wasm
Cppwasm Book
📚 WebAssembly friendly programming with C/C++ -- Emscripten practice
Stars: ✭ 956 (+1467.21%)
Mutual labels:  webassembly, wasm
Hidamari
Modern operating system aimed at running WebAssembly code.
Stars: ✭ 49 (-19.67%)
Mutual labels:  webassembly, wasm
Asm Dom Boilerplate
A simple boilerplate to start using asm-dom without configuration.
Stars: ✭ 49 (-19.67%)
Mutual labels:  webassembly, wasm
Proxy Wasm Cpp Sdk
WebAssembly for Proxies (C++ SDK)
Stars: ✭ 55 (-9.84%)
Mutual labels:  webassembly, wasm
Wasmboy
Game Boy / Game Boy Color Emulator Library, 🎮written for WebAssembly using AssemblyScript. 🚀Demos built with Preact and Svelte. ⚛️
Stars: ✭ 963 (+1478.69%)
Mutual labels:  webassembly, wasm
Rhai
Rhai - An embedded scripting language for Rust.
Stars: ✭ 958 (+1470.49%)
Mutual labels:  webassembly, wasm
Wasm Sort
WebAssembly sort algorithms compiled by C.
Stars: ✭ 34 (-44.26%)
Mutual labels:  webassembly, wasm
Wasmsign
A tool to add and verify digital signatures to/from WASM binaries
Stars: ✭ 31 (-49.18%)
Mutual labels:  webassembly, wasm
Winter
Haskell port of the WebAssembly OCaml reference interpreter
Stars: ✭ 42 (-31.15%)
Mutual labels:  webassembly, wasm
Aioli
Framework for building fast genomics web tools with WebAssembly and WebWorkers
Stars: ✭ 51 (-16.39%)
Mutual labels:  webassembly, wasm
Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-52.46%)
Mutual labels:  webassembly, wasm
Wasm Check
TypeScript / JavaScript library for detect WebAssembly features in node.js & browser
Stars: ✭ 30 (-50.82%)
Mutual labels:  webassembly, wasm
Uno.ch9
Ch9 - Uno Reference Implementation project
Stars: ✭ 45 (-26.23%)
Mutual labels:  webassembly, wasm

Blazor WASM, IdentityServer4 with Multiple Roles, Additional User Claim(s) & gRPC Roles Authorization

Blazor Template Screenshot

.NET Core (Whoa Nelly, this thing does work!) 😉

This .NET 6 Preview repo combines two repo's by @javiercn:

  1. https://github.com/javiercn/BlazorAuthRoles
  2. https://github.com/javiercn/BlazorGrpcAuth

(To run this repo you'll need .NET 6.0 SDK and Visual Studio Preview)

I've added Role Authorization to the -Greeter -gRPC -Service:

Server/Startup.cs

endpoints
    .MapGrpcService<GreeterService>()
    .RequireAuthorization(new AuthorizeAttribute { Roles = "Administrator"})
    .EnableGrpcWeb();

I've also added a Client/Claims.razor page with a list of the current user's claims.

It uses Kestrel as the default webserver, a SQLite database and is "CTRL-F5'able" without any further configuration.

You can delete de SQLite database and migrations folder if you want and use the following commands in Visual Studio's Package Manager Console to re-create the db.

  1. Add-Migration InitialCreate
  2. Update-Database

At first run the app will create 2 users (if they don't exist, see: Server/SeedData.cs)

  1. [email protected] / Qwerty1234#
  2. [email protected] / Qwerty1234#

and 2 roles:

  1. Users
  2. Administrators

The 'Administrators' & 'Users' roles will be assigned to: [email protected]

The 'Users' role will be assigned to: [email protected]

Additional Claim(s)

(By George, I think I've got it)

  1. I've extended ASP.NET Identity AspNetUsers table with an extra 'CustomClaim' field (see: Server/Models/ApplicationUser.cs).
  2. Seeded a value to that CustomClaim field in: Server/Data/SeedData.cs
  3. Added: Server/AppClaimsPrincipalFactory.cs
  4. Modified: Server/Startup.cs to use AppClaimsPrincipalFactory.cs
  5. When you run the app you'll see the custom_claim in the Client/Pages/Claims.razor page
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].