Skip to content

Web Authentication ​

eCaptureQ Web can require a username and password to access the analysis interface and APIs for records, source management, status and long polling. Desktop does not enable this authentication layer.

Version and scope ​

Verified on 13 November 2026 against main commit 1bb574d. The latest stable release on that date is still v1.0.0, which does not include this login feature. Use a source build containing authentication or a subsequent release that includes it. Run ecaptureq-web --help and check for --hash-password and --listen; see the matching compilation guide and CLI migration.

  • Login is enabled only when a file loaded with --sources contains an auth configuration object. Omitting auth or setting it to null disables authentication. An empty auth: {} is invalid and prevents Web startup.
  • This is one configured account for shared access, without multiple users, roles or per-source permissions. Signed-in users can inspect retained records and manage sources.
  • Authentication protects browser-to-Web access. It does not authenticate or encrypt the collector's --ecaptureq WebSocket endpoint. Protect that separate connection as described in Data Sources.
  • Background receiving continues without signed-in users, after logout and after session expiry. Retention and eviction still apply.

Generate your password hash ​

On the Web service host, run:

sh
ecaptureq-web --hash-password

For a macOS ZIP, use ./ecaptureq-web --hash-password; in Windows PowerShell, use .\ecaptureq-web.exe --hash-password. Enter and confirm a password of 8–1024 bytes; interactive input is hidden. Copy the complete output line into auth.passwordHash below. Do not put the plaintext password in command-line arguments.

The generated hash uses PBKDF2-HMAC-SHA256 with a random salt and 600,000 iterations. The configuration does not accept plaintext passwords. The tool also supports standard input for use with an existing secure input channel.

The newer config/sources.example.json contains the public initial credentials ecapture / ecaptureQ. These apply only when that example configuration is loaded; the program does not enable this account by default. Replace the username and password hash before deployment.

Enable login locally ​

Create sources.local.json. Replace the hash placeholder with the complete generated output. You can instead merge auth into an existing object-format configuration and keep its sources:

json
{
  "auth": {
    "username": "ecapture",
    "passwordHash": "REPLACE_WITH_GENERATED_HASH",
    "secureCookie": false
  },
  "sources": []
}

This example is for local HTTP testing, so it explicitly uses secureCookie: false. On Linux/macOS, restrict file permissions with chmod 600 sources.local.json; use equivalent file permissions on Windows. The service user needs read access, plus write access if new sources should be saved from the UI.

sh
ecaptureq-web --listen 127.0.0.1:28257 --sources ./sources.local.json
  1. Keep the service running and open http://127.0.0.1:28257/ on the same machine. An anonymous visit redirects to the login page.
  2. Enter the configured username and the plaintext password used to generate the hash, not the hash itself.
  3. After login, the analysis interface opens. This configuration has no sources and initially offers Mock mode. Follow Quick Start to add a source and switch to Live.
  4. A Log out button appears at the top right. Logging out returns to the login page; anonymous requests to protected APIs return 401.
FieldRequirement
auth.username1–128 bytes, without leading or trailing whitespace
auth.passwordHashThe complete hash generated by --hash-password
auth.secureCookieDefaults to true; keep true for HTTPS and explicitly use false for local HTTP testing

Invalid authentication configuration prevents Web startup rather than allowing anonymous access. Restart the Web service after changing authentication settings.

HTTPS and subpath deployments ​

Use an HTTPS reverse proxy for remote deployment and set auth.secureCookie to true, or omit it to use the default. The application's --listen option provides an HTTP listener; the proxy terminates TLS. Keep Secure cookies when the browser uses HTTPS, even if the proxy forwards to the local application over HTTP.

For example, forward the entire /ecaptureq-web/ prefix from your existing HTTPS proxy to this local service:

sh
ecaptureq-web --listen 127.0.0.1:28257 \
  --sources ./sources.local.json \
  --base-path /ecaptureq-web/ \
  --exclude-http-path-prefix /ecaptureq-web/

Open https://your-host/ecaptureq-web/; the login page uses the same prefix. Preserve the prefix and external Host when forwarding pages, assets and APIs. In Nginx, use proxy_pass http://127.0.0.1:28257 without a trailing slash that would strip the prefix. Adapt the official Nginx example to your TLS setup. Long polls can wait 10 seconds, so the proxy read timeout must exceed that wait; the example uses 35 seconds.

Cookies use HttpOnly, SameSite=Strict and a Path matching --base-path. The application does not change the Secure attribute based on X-Forwarded-Proto; check the configuration against the browser's actual access protocol.

Sessions, logout and password changes ​

Sessions expire 12 hours after login. Refreshing and long polling do not extend this lifetime. After expiry, APIs return 401, and the page stops refreshing and redirects to login. Each instance supports up to 128 sessions. Restarting the service invalidates all sessions.

Log out revokes the current session and ends its long polls. Tabs sharing that cookie also lose access; independent sessions in other browsers remain valid. Logout does not clear the service's live cache or stop the collector.

To change or recover a forgotten password, run --hash-password on the service host, replace passwordHash in the configuration and restart Web. Update username at the same time if needed. A restart invalidates all login sessions and also clears in-memory live records and logs; export important records first. There is no self-service password recovery page.

Troubleshooting ​

SymptomWhat to check
flag provided but not definedCheck the binary and its --help; stable v1.0.0 lacks the authentication options and uses the old CLI names
No login pageCheck that --sources loads the intended file and auth is neither omitted nor null; Desktop has no Web login page
Invalid authentication configuration at startupReplace the hash placeholder, do not use plaintext, and check the username and JSON syntax; an empty auth object is invalid
Incorrect password / 401Use the configured username and corresponding plaintext password; the example password does not apply after replacing its hash
Login returns to the login pageCheck cookie storage/sending, secureCookie, the browser protocol and proxy base-path handling; explicitly use false for local HTTP, and HTTPS with true for deployment
Login returns 429Rate limits are shared across the instance: up to 5 burst attempts, 1 replenished every 12 seconds, and 2 simultaneous password checks; wait according to Retry-After
Login returns 403Check the proxy's external Host and same-origin access; login/logout require same-origin requests and X-Ecapture-UI: 1, sent automatically by the built-in UI
Login returns 503 / session_limitLog out unused sessions or wait for expiry; restarting clears sessions but also discards in-memory records

Sources: configuration reference, authentication middleware, and password/configuration validation.

Web Authentication has loaded

Released under the MIT License.