YouTube-JwtAuthAspNet7WebAPI
YouTube-JwtAuthAspNet7WebAPI copied to clipboard
In this repository, we implement authentication and authorization using JWT in a new Asp.NET 7 WebAPI project.
title: ASP.NET 7 Web API JWT Authentication and Role-Based Authorization last update: '2023-Dec-17'
ASP.NET 7 Web API JWT Authentication and Role-Based Authorization
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:
- https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.JwtBearer
- https://www.nuget.org/packages/Microsoft.AspNetCore.Identity.EntityFrameworkCore
- https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer
- https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Tools
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.