Skip to main content

Authentication & User Security

Audience: End users and technical evaluators Last Updated: 2026-04-04 Version: 2.0.0


Overview

Llamafin provides secure, flexible authentication that integrates seamlessly with your Jellyfin server. The system supports multiple login methods, automatic session management, and cryptographic security for peer-to-peer features.


Login Methods

Standard Username & Password

The traditional login method compatible with all Jellyfin servers:

How It Works:

  1. Enter your Jellyfin username and password
  2. Credentials sent securely to your Jellyfin server
  3. Server validates and returns an authentication token
  4. Token stored locally for automatic re-login

Security Features:

  • Passwords never stored locally
  • Server-side validation only
  • Encrypted transmission (HTTPS supported)
  • Token-based authentication with expiry

Quick Connect

Jellyfin's code-based authentication system:

How It Works:

  1. Initiate Quick Connect from your Jellyfin server's dashboard
  2. Server displays a 6-digit code
  3. Enter the code in Llamafin
  4. Instant login without typing credentials

Benefits:

  • No password entry required
  • Ideal for TV or shared device logins
  • Server-controlled authentication
  • Same security level as password login

Public User Selection

For multi-user households:

  • Login screen displays all enabled users
  • Click your user avatar to auto-fill username
  • Only password entry required
  • Server administrator controls user visibility

Session Management

Automatic Session Persistence

Once logged in, Llamafin remembers you:

What Gets Stored:

  • Authentication token (secure, server-issued)
  • User identifier (hashed for privacy)
  • Session expiry status

Where It's Stored:

  • Browser: IndexedDB (secure local storage)
  • Mobile: Capacitor Preferences (native storage)
  • Desktop: Application storage (platform-specific)

Session Rehydration

When you reopen Llamafin:

  1. Stored credentials automatically loaded
  2. Token validity checked
  3. User identity restored
  4. Library and player features initialised
  5. Real-time connection to server established

Result: Seamless experience - no re-login required

Session Expiry Detection

Llamafin monitors session health through:

Automatic Checks:

  • Every API call validates token status
  • Periodic health checks every 5 minutes while online
  • Server response monitoring for authentication failures

When Session Expires:

  • You're automatically returned to the login screen
  • No data loss - library and settings preserved
  • Re-login restores your complete session

Security Architecture

Password Security

Llamafin Never Stores Passwords:

  • Passwords sent only to Jellyfin server
  • No local password storage
  • No password caching
  • No password encryption keys stored

Transmission Security:

  • HTTPS support for encrypted transmission
  • Token-based auth after initial login
  • Server certificate validation

Token-Based Authentication

After login, Llamafin uses tokens instead of passwords:

How Tokens Work:

  1. Server issues unique authentication token
  2. Token attached to all subsequent requests
  3. Token identifies you without re-sending credentials
  4. Server can invalidate tokens if needed

Token Lifecycle:

  • Issued on successful login
  • Stored securely on device
  • Attached to API calls automatically
  • Validated on every server interaction
  • Removed on logout or expiry

User Identity Hashing

For privacy in peer-to-peer features:

SHA-256 Hashing:

  • User ID cryptographically hashed
  • Hash is one-way (cannot be reversed)
  • Used only for device discovery
  • Protects real user identity on network

Why This Matters:

  • Other devices see hash, not your username
  • Prevents username exposure on local network
  • Maintains P2P functionality
  • Zero-knowledge identity verification

Route Protection

Protected features require authentication:

Guarded Routes:

  • Home page
  • Library browsing
  • Search
  • Settings
  • Downloads

Public Routes (no login needed):

  • Login screen
  • Server information
  • Public user list

Navigation Guard:

  • Blocks access until session confirmed
  • Redirects to login if unauthenticated
  • Preserves intended destination for return

HTTP Security Pipeline

Six-Layer Interceptor System

Every HTTP request passes through security checks:

LayerFunctionWhat It Does
1. Server URLRoutingEnsures request goes to correct server
2. Error HandlingMonitoringCatches and logs network errors
3. AuthenticationToken InjectionAutomatically adds your auth token
4. Retry LogicReliabilityRetries failed requests automatically
5. Cache PreventionFreshnessPrevents stale data from cache
6. Unauthorized HandlerSession ManagementDetects invalid sessions

Token Injection

Automatic Process:

  1. Request intercepted before sending
  2. Authentication status checked
  3. If authenticated and token valid:
    • Token added to request header
    • Request sent to server
  4. If token expired:
    • Request stopped
    • Session expired event triggered
    • Return to login screen

Unauthorized Access Detection

What Triggers Detection:

  • HTTP 401 (Unauthorized) response
  • HTTP 403 (Forbidden) response
  • Token validation failures

Response to Detection:

  1. Session immediately invalidated
  2. All stored credentials cleared
  3. User redirected to login
  4. Clear indication of session expiry

Forgot Password Flow

Two-Step Recovery

Jellyfin's built-in password recovery:

Step 1: Initiate Recovery

  1. Enter your username on login screen
  2. Click "Forgot Password"
  3. Server determines recovery method:
    • Contact Admin: Administrator must reset
    • PIN Code: PIN file generated
    • In-Network Required: Must be on local network

Step 2: Complete Recovery

For PIN Code Method:

  1. Server displays PIN file image
  2. Note the PIN code shown
  3. Return to Llamafin login
  4. Enter PIN code when prompted
  5. Password reset successful
  6. Set new password via Jellyfin web interface

Important Notes:

  • PIN codes expire (server-controlled)
  • May require server administrator contact
  • Network location may matter for security

Multi-User Support

Public User Display

Server administrators can control login experience:

User Visibility Settings:

  • "Show on login screen" per user
  • Administrator controlled
  • Privacy for hidden accounts
  • Quick selection for family members

Login Screen Features:

  • User avatars displayed
  • One-click username selection
  • Password entry only required
  • Last login dates tracked

User Profiles

Each user maintains separate:

  • Authentication credentials
  • Library access permissions
  • Playback history
  • Downloaded content
  • Settings preferences
  • Playback queues

Complete Isolation:

  • No data shared between users
  • Separate offline downloads
  • Independent playback sessions
  • Individual settings

Peer-to-Peer Security

Llamafin Connect Identity

For remote control and remote control features:

Cryptographic Device Identity:

  • Key pair generated per device
  • Public key shared on network
  • Private key never leaves device
  • Device identity cryptographically signed

Secure Discovery:

  • Devices announce presence via mDNS/Bonjour
  • Identity verified through key exchange
  • Session encryption established
  • Man-in-the-middle protection

User Anonymization:

  • Real user ID never broadcast
  • SHA-256 hash used instead
  • Hash cannot be reversed to username
  • Network observers cannot identify you

Pairing Security

When connecting devices:

  1. Both devices display pairing codes
  2. Codes must match (visual verification)
  3. Encrypted channel established
  4. Session keys exchanged
  5. Secure communication begins

Protection Against:

  • Unauthorized device pairing
  • Eavesdropping on local network
  • Replay attacks
  • Identity spoofing

Logout & Data Clearance

User-Initiated Logout

What Happens:

  1. All stored credentials permanently deleted
  2. Authentication token destroyed
  3. User ID hash removed
  4. Session state reset
  5. Navigation to login screen

What's Preserved:

  • App settings (theme, language, etc.)
  • Downloaded content (if any)
  • Server connection info
  • Feature preferences

Storage Clearance Details

Removed on Logout:

Data TypeStorage LocationRemoval
Auth tokenIndexedDB/Preferences✅ Deleted
User IDIndexedDB/Preferences✅ Deleted
User ID hashIndexedDB/Preferences✅ Deleted

Retained After Logout:

Data TypeStorage LocationRetention
App settingsIndexedDB/Preferences✅ Kept
Server URLIndexedDB/Preferences✅ Kept
Downloaded mediaFile System✅ Kept
Appearance prefsIndexedDB/Preferences✅ Kept

Session Monitoring

Health Checks

Llamafin continuously monitors session status:

Background Monitoring:

  • API call responses checked for auth failures
  • Periodic user profile validation every 5 minutes
  • WebSocket connection status tracked
  • Network connectivity verified

User Notifications:

  • Session expiry toast notification
  • Clear message explaining required re-login
  • No silent failures or unexpected behaviour

Network Awareness

Online/Offline Detection:

  • Session checks paused when offline
  • Automatic resume when connectivity restored
  • No false session expiry from network blips
  • Offline queue for pending operations

Security Best Practices

For Users

Recommended Actions:

  • Use strong passwords on Jellyfin server
  • Enable HTTPS for server communication
  • Regularly review active sessions in Jellyfin
  • Log out from shared or public devices
  • Keep Llamafin updated for security patches

When to Re-Login:

  • After password change on server
  • If session unexpectedly expires
  • After server security policy changes
  • When using shared devices

For Administrators

Server-Side Controls:

  • Configure user visibility appropriately
  • Set session timeout policies
  • Monitor active sessions
  • Enable/disable Quick Connect as needed
  • Configure password recovery methods

Authentication Flow Diagrams

Standard Login Flow

User enters credentials

Llamafin validates input

POST to Jellyfin /Users/AuthenticateByName

Server validates credentials

Server returns authentication token

Llamafin stores token securely

Computes SHA-256 hash of user ID

Updates settings with user info

Navigates to home page

Initialises library and player features

Session Rehydration Flow

App starts

Loads stored authentication token

Token exists and not expired?
├─ NO → Redirect to login
└─ YES

Loads user ID and hash

Session marked as "rehydrated"

Connects to Jellyfin via WebSocket

Fetches complete user profile

All features unlocked and ready

Token Attachment Flow

User action triggers API call

Request intercepted

Check if URL is public endpoint
├─ YES → Send without token
└─ NO

Wait for session rehydration complete

Token expired?
├─ YES → Stop request, redirect to login
└─ NO

Attach token to request header

Send to server

Response received

401/403 error?
├─ YES → Session expired, redirect to login
└─ NO → Return data to app

Technical Specifications

SpecificationImplementation
Authentication MethodToken-based (Jellyfin access token)
Password StorageNever stored locally
Token StorageIndexedDB / Capacitor Preferences
Token ExpiryServer-controlled
Session ValidationPeriodic /Users/Me health checks
Health Check IntervalEvery 5 minutes while online
Hashing AlgorithmSHA-256 (Web Crypto API)
Hash PurposeP2P device identity anonymization
Route ProtectionObservable-based AuthGuard
HTTP Security6-layer interceptor pipeline
Public Endpoints/System/Info/Public, /Users/AuthenticateByName, /Users/Public
Session MonitoringWebSocket + periodic API checks
Logout Data ClearanceComplete credential removal