Skip to content

fleetlayer-signin gives people one sign-in, with a passkey, for every web service your fleet runs: the Claude sign-in hub, pages, and anything else that can sign people in with OpenID Connect (most self-hosted apps can). Who may use which service comes from the same access policy as your agents, so adding someone, or taking their access away, happens in one place.

Everything a company needs is built on the same service: single sign-on, teams, separate organisations, audit. How it fits together, and why, is in Sign-in and SSO.

Status: experimental. Passkeys, invites, signing in to services, the admin pages, and signing in with Google Workspace or another OpenID Connect provider work. Signing out of every service at once, and Workspace groups as teams, come next.

  1. Make its token on the control plane, and put it where the sign-in service can read it, readable by that user only:

    fleetlayer-control signin token > ~/.config/fleetlayer/signin-token
    chmod 600 ~/.config/fleetlayer/signin-token

    It may look up who belongs where, use invites, ask access checks and record sign-ins, and nothing else. fleetlayer-control signin revoke signin stops it at once.

  2. Add the plugin to the node on an always-on machine, behind your HTTPS proxy:

    plugins:
    - name: signin
    command: fleetlayer-signin
    config:
    dir: ~/.local/state/fleetlayer/signin
    issuer: https://signin.example.com
    control_plane: https://control.example.com
    token_file: ~/.config/fleetlayer/signin-token
    listen: 127.0.0.1:7680
    clients:
    - name: hub
    redirect_uris: [https://hub.example.com/auth/callback]
    secret_file: ~/.config/fleetlayer/signin-clients/hub
    heartbeat:
    url: https://status.example.com/api/v1/endpoints/signin/external
    token_file: ~/.config/fleetlayer/signin-heartbeat-token
  3. Invite yourself: fleetlayer-control invite add --handle you --role admin prints a code. Open https://signin.example.com/invite?code=<code>, choose your name and make a passkey on your device.

  4. Let people in to each service. Admins can sign in to every service from the start. Anyone else needs a rule in your policy for the services they use:

    allow:
    - who: "person:*"
    can: [sign_in]
    to: [service:pages]

Admins open https://signin.example.com/admin: the people, with their role and a button to remove them, and Invite someone, which gives a link to send (it works once, for a week). Teams, and the services that sign in here, are under Advanced.

  • Who can manage: the admins (role: admin), and anyone the policy gives admin on service:signin.
  • Every change is made by the control plane, which checks again that it’s that person’s to make, and is recorded in the audit log as them.
  • Removing someone, changing a role or taking someone off a team asks for the passkey again when it was last used more than ten minutes ago, so a browser left signed in can’t do it.
  • The last admin can’t be removed or made a member: make someone else an admin first.
  • An admin can make 20 invites an hour.

Signing in with Google Workspace, or another provider

Section titled “Signing in with Google Workspace, or another provider”

A company’s people can sign in with their work account instead of a passkey:

upstreams:
- name: acme-google
kind: google # Google Workspace
domain: acme.example # only accounts in this Workspace, with a verified email there
tenant: acme # the place it signs people in for
client_id: "…apps.googleusercontent.com"
client_secret_file: ~/.config/fleetlayer/signin-upstreams/acme-google
join: {role: member} # optional: anyone from the domain joins as a member on first sign-in
- name: okta
kind: oidc # any OpenID Connect provider
issuer: https://example.okta.com
tenant: acme
client_id: "…"
client_secret_file: ~/.config/fleetlayer/signin-upstreams/okta
domain: acme.example # optional for oidc: only verified emails at this domain

join is refused on an upstream with no domain, unless you write join: {role: member, anyone_it_vouches_for: true}: on a public provider that would let in anyone on the internet.

  • The provider’s side: an OAuth client for a web application, with the return address https://signin.example.com/upstream/<name>/callback. For Google: Google Cloud console, APIs & Services, Credentials, Create OAuth client ID, Web application; an Internal consent screen keeps it to the Workspace.
  • The sign-in page offers Continue with Google, and the invite page Join with Google.
  • Linking: the first time, by an invite opened with “Join with Google” (or by join, for someone from the domain). After that, by the account’s issuer and subject. Never by email, which can change hands.
  • One place only: signing in with Acme’s Google gives tokens for Acme. Someone who’s also in another place signs in with their passkey for that one.
Setting What it is
dir All its state: people.json (passkeys), keys/ (the token-signing key), sessions.json. Made readable by this user only.
issuer The address people and services use. https, except on this machine (http://signin.localhost:7680).
passkey_domain What passkeys are made for. Leave it out: it’s the issuer’s own domain (example.com for signin.home.example.com), so sign-in can move anywhere under it.
control_plane, token_file The control plane’s address and the token from step 1. On one machine, use http://127.0.0.1:<port>: a server often can’t resolve *.localhost names the way a browser does.
listen Where it listens, behind your proxy.
clients Each service that signs people in: name (as in the policy, service:<name>), its exact redirect_uris, a secret_file for a service that keeps a secret (leave it out for one that can’t, such as an app in a browser), and post_logout_redirect_uris.
upstreams Providers people may sign in with (above): name, kind (google or oidc), issuer (oidc), domain (required for google), label, tenant, client_id, client_secret_file, join.
heartbeat Pushed every five minutes; it fails when the folder can’t be written or the control plane doesn’t answer.

It’s a standard OpenID Connect provider. Point the service at https://signin.example.com/.well-known/openid-configuration with its client ID (the name) and secret.

  • The authorization code flow, with PKCE (S256) required of every service, including ones with a secret.

  • Before a service gets a code, the person’s access to it is checked (sign_in on service:<name>). Someone without it sees “You don’t have access” and the reason, and the service gets nothing.

  • The ID token (RS256, ten minutes) says who: sub (the person’s ID, never reused), name, preferred_username, fleetlayer.dev/tenant, fleetlayer.dev/principal, fleetlayer.dev/role, fleetlayer.dev/teams, and groups for services that map a claim to their own groups.

  • A worked example, pages (docs/plugins/pages.md): the client in the sign-in settings is

    - name: pages
    redirect_uris: [https://pages.example.com/_/auth/callback]
    post_logout_redirect_uris: [https://pages.example.com/_/signed-out]
    secret_file: ~/.config/fleetlayer/signin-clients/pages # pages reads the same secret (its signin.secret_file)

    and the pages plugin gets the access.check grant, so it can ask which spaces each person may read.

  • The token never says what someone may do. For anything finer, a Fleetlayer plugin asks its node (_fleetlayer.dev/access/check), and any other service asks POST /api/check with its client ID and secret, about its own service:<name> only.

  • Monitoring: GET /healthz is 200 while the folder can be written and the control plane answers, and the heartbeat says the same every five minutes.
  • Back it up: losing the folder means everyone makes new passkeys and every service gets a new secret. Back up people.json and keys/. Sessions can be lost: people sign in again.
  • Move it: stop it, copy the folder and its settings, start it on the other machine and point the address there. The key and the passkeys move with the folder, so tokens services hold stay valid and passkeys keep working.
  • On this machine only (localhost, or a machine’s name with no domain of yours), the invite page warns that passkeys made there stop working if sign-in moves. Use a domain you own to avoid that.