This is a simple Web API built with ASP.NET Core 9 that demonstrates JWT Authentication and Role-based Authorization.
- User Registration and Login
- JWT Token generation
- Role-based access (User / Admin)
- Protected endpoints using
[Authorize] - Swagger UI for testing APIs
- ASP.NET Core 9 (C#)
- Entity Framework Core + SQL Server
- ASP.NET Identity
- JWT Authentication
- Swagger UI
POST /api/auth/register→ Register new userPOST /api/auth/login→ Login and get JWT tokenGET /api/secure/user→ Accessible to logged-in usersGET /api/secure/admin→ Accessible only to Admin