53GB

.NET 7 Web API πŸ”’ JWT Authentication and role-based Authorization



.NET 7 Web API πŸ”’ JWT Authentication and role-based Authorization

#aspdotnetcore #dotnet #jwt
A step-by-step guide to user authentication using ASP.NET Core 7, Identity, MSSQL
Create a minimal API project in Visual Studio 2022.
πŸ’» GitHub: https://github.com/shahedbd/API.UserManagement

πŸš€ Table of Contents:
βœ… 1. Create Project: Using Visual Studio 2022
– API Project, Dotnet 7.0, and a class library project for data connectivity and migration

βœ… 2. Install the Required Packages
dotnet add package Microsoft.AspNetCore.Authentication.JwtBearer –version 7.0.4
dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore –version 7.0.4
dotnet add package Microsoft.EntityFrameworkCore.SqlServer –version 7.0.4
dotnet add package Microsoft.EntityFrameworkCore.Tools –version 7.0.4

βœ… 3. Database connection: MSSQL: appsettings.json
βœ… 4. Create models and complete ApplicationDbContext class
βœ… 5. Update program.cs: AddDbContext
βœ… 6. Database Migration
dotnet ef migrations add InitialCreate
dotnet ef database update
β€” using PMC
PM: add-migration initcreate
PM: update-database

βœ… 7. Create Auth Controller
βœ… 8. Crete Auth Service

βœ… 9. Test API using postman
βœ… 10. Deploy to IIS
βœ… 11. Test API from IIS hosting

πŸš€ Main Profile:
https://1.envato.market/7mA73y

βœ… Business ERP Solution/Product/POS/Company Management:
https://1.envato.market/AoMzyj

βœ… School/College/University Management ERP:
https://1.envato.market/15NBrd

βœ… Dashboard Template | ASP.NET Core MVC Web Starter Kit
https://1.envato.market/JrEGWa

βœ… Advance POS System with Stock Manager | ASP.NET Core | EF Core | .NET Core 6.0:
https://1.envato.market/9WQxbW

βœ… Asset Management System with Barcode | ASP.NET Core | EF Core | .NET Core 6.0:
https://1.envato.market/qnNkey

βœ… Advanced Files & Users Management | ASP.NET Core | EF Core | .NET Core | MSSQL | MySQL:
https://1.envato.market/DVaRBq

βœ… Hospital and Pharmacy Management System | ASP.NET Core | EF Core:
https://1.envato.market/OR5o6N

βœ… Inventory and User Management System:
https://1.envato.market/jW221P

βœ… Invoice Gen(Invoice Generation and Management) using .Net Core and EF:
https://1.envato.market/0JOOm3

βœ… Complaint | Issue | Helpdesk Ticket | My Ticket HelpDesk Support System | ASP.NET Core | EF Core:
https://1.envato.market/MXjj5P

βœ… User Management:
https://1.envato.market/WDE2JO

βœ… ASP.NET Core CRUD Operation Using Dot Net 6.0 | MVC| MSSQL | MySQL | EF Core Code First | jQuery
https://1.envato.market/b3Yeg9

βœ… ASP.NET Core full CRUD with .NET 5 | MSSQL/MySQL | EF code first:
https://1.envato.market/OR551W

βœ… Staff | Employee Leave Management System
https://1.envato.market/rnjYzd

βœ… Library Management System | ASP.NET Core | MSSQL | Code First
https://1.envato.market/YgWWgR

Exit mobile version