Authentication & Profile Management
Relevant source files
The following files were used as context for generating this wiki page:
Authentication and Profile Management in LuCI Mobile handles the secure storage and handling of OpenWrt router credentials. The system allows users to save multiple router configurations, called profiles, and switch between them to manage different network environments.
The application communicates directly with the router's LuCI RPC interface. It stores sensitive information locally on the mobile device using encryption to ensure that credentials are never exposed to external servers or third-party analytics.
Sources: README.md:31-33, PRIVACY_POLICY.md:12-19, fastlane/metadata/android/en-US/full_description.txt:9-11
Profile Architecture
LuCI Mobile manages router information through a profile-based system. Each profile acts as a container for specific connection details. Users can configure a primary address and an optional fallback address for each router to maintain access when switching between local and remote networks.
Profile Components
A router profile consists of several key data points required for successful communication with the LuCI RPC system:
- Connection Address: The IP address or hostname of the router.
- Fallback Address: An alternative address for accessing the router from a different network.
- User Credentials: The username and password authorized to access the LuCI web interface.
- Security Settings: Configuration for HTTP or HTTPS schemes and self-signed certificate trust.
Sources: README.md:31-32, PRIVACY_POLICY.md:14-15, fastlane/metadata/android/en-US/full_description.txt:30-31
Data Storage Flow
The application uses the flutter_secure_storage package to persist profile data. This ensures that the router's IP, username, and password remain encrypted on the device's local storage.
The diagram above illustrates the path of user credentials from input to secure local storage.
Sources: pubspec.yaml:45, PRIVACY_POLICY.md:16-18
Authentication Process
The authentication flow involves validating user-provided credentials against the router's LuCI RPC service. LuCI Mobile requires that the router has rpcd-mod-luci installed to handle these requests.
Authentication Workflow
When a user attempts to connect, the application follows a specific sequence to establish a session:
The sequence diagram shows the interaction between the mobile client and the router's RPC modules during a login attempt.
Sources: README.md:104-105, fastlane/metadata/android/en-US/full_description.txt:30-31
Security Requirements
Secure communication is maintained through several protocols:
- HTTPS Support: The app supports encrypted connections to the router.
- Certificate Handling: The app prompts the user to manually trust self-signed certificates after verifying the fingerprint.
- Local-Only Transmission: All authentication data is strictly transmitted between the mobile device and the router; no data is sent to the app developer or third parties.
Sources: README.md:71-73, PRIVACY_POLICY.md:29-33
Profile Configuration Parameters
The following table describes the parameters used within the profile management system for each router entry.
| Parameter | Type | Description |
|---|---|---|
Address | String | Primary IP or hostname (e.g., 192.168.1.1). |
Fallback Address | String | Secondary address for remote/alternative network access. |
Username | String | Router administrator username (default: root). |
Password | String | Router administrator password. |
Scheme | String | Connection protocol (HTTP or HTTPS). |
Certificate Fingerprint | String | Stored fingerprint for trusted self-signed certificates. |
Sources: README.md:31-33, PRIVACY_POLICY.md:14-15, fastlane/metadata/android/en-US/full_description.txt:30-31
Troubleshooting Authentication
Common authentication failures are typically related to router-side configuration or network reachability.
- Credential Verification: Ensure the username and password have administrator permissions in the LuCI interface.
- Module Requirements: The router must have
rpcd-mod-luciandrpcd-mod-iwinfoinstalled for the app to function after login. - Parallel Request Limits: Some routers stall if multiple requests are made simultaneously. The project recommends limiting
uhttpdto one request at a time if timeouts occur. - Network Route: Users must verify the scheme, port, firewall settings, and VPN routes if the app cannot reach the router address.
Sources: README.md:112-126, CONTRIBUTING.md:126-128
Summary
Authentication and Profile Management in LuCI Mobile prioritizes user privacy and local security. By utilizing flutter_secure_storage, the app ensures credentials remain on-device and encrypted. The profile system provides flexibility for managing multiple OpenWrt routers across different networks while maintaining a direct, serverless connection between the app and the hardware.
Sources: PRIVACY_POLICY.md:21-27, fastlane/metadata/android/en-US/full_description.txt:9-11