Skip to content

ricardodemauro/Labs.JwtAuthentication

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Demo code of JWT Authentication with C# .NET 8

Author: @rmauro.dev

Valid Http Request to Generate a JWT Token

POST /connect/token HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded

grant_type=password&username=johndoe&password=A3ddj3wr

TO-DO

MVP

  • Add authentication / authorization control over the routes
  • Add method to read jwt token from incoming request

Phase-2

  • Add Authorization Policies
  • Check the username and password against some database or external datasource
  • Load the user claims from a database
  • Add samples with Asp.NET MVC
  • Create a OpenAI/Swagger documentation