Repository navigation
Description
Area
Dashboard
What are you trying to accomplish?
I run independent OpenCodex standalone instances on Windows PCs. I access their dashboards from another PC or a phone through Caddy, using a dedicated HTTPS hostname per instance. Caddy requires a client certificate. It terminates TLS and connects to each OpenCodex instance over the private LAN.
I want to enter the OpenCodex admin token once, select Remember this device, and resume the dashboard after closing and reopening the browser. I want to keep each instance standalone.
What prevents this today?
With OpenCodex 2.99.0, signing in through this HTTPS reverse proxy works when Remember this device is unchecked. Checking it fails with the generic message The admin token could not be verified. Try again. The same admin token succeeds immediately when the checkbox is unchecked.
The remembered-device implementation requires direct same-origin HTTPS or loopback. An ordinary TLS-terminating reverse proxy does not satisfy this condition: the browser uses HTTPS, while OpenCodex observes HTTP. Forwarded headers do not establish the dedicated Hub management-listener trust context. The browser also validates the origins in the returned session metadata, so changing request headers alone is insufficient.
The limitation is understandable, but the UI offers the checkbox and reports an apparent credential failure instead of explaining the unsupported deployment.
What should OpenCodex do?
Provide an explicit, opt-in way for a standalone instance to support remembered-device sessions behind a trusted HTTPS reverse proxy, with one configured external dashboard origin and a narrowly defined trusted ingress.
The proxy should provide transport security; OpenCodex should continue to authenticate the admin token and issue its own remembered-device cookie, device proof and short-lived GUI sessions. Keep Origin/CSRF validation, the server-side expiry, revocation and existing restrictions on sensitive operations.
Untrusted clients must not be able to claim HTTPS or a local origin by supplying forwarded headers. A client certificate accepted by Caddy should not automatically grant an OpenCodex session or broader dashboard authority.
If the deployment cannot support Remember, disable the checkbox or show a specific explanation rather than reporting that a valid admin token could not be verified.
Example usage or interface
Deployment example (placeholder hostnames only):
Browser
-> https://ocx.example.com (TLS + required client certificate)
-> Caddy
-> http://pc-a.internal:10100 (OpenCodex standalone)
Expected workflow:
- Configure the standalone instance's external HTTPS dashboard origin and explicitly trusted proxy ingress using a supported configuration mechanism.
- Open the HTTPS URL, enter the admin token and select Remember this device.
- Close the browser and reopen the same URL: the remembered device resumes an ordinary dashboard session without the raw admin token.
- Forget this device or log out: the old cookie/proof no longer resumes a session.
- Requests with a foreign Origin, untrusted proxy metadata, missing proof, or an expired/revoked record remain rejected.
Alternatives or workarounds
- Leaving Remember unchecked works, but requires another sign-in after the browser session is lost.
- Password-manager autofill helps with the token form, but does not provide remembered-device sessions.
- Loopback tunnels add per-device setup and are awkward on mobile.
- Switching to a Hub changes the deployment model solely to enable dashboard transport handling.
- External proxy compatibility logic can work, but maintaining application-specific session-origin translation in the proxy is fragile. I would prefer a supported OpenCodex configuration and do not want to patch the installed application.
Additional context
- feat(dashboard): revocable server-side remembered device sessions #7593 implements remembered-device sessions; this proposal concerns their deployment behind an ordinary TLS terminator in standalone mode.
- [Feature]: persistent WebUI auth on remote binds — configurable session lifetime or non-token login #4055 requested persistent authentication on remote dashboards and is closed as completed. This is the narrower deployment limitation that remains in my setup.
- [Feature] Trusted mTLS reverse-proxy authentication for full dashboard management #6822 requested delegated mTLS authentication and full dashboard authority and was closed as not planned. This proposal keeps OpenCodex's own admin-token authentication and existing session permissions; it does not request delegated authentication or unrestricted management access.
In my environment, a proxy compatibility adapter passed a real Chrome test: remembered sign-in, resumption in a new browser context without the admin token, authenticated reads, logout and rejection of the old browser state. This is evidence that the desired workflow is useful and achievable, not a claim that OpenCodex currently supports this deployment natively.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity
coderabbitai commentedon Nov 8, 2026
🔗 Related PRs
#7593 - feat(dashboard): revocable server-side remembered device sessions [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
Ingwannu commentedon Nov 8, 2026
Thanks for the precise write-up. Verified on origin/dev f8dfc2f.
Why Remember fails behind a TLS terminator:
directOriginrequires the request URL origin to match the origin the server derives, and the scheme must be https or loopback (src/server/persistent-gui-session.ts:26-38). Behind Caddy the request URL ishttp://, the host is not loopback, andrememberGuiDevicereturns null (:101-103).src/server/management/session-routes.ts:9).canRememberDashboardDevicepasses behind HTTPS (gui/src/api.ts:361-364), the POST is sent, and any response other than 401 becomes "unavailable" (gui/src/api.ts:473,:481-482). The dialog then shows "The admin token could not be verified" (gui/src/admin-token-dialog.ts:173,:181). That is the misleading message you saw.Scope:
The narrower defect is clear: when the server refuses Remember, the dashboard should say so (or hide the checkbox) instead of reporting a valid admin token as unverified. A small GUI change for that is possible; it is not implemented yet.
assets: #8338 Remember refusal message (8338-en.png)
assets: #8338 Remember refusal message (8338-ko.png)
assets: #8338 Remember refusal message v2 (8338-v2-en.png)
assets: #8338 Remember refusal message v2 (8338-v2-ko.png)
fix(gui): explain a refused Remember instead of reporting the admin t…
lidge-jun commentedon Nov 8, 2026
The narrow defect from the triage comment is fixed on
devby #8374 (c813ecc). When the server refuses Remember behind a TLS-terminating proxy, the sign-in dialog now explains that this address cannot remember the device, turns Remember off, and keeps the token so you can sign in without it. It no longer reports a valid admin token as unverifiable.The feature this issue asks for, remembered devices behind a trusted HTTPS reverse proxy in standalone mode, is a trust-boundary design decision for the maintainers and is not implemented. This issue stays open for it.
lidge-jun commentedon Nov 10, 2026
Status check after the 11-09 revert: #8394's documentation was reverted by
0fac612a93and re-landed unchanged by #8405 (9573456d59), with follow-up wording in #8418. It is ondevnow (docs-site/src/content/docs/guides/web-dashboard.md"Remember this device" paragraph, and theremember_requires_direct_originrow inreference/management-api.md). The #8374 UX fix is unaffected.The feature itself, remembered devices for a standalone instance behind a trusted TLS-terminating proxy, adds a new trust boundary, so it needs an owner decision before anyone implements it. Options:
X-Forwarded-Proto/Hostwould be honored only from that ingress, and Origin/CSRF, expiry, revocation, and consent restrictions would stay as they are. This needs a security review of the forwarded-header trust and tests showing that untrusted clients cannot claim HTTPS.Recommendation: 2, opt-in only, with its own security review. Otherwise 1.
lidge-jun commentedon Nov 11, 2026
Decision (owner, 11-11): approved as an opt-in setting. Remember this device works on a standalone dashboard behind a reverse proxy only after the operator names the exact HTTPS origin, the proxy's own addresses, and which of Host / X-Forwarded-* to trust. Without the setting, behavior is unchanged (direct HTTPS or loopback only). Forged or contradicting X-Forwarded-* values, an origin that is not configured, HTTP origins, and wildcards are refused. Implementation follows in a PR for this issue, with a separate security review.
feat(dashboard): remember devices behind an operator-named reverse pr…
chore: merge upstream dev (9fec48a) into main