How swarnayuroy/jwt-authentication-poc works
SampleAuthentication is a hybrid authentication and user-management product: an Angular client and an ASP.NET MVC client use an ASP.NET Core API, with a shared DataContext described as in-memory storage. The main workflow is credential submission, API authentication or account registration, then user-facing session/dashboard operations; account verification and password recovery are additional API capabilities. The graph also shows the API’s repository/service/data layers. Several implementation files were not sampled, so unverified internal links are omitted or marked dashed.
Main entry points: AccountRepository.cs Account repository · AccountController.cs Account endpoints · Program.cs API composition · UserRepository.cs User repository
Components 15
User clients
- Angular client
SampleAuthentication/angular-web/src/app/service/auth.service.ts - MVC web client
SampleAuthentication/web/Controllers/AccountController.cs - Web repository
SampleAuthentication/web/Repository/WebRepository.cs - HTTP data service
SampleAuthentication/web/Service/DataLayer/HttpDataService.cs
Authentication API
- Account endpoints
SampleAuthentication/API_Service/Controllers/AccountController.cs - User endpoints
SampleAuthentication/API_Service/Controllers/UserController.cs - Account repository
SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs - User repository
SampleAuthentication/API_Service/RepositoryLayer/Repository/UserRepository.cs - Data service
SampleAuthentication/API_Service/AppData/DataService/SampleDataService.cs - Authentication records
SampleAuthentication/API_Service/Models/Entities/User.cs
Data access
- Shared data context
SampleAuthentication/DataContext/DataService/IContextService.cs
Shared infrastructure
- JWT handling
SampleAuthentication/API_Service/Utils/JwtManager.cs - Login handoff
SampleAuthentication/API_Service/Utils/HandoffManager.cs - API composition
SampleAuthentication/API_Service/Program.cs
Other components
- User
Connections 17
- User → Angular client: uses
- User → MVC web client: uses
- Angular client → Account endpoints: posts credentials
SampleAuthentication/angular-web/src/app/service/auth.service.ts - MVC web client → Web repository: submits requests
SampleAuthentication/web/Controllers/AccountController.cs - Web repository → HTTP data service: calls HTTP service
SampleAuthentication/web/Repository/WebRepository.cs - HTTP data service → Account endpoints: HTTP/REST
- Account endpoints → Account repository: delegates
SampleAuthentication/API_Service/Controllers/AccountController.cs - User endpoints → User repository: delegates
SampleAuthentication/API_Service/Controllers/UserController.cs - Account repository → Authentication records: handles account data
- Account repository → Data service: uses data service
- User repository → Data service: uses data service
- Data service → Shared data context: accesses data
SampleAuthentication/API_Service/AppData/DataService/SampleDataService.cs - Account endpoints → JWT handling: issues tokens
- Account repository → Login handoff: consumes handoff
SampleAuthentication/API_Service/RepositoryLayer/Repository/AccountRepository.cs - API composition → Account repository: registers dependency
SampleAuthentication/API_Service/Program.cs - API composition → User repository: registers dependency
SampleAuthentication/API_Service/Program.cs - API composition → Account endpoints: maps controllers
SampleAuthentication/API_Service/Program.cs