Authentication & Networking
Relevant source files
The following files were used as context for generating this wiki page:
Conduit manages native mobile networking to connect users with Open WebUI servers, direct model endpoints, and self-hosted agents. The system handles complex authentication paths and enterprise networking environments, including reverse proxies and custom header requirements.
Your device communicates directly with the configured provider. No data routes through a backend operated by the application maintainer. Sources: README.md:99-102, README.md:214-216
Connection Architecture
Conduit supports multiple connection types, each with specific authentication and networking requirements.
Connection Types and Providers
| Connection Type | Supported Providers | Authentication Method |
|---|---|---|
| Open WebUI | Self-hosted Open WebUI servers | LDAP, JWT, SSO, OAuth, Password |
| Direct | OpenAI, Ollama, OpenRouter, LM Studio | API Keys, Custom Headers |
| Apple Native | Apple Intelligence (On-Device, PCC) | Platform entitlements (No API Key) |
| Hermes | Self-hosted Hermes agents | Server API Key |
Sources: README.md:104-138
Networking Logic Flow
This diagram shows how Conduit establishes a connection based on the chosen backend.
Sources: README.md:144-156, README.md:167-195
Authentication Methods
Conduit implements specialized handling for diverse authentication protocols to support self-hosted infrastructure.
Identity Management
The application supports every authentication path offered by Open WebUI, including:
- Standard Username and Password.
- LDAP (Lightweight Directory Access Protocol).
- Manual JWT (JSON Web Token) entry.
- Single Sign-On (SSO) and OAuth providers.
Sources: README.md:148-150
Reverse Proxy Support
Conduit maintains session state behind various reverse proxy solutions by capturing cookies and session data on-device. Supported proxies include:
oauth2-proxy- Authelia and Authentik
- Pangolin
- Cloudflare Tunnel
Sources: README.md:151-152
Credential Security
Conduit never stores credentials in plain-text local storage. It utilizes platform-specific secure storage:
- iOS: Keychain
- Android: Keystore
Sources: README.md:155-156, README.md:211-212
Networking Implementation
The networking layer utilizes high-performance Dart libraries to support real-time features like token streaming.
Core Dependencies
The system relies on the following networking and protocol libraries:
| Library | Purpose |
|---|---|
dio | Primary HTTP client for REST APIs |
web_socket_channel | Token-by-token streaming |
socket_io_client | Real-time events and terminal sessions |
openai_dart | OpenAI-compatible endpoint protocol |
ollama_dart | Native Ollama API integration |
Sources: pubspec.yaml:50-57, packages/conduit_core/pubspec.yaml:13-30
Request Customization
During setup, you can add custom headers required by your environment. This is essential for organizations using:
X-API-KeyAuthorization- Organization-specific routing headers.
Sources: README.md:153-154
Data Streaming
Conduit implements token-by-token streaming over WebSockets. This ensures the transcript remains stable as responses grow and allows long conversations to load without stalling the user interface. Sources: README.md:144-146
Streaming Sequence Diagram
This diagram illustrates the flow of a streaming chat request.
Sources: README.md:144-146, pubspec.yaml:50-57
Conclusion
The Authentication and Networking systems in Conduit provide a secure, native bridge to diverse AI backends. By prioritizing platform-native secure storage and robust cookie management, the project supports enterprise-grade self-hosted deployments and real-time streaming interactions.