Authentication Overview
Introduction
The BankLingo authentication system provides secure access control for both administrators and customers. It supports multiple verification methods including email OTP, SMS OTP, and TOTP authenticator apps (Google Authenticator, Microsoft Authenticator, etc.).
Authentication Methods
1. Password-Based Login
All users authenticate initially with their email/username and password. After successful password validation, a two-factor authentication (2FA) step is required.
2. Two-Factor Authentication (2FA)
The system supports three verification methods for 2FA:
| Method | verificationMethodType | Description |
|---|---|---|
| Default | 0 | Uses the user's preferred method (email or SMS) |
| Email OTP | 1 | One-time password sent via email |
| SMS OTP | 2 | One-time password sent via SMS |
| Authenticator App | 3 | TOTP code from authenticator app |
Authentication Flow
Standard Login Flow
Authenticator App Setup Flow
API Endpoints
Admin Login
- Endpoint:
/api/BPMSelfService/commands/SelfAdminLoginCommand - Method: POST
- Purpose: Administrator login with 2FA support
- View Details →
Customer Login
- Endpoint:
/api/BPMSelfService/commands/SelfLoginCommand - Method: POST
- Purpose: Customer login with 2FA support
- View Details →
OTP Validation
- Endpoint:
/api/BPMSelfService/commands/ValidateOtpCommand - Method: POST
- Purpose: Validate email/SMS OTP or TOTP codes
- View Details →
Resend OTP
- Endpoint:
/api/BPMSelfService/commands/ResendOtpCommand - Method: POST
- Purpose: Resend OTP for email/SMS methods
- View Details →
Authenticator Setup
- Purpose: Complete guide for setting up authenticator apps
- View Details →
Authenticator Login
- Purpose: Using authenticator apps for login
- View Details →
Refresh Token
- Purpose: Refresh JWT access tokens
- View Details →
Security Features
TOTP (Time-based One-Time Password)
- Standard: RFC 6238
- Algorithm: HMAC-SHA1
- Key Length: 160 bits (20 bytes)
- Code Length: 6 digits
- Time Step: 30 seconds
- Time Window: ±30 seconds (for clock drift tolerance)
Password Security
- Passwords are hashed using strong cryptographic algorithms
- Password complexity requirements enforced
- Account lockout after multiple failed attempts
JWT Tokens
- Tokens are signed using secure algorithms
- Short expiration times with refresh token support
- Include claims for user identity, roles, and permissions
Common Response Codes
| Status Code | Description |
|---|---|
200 | Success |
400 | Bad request (invalid parameters) |
401 | Unauthorized (invalid credentials or token) |
403 | Forbidden (insufficient permissions) |
404 | User not found |
500 | Internal server error |
Best Practices
For Frontend Developers
- Always use HTTPS for authentication endpoints
- Store JWT tokens securely (HttpOnly cookies recommended)
- Clear tokens on logout to prevent unauthorized access
- Handle token expiration gracefully with refresh tokens
- Never log sensitive data (passwords, OTPs, tokens)
For Security
- Implement rate limiting on login endpoints
- Monitor failed login attempts for suspicious activity
- Use strong password policies (minimum length, complexity)
- Enable 2FA for all users when possible
- Regular security audits of authentication logs
For Authenticator Apps
-
Recommend popular authenticator apps:
- Google Authenticator
- Microsoft Authenticator
- Authy
- LastPass Authenticator
-
Provide backup codes in case user loses access to authenticator
-
Allow account recovery through alternative methods
-
Test time synchronization issues
Testing
Testing Email/SMS OTP
- Use test environment with email/SMS capture
- Verify OTP delivery and expiration
- Test resend functionality
- Test rate limiting
Testing Authenticator Apps
- Test setup flow with QR code scanning
- Verify TOTP code validation
- Test time window tolerance
- Test with multiple authenticator apps
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
| Invalid OTP | Wrong code or expired | Request new OTP |
| Invalid TOTP | Wrong code or time sync issue | Check device time, try again |
| User locked out | Too many failed attempts | Wait for lockout period or contact admin |
| Setup required | Authenticator not configured | Complete setup flow |
Related Documentation
Support
For authentication issues or questions:
- Email: support@banklingo.com
- Documentation: https://banklingo.app/docs/developer-documentation
- Technical Support: See Support Portal