Authentication¶
Hermes WebUI is single-operator: there is no per-user account system. The usual setup is one server password per instance plus a session cookie; an operator can instead (or also) enable passkeys, OIDC sign-in or trusted-header auth from a reverse proxy. Whoever gets through the configured method is the operator and gets the full API surface.
The model at a glance¶
| Mechanism | Use when |
|---|---|
| No auth | No sign-in method is configured (auth_enabled: false). Call the API directly. |
| Password → session cookie | password_auth_enabled: true. POST /api/auth/login with the password; the server sets a hermes_session cookie you replay on every request. |
| Passkey / OIDC / trusted header | Browser-oriented methods with their own routes: passkeys via /api/auth/passkey/options + /api/auth/passkey/login (WebAuthn), OIDC via a redirect through /api/auth/oidc/start, trusted-header auth via a header your proxy injects. They also end in a session; POST /api/auth/login does not cover them. |
| Custom headers | The instance is behind an authenticating reverse proxy (Authentik, Cloudflare Access) or a token gate. Attach headers like Authorization: Bearer … to every request. |
Probe first: /api/auth/status¶
Always public. Tells a client which path to take.
Illustrative responses (other fields omitted). Open server, then password-protected server before login:auth_enabled: false→ open instance, no login needed.logged_inis alwaysfalsehere; it is not an auth failure.auth_enabled: true+logged_in: true→ your current cookie (or trusted proxy header) is already valid.auth_enabled: true+logged_in: false→ sign in with a configured method. Checkpassword_auth_enabledbefore showing a password prompt; if it isfalse, the instance uses passkeys, OIDC or trusted-header auth instead.
| Field | Meaning |
|---|---|
auth_enabled |
Any sign-in method is configured: password, passkeys, OIDC or trusted-header auth. |
logged_in |
This request carries a valid session. Only evaluated when auth_enabled is true; otherwise false. |
password_auth_enabled |
A server password is set, so POST /api/auth/login can succeed. |
passwordless_enabled |
Passkeys are registered and no password is set. |
passkeys_enabled, passkeys_count, passkey_feature_flag |
Passkey state. Registered passkeys count only while the passkey feature flag is on. |
oidc_enabled |
OIDC sign-in is configured (browser redirect via /api/auth/oidc/start). |
auth_disabled_acknowledged |
Open servers only: the operator acknowledged running without auth. Always false when auth_enabled is true. |
trusted_auth_enabled, auth_type, user, bound_profile |
Present only with trusted-header auth (auth_type, user and bound_profile only on a trusted session). |
Password login: /api/auth/login¶
On success (HTTP 200) the response carries a Set-Cookie: hermes_session=… header. Store it and send it on every subsequent request. On a wrong password the server returns 401 (and rate-limits repeated attempts).
- Cookie name:
hermes_sessionby default. Operators running multiple instances on one hostname can override it viaHERMES_WEBUI_COOKIE_NAME, so a robust client reads the cookie name from theSet-Cookieresponse rather than hard-coding it. - Logout:
POST /api/auth/logoutclears the session.
Native clients¶
Use a cookie-persisting HTTP session and login is transparent after the first call:
- iOS / Swift —
URLSessionwith the defaultHTTPCookieStoragestores and replayshermes_sessionautomatically. (The reference clienthermexdoes exactly this.) - Android / Kotlin — add a
JavaNetCookieJar(CookieManager())to yourOkHttpClient. - Browser / JS — state-changing requests (
POST/PUT/PATCH/DELETE) from a browser on a password-protected instance need the session cookie and that session'sX-Hermes-CSRF-Tokenheader, and they must pass the server's same-origin check. The WebUI page supplies the token and attaches it to its own same-origin unsafe requests; a missing or stale token gets403. Login is exempt because it creates the session. Requests that carry noOrigin/Referer(native clients,curl) are not subject to the CSRF token check, so do not copy the cookie-onlycurlexamples as browserPOSTexamples. See the browser example.
Custom headers (proxied / token-gated deployments)¶
Some self-hosters put Hermes behind an authenticating proxy or a token gate that the password flow can't satisfy. For those, attach one or more fixed headers to every outgoing request:
The reference iOS client persists these in the Keychain and injects them on all requests (see its CustomHeader type). Security note for client authors: do not forward Authorization (and other sensitive headers) across a cross-origin redirect — strip them if the server redirects off-origin, to avoid leaking the secret.
What requires auth¶
Nearly the entire /api/* surface requires a valid session when auth_enabled is true. A small set of paths are always public: /api/auth/login, /api/auth/status, the passkey login pair (/api/auth/passkey/options, /api/auth/passkey/login), the OIDC pair (/api/auth/oidc/start, /api/auth/oidc/callback), static assets under /static/, and the login page. Everything else in this reference assumes an authenticated request.
Errors¶
| Status | Meaning | Client action |
|---|---|---|
401 |
Not authenticated / wrong password | Re-check /api/auth/status, sign in with a configured method (password via /api/auth/login), retry |
403 |
Authenticated but the action is refused | Surface the message; do not retry blindly |
429 |
Too many login attempts | Back off and tell the user to wait |
See Conventions for the standard error body shape.
An agent that signs in to websites needs its own credentials, too: see Let your agent sign in.