This project is the Authentication Service for the TODO application. It provides JWT-based authentication and refresh token support.
- .NET 9
- Minimal APIs (endpoint-based routing)
- JWT Authentication
- Entity Framework Core (PostgreSQL)
- Clean Architecture (Domain, Application, Infrastructure, API layers)
All routes are prefixed by /api/auth and typically routed through the API Gateway.
POST /api/auth/login— Login with email and passwordPOST /api/auth/register— Register a new userPOST /api/auth/refresh-token— Get a new access token using a refresh tokenPOST /api/auth/logout— Invalidate the current refresh token
- Login returns an access token (JWT) and a refresh token.
- The access token is used in
Authorization: Bearer <token>headers for authenticated requests. - When the access token expires, the refresh-token endpoint can be used to get a new one.
- On logout, the refresh token is revoked and cannot be reused.
API/– Entry point with mapped endpointsManagers/– Auth manager implementing business logicServices/– Token generation, hashing, and identity abstractionData/– EF Core entities and repositories
MIT — see LICENSE file.