How groove-net/authservice works
AuthService provides registration, email confirmation, password login, MFA enrollment and verification, recovery-code use, and account-management use cases, exposed through REST endpoints and an AuthComponent gateway. Login validates input, loads the user, checks lockout and password state, persists login-attempt changes, then either returns success or issues a short-lived MFA challenge. The domain owns password and MFA rules; repositories and the unit of work persist state, while email and challenge services provide supporting integrations. README-only claims such as JWT/session handling and password-reset flows are not mapped as implemented components because the supplied tree does not show their source.
Main entry points: auth REST endpoints · AuthComponent.cs Auth gateway · UserLogin.cs User login · AuthDbContext.cs Unit of work
Components 23
Entry points
- REST endpoints
src/Auth/WebAPI.REST/Endpoints/auth - Auth gateway
src/Auth/AuthComponent.cs
Application workflows
- Register user
src/Auth/Application/UseCases/RegisterUser.cs - Confirm email
src/Auth/Application/UseCases/ConfirmEmail.cs - Send confirmation
src/Auth/Application/UseCases/SendEmailConfirmation.cs - User login
src/Auth/Application/UseCases/UserLogin.cs - Set up MFA
src/Auth/Application/UseCases/Setup2fa.cs - Confirm MFA
src/Auth/Application/UseCases/Confirm2fa.cs - Verify MFA
src/Auth/Application/UseCases/Verify2fa.cs - Use recovery code
src/Auth/Application/UseCases/UseRecoveryCode.cs - Disable MFA
src/Auth/Application/UseCases/Disable2fa.cs - Token pruning task
src/Auth/Application/BackgroundTasks/PruneExpiredTokens.cs
Identity domain
- User aggregate
src/Auth/Domain/Aggregates/UserAggregate/User.cs - User repository contract
src/Auth/Domain/Aggregates/UserAggregate/IUserRepository.cs
Persistence and integrations
- User repository
src/Auth/Infrastructure/AuthDb/Repositories/UserRepository.cs - Auth database
src/Auth/Infrastructure/AuthDb/AuthDbContext.cs - MFA challenge
src/Auth/Infrastructure/TwoFactorChallenge/TwoFactorChallenge.cs - Secret protection
src/Auth/AuthComponent.cs - SMTP sender
src/Auth/Infrastructure/EmailSender/SmtpEmailSender.cs - Unit of work
src/Auth/Infrastructure/AuthDb/AuthDbContext.cs - Domain event dispatcher
src/Auth/Infrastructure/AuthDb/DomainEventDispatcher.cs
Other components
- Client
- SMTP service
Connections 31
- Client → REST endpoints: sends requests
- Client → Auth gateway: calls gateway
- REST endpoints → Register user: dispatches
- REST endpoints → Confirm email: dispatches
- REST endpoints → Send confirmation: dispatches
- REST endpoints → User login: dispatches
- REST endpoints → Set up MFA: dispatches
- REST endpoints → Confirm MFA: dispatches
- REST endpoints → Verify MFA: dispatches
- REST endpoints → Use recovery code: dispatches
- REST endpoints → Disable MFA: dispatches
- Auth gateway → Register user: invokes
- Auth gateway → Confirm email: invokes
- Auth gateway → Send confirmation: invokes
- Auth gateway → User login: invokes
- Auth gateway → Set up MFA: invokes
- Auth gateway → Confirm MFA: invokes
- Auth gateway → Verify MFA: invokes
- Auth gateway → Use recovery code: invokes
- Auth gateway → Disable MFA: invokes
- User login → User repository contract: loads user
- User repository → User repository contract: implements
- User repository → Auth database: queries and writes
- User login → User aggregate: checks credentials
- User login → Unit of work: saves changes
- User login → MFA challenge: creates challenge
- MFA challenge → Secret protection: protects token
- Unit of work → Domain event dispatcher: dispatches events
- Unit of work → Auth database: commits changes
- SMTP sender → SMTP service: sends mail
- Token pruning task → User repository contract: prunes tokens