Skip to content

Latest commit

 

History

History
89 lines (60 loc) · 1.63 KB

File metadata and controls

89 lines (60 loc) · 1.63 KB

Master-Details CRUD Web API with JWT Authentication (ASP.NET 8)

This project demonstrates a secure ASP.NET Web API implementing Master-Details CRUD functionality with JWT-based authentication.


🔐 Key Features

  • ASP.NET Web API
  • JWT Authentication & Authorization
  • Entity Framework
  • SQL Server or LocalDB
  • Master-Details Entity Relationship
  • CRUD Endpoints
  • Swagger UI with JWT support

📦 Technologies Used

  • ASP.NET
  • Entity Framework
  • Microsoft IdentityModel.Tokens
  • System.IdentityModel.Tokens.Jwt
  • Swagger

🔧 Installation & Run

1. Prerequisites

  • .NET 8 SDK
  • Visual Studio 2022
  • SQL Server or LocalDB

2. Clone Repository

git clone https://github.com/smraju115/MasterDetails-WebAPI-JWT.git
c
Configure appsettings.json

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=.;Database=ProjectDb;Trusted_Connection=True;"
  },
  "JwtSettings": {
    "SecretKey": "YourStrongSecretKey123456!",
    "Issuer": "your-app",
    "Audience": "your-app-users",
    "ExpiryMinutes": 60
  }
}
4. Run Migrations & Create DB

dotnet ef database update
5. Run the Application

🔐 JWT Authentication
🔑 Login Endpoint



🧠 Project Structure
📦MasterDetails-WebAPI-JWT
 ┣ 📁Controllers
 ┣ 📁Models
 ┣ 📁DTOs
 ┣ 📁Data
 ┣ 📜Program.cs
 ┗ 📜appsettings.json



JWT tokens are signed with a secure symmetric key

Protected endpoints require [Authorize] attribute

Role-based authorization 

📄 License

This project is licensed under the MIT License.

👨‍💻 Author

Created by S. M. SHAHAJALAL RAJU