All Projects → shawty → blazor.jwttest

shawty / blazor.jwttest

Licence: MIT license
Quick test using JWT authentication for a blazor hosted (Client/Serverside) app with API and Authentication.

Programming Languages

C#
18002 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to blazor.jwttest

fast-blazor
Blazor component library for FluentUI. Microsoft's official lightweight wrapper around the FluentUI Web Components for use with .NET 6.0 Blazor applications
Stars: ✭ 928 (+2993.33%)
Mutual labels:  front-end-framework, blazor
SyncfusionHelpDesk
Blazor Syncfusion Help Desk
Stars: ✭ 38 (+26.67%)
Mutual labels:  blazor
FindRazorSourceFile
This is a set of NuGet packages that makes your Blazor apps display the source .razor file name that generated the HTML element under the mouse cursor when entering the Ctrl + Shift + F hotkeys.
Stars: ✭ 39 (+30%)
Mutual labels:  blazor
TheLastTime
C# .NET 5 Blazor WebAssembly Progressive Web Application that tracks when was the last time you did something
Stars: ✭ 23 (-23.33%)
Mutual labels:  blazor
Blazor.ScriptInjection
No description or website provided.
Stars: ✭ 17 (-43.33%)
Mutual labels:  blazor
OpenBudgeteer
OpenBudgeteer is a budgeting app based on the Bucket Budgeting Principle
Stars: ✭ 501 (+1570%)
Mutual labels:  blazor
mbill blazor admin
基于Blazor + Ant Blazor搭建个人记账后台管系统,采用.NET 6搭建后台服务,采用uni-app搭建个人记账微信小程序,采用Xamarin搭建移动客户端App
Stars: ✭ 19 (-36.67%)
Mutual labels:  blazor
awesome-blazor-browser
A Blazor WebAssembly app for browsing the "Awesome Blazor" resources.
Stars: ✭ 155 (+416.67%)
Mutual labels:  blazor
castlecss-boilerplate
A simple and mobile-friendly HTML5 template with CastleCSS to kickstart your website
Stars: ✭ 29 (-3.33%)
Mutual labels:  front-end-framework
blazor-training-samples
Sample code for the free DevExpress Blazor training course
Stars: ✭ 52 (+73.33%)
Mutual labels:  blazor
MusicX
Simple web music player built with Blazor WebAssembly
Stars: ✭ 138 (+360%)
Mutual labels:  blazor
planningpoker4azure
Planning Poker 4 Azure
Stars: ✭ 49 (+63.33%)
Mutual labels:  blazor
acblog
An open source extensible static & dynamic blog system. (an alternative tool with same features at StardustDL/paperead)
Stars: ✭ 60 (+100%)
Mutual labels:  blazor
RazorComponents.Markdown
Razor component for Markdown rendering.
Stars: ✭ 30 (+0%)
Mutual labels:  blazor
react-blazor
React vs. Blazor side by side.
Stars: ✭ 39 (+30%)
Mutual labels:  blazor
toast ui.blazor calendar
Toast UI Calendar Wrapper For Blazor
Stars: ✭ 42 (+40%)
Mutual labels:  blazor
BlazorIntersectionObserver
🔎 Intersection Observer API wrapper for Blazor applications
Stars: ✭ 35 (+16.67%)
Mutual labels:  blazor
BlazorDateRangePicker
A Blazor component for choosing date ranges and dates
Stars: ✭ 137 (+356.67%)
Mutual labels:  blazor
regression-wasm
Testing doing basic regression with web assembly
Stars: ✭ 32 (+6.67%)
Mutual labels:  web-assembly
CodeIndex
A Code Index Searching Tools Based On Lucene.Net
Stars: ✭ 28 (-6.67%)
Mutual labels:  blazor

blazor.jwttest

Quick test using JWT authentication for a blazor hosted (Client/Serverside) app with API and Authentication.

Nothing Special, it simply has a login form, a changing nav bar based on login state, a small PostgreSQL based data layer that's designed to work with a postgres data base via EF Core (But should work with any DB that EF core supports)

It's not designed to be a mainstream project, it's me learning Blazor and trying to adopt the same ideas and programming model I already use for my Aurelia/.NET Core applications.

The template is more or less feature complete to what I wanted to make it do, it does however still run on Blazor 0.6.0 (See issue 1 in the issues for the reason)

features

  • JWT based token authentication
  • Roles from user record in database are used to prevent navigation to pages the logged in user does not have access too, and also protect the rest endpoints in the server
  • Custom component's and event based communication to parent pages
  • Generic design where permitted
  • all cross platform, dotnet core throughout
  • Entity framework datalayer, which will build initial database if run on an empty DB server, and seed data
  • Singleton based application state, accessible throughout the app

Note

This MUST be run on an empty PostgreSQL database. You'll need to update the connection string in the app settings file in the server project, then when run the app will create the two tables it needs and seed an initial user called "admin" with password "letmein"

If there are ANY objects at all in the DB your running against, the create will fail, and then when you run the app, you'll get errors about the tables not existing, I'll add some SQL scripts later on for those who want to create tables manually.

This should be useable against other DB's (since it uses EF) but I've not tested it, so you'll need to do some work yourself for that. It's all portable code however, and this is really just me playing around with and testing Blazor out, so don't expect amazing code :-)

Credit

Credit where credit is due, some large chunks of the code in here came from Chris Saintly at Codedaze.io and his article on doing JWT in a blazor app, I'd also like to say thanks to @SQL-MisterMagoo and @kswoll in the Blazor gitter group for pointers on component communication, and overriding the HTTP client to get better error handling.

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].