Authentication, users, and access#
The application separates three concerns:
- Platform identity: who may open
remote.futrx. - Agent credentials: whether Claude, Codex, or Kimi can run.
- Project membership: which registered users may access a project.
Application gate#
The backend middleware applies the same order to /api/* and /ws*: valid registered session, completed local-admin setup, then at least one authenticated agent provider. Provider-login endpoints are exempt from the final check so onboarding can finish.
Identities and roles#
| Identity | Sign-in | Scope |
|---|---|---|
| Local administrator | Email and a password of 12–1024 characters | Cannot be removed or demoted; manages host-wide setup |
| Invited administrator | Google OAuth | Admin routes and all projects |
| Invited member | Google OAuth | Only projects where their email is a member, plus loose chats |
Sessions are signed in the remote_session secure, HTTP-only cookie and last 30 days. Passwords use a salted, one-way hash. Google OAuth is optional until the admin wants to invite users.
First administrator flow#
The first claim is public only while no admin exists. A legacy installation that already has an administrator identity but no password requires authorization by that existing admin.
Invited user flow#
User guardrails:
- Google sign-in must be configured before users can be added.
- Only admins can add users, remove users, or change roles.
- The last administrator cannot be removed or demoted.
- The local administrator cannot be removed or demoted.
Agent-provider authentication#
Provider credentials are host-wide and admin-managed.
Claude uses an interactive authorization URL plus a pasted code. Codex and Kimi use device-code flows. Credential files are later synchronized into project containers before agent execution.
Project access rules#
| Operation | Admin | Project member |
|---|---|---|
| See project and its chats | Yes | Yes |
| Create chat in project | Yes | Yes |
| Start, stop, restart, inspect, repair | Yes | Yes |
| Read or change secrets | Yes | Yes |
| Edit project membership | Yes | Yes, but cannot remove the final member |
| Set resource limits | Yes | No |
| Delete project | Yes | No |
| Manage global users or Google OAuth | Yes | No |
| Connect agent providers | Yes | No |
Project access is enforced independently on project/chat HTTP resources, chat sockets, terminal sockets, uploads, workspace snapshots, project skills, and preview requests.
Preview and IDE authentication#
Caddy calls /auth/verify before forwarding IDE or preview traffic. For a preview host, the backend extracts the project slug and checks membership. IDE hosts currently receive the registered-user check but not a per-project membership check. After verification, Caddy strips platform session cookies before the request enters project-controlled code.
Code map#
- Frontend gate:
frontend/src/app/containers/AuthGate.tsx - Auth middleware:
backend/internal/transport/http/middleware/auth.go - Auth service:
backend/internal/service/auth/service.go - User service:
backend/internal/service/user/service.go - Access adapter:
backend/internal/transport/transport.go