Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.99 KB

File metadata and controls

56 lines (39 loc) · 1.99 KB
title ASP.NET 7 Web API JWT Authentication and Role-Based Authorization
last update 2024-Sep-28

GitHub last commit

ASP.NET 7 Web API JWT Authentication and Role-Based Authorization

Updates

  • 2024/09 (V4)
    • .Net 8
    • Improve Program.cs
    • Add IdentityRole + Custom Stores + Custom ClaimPrincipalFactory

What is this repository about?

JWT(Json Web Token) is one of the most popular ways to implement authentication and role-based authorization in WebAPI Projects. It uses claims and manage your security.

In this repository, we create a new .Net 7 WebAPI project from scratch and implement Fully authentication and authorization in it.

YouTube Tutorial Link:

https://www.youtube.com/watch?v=KRVjIgr-WOU

We use these packages:

  • "Microsoft.AspNetCore.Authentication.JwtBearer"
  • "Microsoft.AspNetCore.Identity.EntityFrameworkCore"
  • "Microsoft.EntityFrameworkCore.SqlServer"
  • "Microsoft.EntityFrameworkCore.Tools"

Link of used packages on nuget.org:

Topics covered in this repository:

  • Dtos
  • Static classes
  • Entities
  • Dependency injection
  • Refactoring
  • Git branches
  • Pull request
  • Identity Package
  • Custom User fields
  • Add request headers to swagger

💖 You can Buy me a coffee to support: https://www.buymeacoffee.com/DevEmpower 💖

Disclaimer: This repository is just a tutorial for beginners and it is not a commercial code. Use these Codes and functions on your responsibilities. Don’t forget that security is very important in any software and website and you must be aware of any functionality of codes of your projects.