Auth Service Overview - daddeJ/user-auth-microservices GitHub Wiki

🔐 Auth Service Overview

Purpose: Manages authentication logic including login, password hashing, token generation, and validation for the system.

Project Path: user-auth-microservices/auth-service

Architecture Pattern:

  • Domain-Driven Design (DDD)
  • Onion Architecture
  • Clean Architecture principles

🧱 Core DDD Components

  • Entity: LoginSession.cs Represents the user's login session metadata/
  • Value Objects Could include HashedPassword, JwtToken, etc
  • Use Cases (Application Layer): -LoginUserHandler.cs -ValidateTokenHandler.cs -GenerateTokenHandler.cs
  • DTOs Used in the API for request/response models.

🔄 User Service Relationship

This service authenticates users registered in the user-service.

Concern Handled by
Credential Validation auth-service
Token creation & refresh auth-service
User profile data user-service

🔍 Testing Strategy

  • Unit Tests: Token logic, uses case flows
  • Integration Tests: Token validation with mocked user data
  • Uses Arrange-Act-Assert(AAA) methodology

🛠️ Tools & Technologies

  • .NET 8 / ASP.NET Core Web API
  • JWT for token management
  • Entity Framework Core
  • xUnit for testing
  • Docker