How timokoessler/2faguard works
2FAGuard is a Windows TOTP authenticator. Its main user workflow is to add tokens (by importing or entering details), unlock access, and view or export codes. The desktop app and CLI share core authentication, token, and storage services; optional Windows Hello and WebAuthn provide additional authentication. The graph includes README-documented capabilities whose wiring was not sampled, but leaves those links unverified rather than implying specific calls. Evidence is limited to the supplied excerpts, SOURCE INDEX references, and README.
Main entry points: Auth.cs Authentication · GetCodeCommand.cs Get code · TokenManager.cs Token manager · Program.cs CLI entry
Components 19
Desktop app
- Desktop app
Guard.WPF/MainWindow.xaml.cs - Add token
Guard.WPF/Views/Pages/Add - Bridge server
Guard.WPF/Core/CliBridge/CliBridgeServer.cs - Localization
Guard.WPF/Core/I18n.cs
Token workflows
- Token manager
Guard.WPF/Core/TokenManager.cs - Token import
Guard.WPF/Core/Import - Token export
Guard.WPF/Core/Export - TOTP helper
Guard.Core/Models/TOTPTokenHelper.cs
Security and access
- Authentication
Guard.Core/Security/Auth.cs - Encryption
Guard.Core/Security/EncryptionHelper.cs - Windows Hello
Guard.Core/Security/WindowsHello.cs - WebAuthn
Guard.Core/Security/WebAuthn/WebAuthnHelper.cs
Local persistence
- Token database
Guard.Core/Storage/Database.cs - Settings
Guard.Core/Storage/SettingsManager.cs
Command line
- CLI entry
Guard.CLI/Program.cs - Get code
Guard.CLI/Commands/GetCodeCommand.cs - List tokens
Guard.CLI/Commands/ListCommand.cs - Desktop bridge
Guard.CLI/Core/CliDesktopBridgeClient.cs
Other components
- User
Connections 21
- User → Desktop app: uses
- User → Add token: adds tokens
- User → Token import: imports tokens
- User → Token export: exports tokens
- Token manager → Token database: loads tokens
Guard.WPF/Core/TokenManager.cs - Token manager → TOTP helper: builds helpers
Guard.WPF/Core/TokenManager.cs - Token manager → Authentication: checks login
Guard.WPF/Core/TokenManager.cs - TOTP helper → Encryption: uses
Guard.Core/Models/TOTPTokenHelper.cs - CLI entry → Get code: registers
Guard.CLI/Program.cs - CLI entry → List tokens: registers
Guard.CLI/Program.cs - Get code → Token database: reads tokens
Guard.CLI/Commands/GetCodeCommand.cs - Get code → TOTP helper: uses
Guard.CLI/Commands/GetCodeCommand.cs - Get code → Desktop bridge: requests codes
Guard.CLI/Commands/GetCodeCommand.cs - Authentication → Encryption: uses
Guard.Core/Security/Auth.cs - Authentication → Windows Hello: invokes
Guard.Core/Security/Auth.cs - Authentication → WebAuthn: uses
Guard.Core/Security/Auth.cs - WebAuthn → Encryption: uses
Guard.Core/Security/WebAuthn/WebAuthnHelper.cs - Settings → Desktop app: initializes
- Desktop app → Localization: uses
- CLI entry → Token database: initializes context
- Desktop bridge → Bridge server: communicates