The RocketMQ Dashboard Tauri application uses a file-based authentication system. Credentials are stored in a configuration file and verified by the Rust backend.
When you first run the application, it will create a default configuration with:
- Username:
admin - Password:
admin123
The authentication configuration is stored in:
C:\Users\<YourUsername>\AppData\Roaming\com.rocketmq-rust.dashboard\auth_config.json
~/Library/Application Support/com.rocketmq-rust.dashboard/auth_config.json
~/.config/rocketmq-rust-dashboard/auth_config.json
{
"username": "admin",
"password_hash": "hashed_password_value"
}Note: The password is stored as a hash, not plain text.
- Stop the application
- Delete the
auth_config.jsonfile - Restart the application
- A new configuration with default credentials will be created
- Login with default credentials and change password through UI (future feature)
You can manually edit the configuration file, but you'll need to generate the password hash using the application's hashing algorithm.
For testing purposes, you can use the default hash values:
| Password | Hash |
|---|---|
admin123 |
(generated on first run) |
- ✅ Password hashing (not plain text storage)
- ✅ File-based configuration
- ✅ Secure Rust backend verification
- ✅ Frontend validation through Tauri commands
- Use stronger hashing (bcrypt/argon2) instead of default hasher
- Add password change functionality in UI
- Support multiple users
- Add role-based access control (RBAC)
- Session management with timeouts
- Password complexity requirements
- Account lockout after failed attempts
- Audit logging
- Check credentials: Ensure you're using correct username/password
- Reset configuration: Delete
auth_config.jsonand restart - Check logs: Look for authentication errors in the application logs
The configuration file is created automatically on first run. If it's missing:
- Restart the application
- Check application logs for errors
- Verify you have write permissions to the config directory
Since passwords are hashed, they cannot be retrieved. To reset:
- Stop the application
- Delete
auth_config.json - Restart the application (default credentials will be created)
- Login with
admin/admin123
When running in development mode, the application will:
- Create configuration in the development config directory
- Log authentication attempts at INFO level
- Show detailed error messages
The auth.rs module includes unit tests for:
- Password hashing consistency
- Credential verification
- Password update functionality
Run tests with:
cd src-tauri
cargo testPurpose: Verify user credentials
Parameters:
username: String- The username to verifypassword: String- The password to verify
Returns: LoginResponse
interface LoginResponse {
success: boolean;
message: string;
}Example Usage (TypeScript):
import {invoke} from '@tauri-apps/api/core';
const result = await invoke<{success: boolean; message: string}>('verify_login', {
username: 'admin',
password: 'admin123'
});
if (result.success) {
// Login successful
console.log('Logged in successfully');
} else {
// Login failed
console.error('Login failed:', result.message);
}For production use, update src-tauri/Cargo.toml:
[dependencies]
# Add secure password hashing
bcrypt = "0.15"
# OR
argon2 = "0.5"Then update src-tauri/src/auth.rs to use the stronger hashing algorithm.
Example with bcrypt:
use bcrypt::{hash, verify, DEFAULT_COST};
fn hash_password(password: &str) -> String {
hash(password, DEFAULT_COST).expect("Failed to hash password")
}
fn verify_password(password: &str, hash: &str) -> bool {
verify(password, hash).unwrap_or(false)
}Last Updated: 2026-02-04 Version: 0.1.0