Authentication API
Password-based authentication endpoints for session management.
Overview
Media Viewer uses session-based authentication with HTTP-only cookies. After successful login, the server sets a session cookie that must be included in subsequent requests.
Session Cookie
- Name:
session - HttpOnly:
true(not accessible via JavaScript) - SameSite:
Strict - Duration: Configurable via
SESSION_DURATION(default: 24h) - Type: Sliding expiration (extends on activity)
Endpoints
Check Authentication Status
Check if the user is authenticated and whether initial setup is required. This single endpoint provides both authentication state and setup requirements.
Response
Success (200):
When authenticated:
When not authenticated (no setup required):
When not authenticated (setup required):
authenticated:trueif the user has a valid sessionsetupRequired:trueif initial password setup is needed,falseotherwiseexpiresIn: Seconds until session expires (only present when authenticated)
Login
Authenticate and create a session.
Request
Response
Success (200):
A session cookie is set in the response headers.
Failure (401):
Logout
End the current session.
Response
Success (200):
The session cookie is cleared.
Check Session
Verify if the current session is valid.
Response
Authenticated (200):
Not Authenticated (401):
Change Password
Update the application password.
Request
Response
Success (200):
Invalid Current Password (401):
Validation Error (400):
Session Keepalive
The application automatically sends keepalive requests to maintain active sessions. This is handled internally and does not require manual API calls.