How to set two-factor authentication in a Niagara Station (Gauth)
Two-factor authentication (2FA) adds an additional layer of security to Niagara Station access by requiring both a password and a time-based one-time password (TOTP) from an authenticator app. This guide covers configuring Google Authenticator (Gauth) for Niagara 4 Stations.
Overview
Two-factor authentication enhances security by requiring:
- Something you know: Your Station password
- Something you have: A time-based code from Google Authenticator
This prevents unauthorised access even if passwords are compromised.
Prerequisites
Before configuring 2FA, ensure you have:
- Administrative access to the Niagara Station
- A mobile device (smartphone or tablet)
- Google Authenticator app installed on your mobile device
- Access to Station user management
Understanding Two-Factor Authentication in Niagara
How It Works
- User Registration: Users register their authenticator app with the Station
- QR Code Generation: Station generates a QR code containing secret key
- App Configuration: User scans QR code with Google Authenticator
- Login Process: User enters password and TOTP code when logging in
- Verification: Station verifies both password and TOTP code
Supported Authenticator Apps
- Google Authenticator (recommended)
- Microsoft Authenticator
- Authy
- Any TOTP-compatible authenticator app
Step-by-Step Configuration
Step 1: Enable Two-Factor Authentication Service
- Open Niagara Workbench
- Connect to your target Station
- Navigate to Services in the Station tree
- Locate or create the Two-Factor Authentication Service
If the service doesn't exist:
- Right-click on Services
- Select New → Service → Two-Factor Authentication Service
- Enter a name (e.g., "2FA Service")
- Click OK
Step 2: Configure 2FA Service Properties
-
Right-click on the Two-Factor Authentication Service
-
Select Properties
-
Configure service settings:
- Enabled: Enable the service
- Issuer Name: Name displayed in authenticator app (e.g., "Niagara Station")
- Secret Key Length: 32 characters (default, recommended)
- Time Step: 30 seconds (default, standard TOTP)
- Code Length: 6 digits (default)
- Backup Codes: Enable backup code generation (recommended)
Step 3: Enable 2FA for User Accounts
- Navigate to Users in the Station tree
- Select the user account requiring 2FA
- Right-click and select Properties
- Navigate to Security or Authentication tab
- Enable Two-Factor Authentication
- Click OK to save
Step 4: Register Authenticator App for User
For each user requiring 2FA:
- User Login: User logs into Workbench or Web Supervisor
- 2FA Prompt: System prompts user to configure 2FA
- QR Code Display: Station displays QR code
- Scan QR Code: User opens Google Authenticator app
- Add Account: Tap + or Add Account
- Scan QR Code: Select Scan QR Code and scan the displayed code
- Verify Setup: Enter the 6-digit code displayed in the app
- Save Backup Codes: User saves backup codes in a secure location
Step 5: Test Two-Factor Authentication
- Logout: User logs out of the Station
- Login Attempt: User attempts to log in
- Password Entry: User enters username and password
- TOTP Prompt: System prompts for TOTP code
- Code Entry: User enters 6-digit code from Google Authenticator
- Verification: System verifies code and grants access
Step 6: Configure Backup Codes (Recommended)
- During 2FA setup, generate backup codes
- Provide backup codes to user securely
- User stores backup codes in a safe location
- Backup codes can be used if authenticator app is unavailable
User Registration Process
For Station Administrators
When enabling 2FA for users:
- Notify Users: Inform users that 2FA is being enabled
- Provide Instructions: Share setup instructions with users
- Support: Be available to assist with setup if needed
- Backup Codes: Ensure users receive and store backup codes
For End Users
When setting up 2FA:
- Install App: Install Google Authenticator on mobile device
- Access Station: Log into Station (one-time password-only access)
- Follow Prompts: Complete 2FA setup when prompted
- Test Login: Verify 2FA works by logging out and back in
- Store Backup Codes: Save backup codes securely
Configuration Options
Service-Level Settings
Configure global 2FA settings:
- Enforcement: Require 2FA for all users or allow opt-in
- Grace Period: Allow time for users to set up 2FA
- Backup Code Policy: Configure backup code generation and usage
- Session Duration: Set how long 2FA remains valid per session
User-Level Settings
Per-user 2FA configuration:
- 2FA Status: Enabled/Disabled per user
- Registration Status: Track which users have registered
- Last Used: Monitor last 2FA usage
- Backup Codes: Manage user backup codes
Troubleshooting
QR Code Not Scanning
If QR code cannot be scanned:
- Display Quality: Ensure QR code is clearly displayed
- Screen Brightness: Increase screen brightness
- App Version: Update Google Authenticator to latest version
- Manual Entry: Use manual entry option with secret key
- Alternative Method: Try different device or app
Invalid TOTP Codes
If codes are being rejected:
- Time Synchronisation: Ensure device time is synchronised
- Code Timing: Enter code within the 30-second window
- Code Entry: Verify all 6 digits are entered correctly
- Service Configuration: Check Time Step setting matches standard (30 seconds)
- Clock Drift: Check for significant time differences between devices
Lost Authenticator Access
If user loses access to authenticator app:
- Backup Codes: Use backup codes to regain access
- Administrator Reset: Administrator can reset 2FA for user
- Re-registration: User must re-register authenticator app
- Prevention: Encourage users to store backup codes securely
Service Not Starting
If 2FA service fails to start:
- Check Logs: Review service logs for error messages
- Service Status: Verify service is enabled
- Dependencies: Check for required service dependencies
- Configuration: Review service configuration for errors
- Restart Service: Try restarting the service
Security Best Practices
Implementation
- Gradual Rollout: Enable 2FA gradually, starting with administrators
- User Training: Provide training and documentation to users
- Support: Establish support process for 2FA issues
- Monitoring: Monitor 2FA usage and issues
User Management
- Backup Codes: Always generate and securely provide backup codes
- Account Recovery: Establish account recovery process
- User Education: Educate users on 2FA importance and usage
- Regular Review: Periodically review 2FA registrations
Security Considerations
- Secret Key Storage: Ensure secret keys are stored securely
- Backup Code Security: Protect backup codes appropriately
- Session Management: Configure appropriate session durations
- Audit Logging: Enable audit logging for 2FA events
Advanced Configuration
Custom TOTP Parameters
For advanced configurations:
- Time Step: Adjust time step (typically 30 seconds)
- Code Length: Change code length (typically 6 digits)
- Hash Algorithm: Configure hash algorithm (typically SHA1)
- Clock Tolerance: Set clock drift tolerance
Integration Options
2FA can be integrated with:
- LDAP: Combine with LDAP authentication
- Single Sign-On: Integrate with SSO solutions
- Custom Authentication: Extend with custom authentication modules
Related Topics
- How to setup an Email Service in a Niagara Station (Gmail)
- How to setup LDAP integration in a Niagara Station
- What to do when a Platform login is failing
Additional Resources
- Google Authenticator Documentation
- Niagara 4 Security Guide
- Two-Factor Authentication Best Practices
- TOTP RFC 6238 Specification