How bs3dev/jwt-refresh-token works
Project type and purpose
• This is a .NET library implementing the “Refresh Token” pattern for JWT authentication.
• It follows Onion Architecture and is intended to be consumed by client applications (e.g., minimal API sample under /sample/Ui/...).
• It provides core services for issuing, refreshing, and revoking JWT access tokens, backed by configurable data stores (currently Azure Cosmos DB).
File structure
• Top-level folder src contains four projects:
• Domain (core entities, DTOs, service interfaces, configuration).
• Application (application-level services and interfaces, e.g. ITokenAppService).
• Infrastructure (two subfolders: one for Cosmos DB implementation, one for generic HTTP/serialization extensions).
• Tests (unit tests under Tests.Unit, integration tests under Tests.Integration.Cosmos).
• A separate sample folder holds a minimal .NET API demonstrating usage, with its own minimal controllers, Program.cs, and entities/repositories for credentials.
• Build pipelines live in .github/workflows/build.yml.
README for additional insights
• Confirms Onion Architecture layering: Infrastructure depends on Application, Application depends on Domain.
• Lists supported databases (Cosmos DB current, others planned).
• Describes registration in Program.cs (DI of CosmosClient, registration of services and endpoints).
Detailed capturing of essential elements
• JSON config being read by both API and Infrastructure for descriptor and Cosmos settings.
• Test flows separately if desired: Integration tests directly call TokenAppService with a fake repository or real CosmosClient.