Skip to content

amjadaz8s5-dev/SecureAuthLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 SecureAuthLab

A secure authentication Web API built with ASP.NET Core (.NET 10) that demonstrates modern authentication and authorization techniques using JWT, Refresh Tokens, and Entity Framework Core.

This project follows modern backend development practices and serves as the backend for the SecureAuthLab.React frontend application.


✨ Features

  • ✅ User Registration
  • ✅ Secure Login
  • ✅ JWT Authentication
  • ✅ Refresh Token Rotation
  • ✅ Protected API Endpoints
  • ✅ Logout Endpoint
  • ✅ Password Hashing
  • ✅ Entity Framework Core
  • ✅ SQL Server Integration
  • ✅ Swagger Documentation
  • ✅ CORS Configuration
  • ✅ Configuration using appsettings.json

🛠️ Technology Stack

Technology Version
.NET 10
ASP.NET Core Web API .NET 10
Entity Framework Core Latest
SQL Server Latest
JWT Bearer Authentication
Swagger / OpenAPI

📂 Project Structure

SecureAuthLab
│
├── Controllers
├── Data
├── DTOs
├── Models
├── Services
├── Migrations
├── Program.cs
├── appsettings.json
└── SecureAuthLab.csproj

🔐 Authentication Flow

Client Login
      │
      ▼
POST /api/auth/login
      │
      ▼
JWT + Refresh Token
      │
      ▼
Store Tokens
      │
      ▼
Access Protected APIs
      │
      ▼
JWT Expires
      │
      ▼
POST /api/auth/refresh-token
      │
      ▼
Generate New JWT
      │
      ▼
Retry Original Request

📌 API Endpoints

Method Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Authenticate user
POST /api/auth/refresh-token Generate a new JWT
POST /api/auth/logout Logout user
GET /api/auth/profile Get authenticated user profile

🚀 Getting Started

Clone the repository

git clone https://github.com/amjadaz8s5-dev/SecureAuthLab.git

Open the solution

SecureAuthLab.slnx

Configure the database

Update the connection string in:

appsettings.json

Example:

"ConnectionStrings": {
  "DefaultConnection": "Server=.;Database=SecureAuthLab;Trusted_Connection=True;TrustServerCertificate=True;"
}

Apply Migrations

dotnet ef database update

Run the project

dotnet run

🔗 Frontend

The React frontend is available in a separate repository:

https://github.com/amjadaz8s5-dev/SecureAuthLab.React


📚 What This Project Demonstrates

  • ASP.NET Core Web API Development
  • JWT Authentication
  • Refresh Token Rotation
  • Secure Password Hashing
  • Entity Framework Core
  • SQL Server
  • RESTful API Design
  • Dependency Injection
  • Authentication & Authorization
  • Swagger / OpenAPI Documentation

📈 Future Improvements

  • Role-Based Authorization (RBAC)
  • Email Verification
  • Forgot Password
  • Password Reset
  • Account Lockout
  • Two-Factor Authentication (2FA)
  • Serilog Logging
  • Docker Support
  • Unit & Integration Testing
  • CI/CD Pipeline
  • Redis Token Blacklisting

👨‍💻 Author

Amjad Ali Khan

Senior Full Stack .NET Developer

Technologies

  • ASP.NET Core
  • .NET
  • React
  • React Native
  • SQL Server
  • AWS

GitHub:

https://github.com/amjadaz8s5-dev


📄 License

This project is developed for educational and portfolio purposes.

About

ASP.NET Core (.NET 10) Web API demonstrating JWT authentication, refresh token rotation, Entity Framework Core, and secure REST API development.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages