Sign-in with OIDC
The gate signs each person in with your OIDC provider, such as Authgear, and checks every token it gets. Set the provider up once, then start the gate with its issuer and client.
Register the client
Create one client for moor at your provider. Note its issuer URL and client id. Then:
- Add the redirect URI
https://HOST/auth/callback. The portal, the webhook setup page, and machine pairing sign in through it. - Add the redirect URI
http://localhost:53682/callback.moor loginsigns in through it. - Let the client sign in as a public client with PKCE, with the scopes
openid,email, andoffline_access.
The gate reads the person’s email from the token.
Register the MCP resource
Agents such as Claude Code reach https://HOST/mcp with access tokens of
their own.
- Register
https://HOST/mcpas an API resource. - Give it the scopes
moor:readandmoor:write. - Let MCP clients register themselves. The gate registers no clients.
The gate answers https://HOST/.well-known/oauth-protected-resource with the
issuer and the scopes, so a client finds the rest itself.
Start the gate with them
moor-gate \ --front-socket ~/.local/state/moor/fronts/authgear/front \ --issuer https://ISSUER \ --client-id CLIENT_ID \ --mcp-resource-url https://HOST/mcp \ --public-url https://HOST- Without
--mcp-resource-url,/mcpis off. - Without
--public-url, browser sign-in is off. The portal, webhook setup, and machine pairing then answer 404. - If the gate cannot reach the issuer’s discovery URL, pass
--jwks-url. - With more than one gate replica, give every replica the same
--cookie-key, a secret of 32 or more characters. A lone gate without it keeps a key in$XDG_STATE_HOME/moor-gate/cookie-key, so a restart signs no one out. - A portal session lasts 12 hours after the person was last active, and at most 24 hours from sign-in. Then the page asks them to sign in again.
- Every 5 minutes of use, the gate trades the session’s refresh token at the
issuer. A person the issuer removed or disabled is signed out then. The
client must be allowed the
offline_accessscope, or no check runs.
On Kubernetes, the chart’s authgear.issuer, authgear.clientId,
mcp.resourceUrl, and gate.login set the same flags.
Check it
- Open
https://HOST/auth/me. It sends you through the provider and then shows the email you signed in as. - Run
moor doctor --public-url https://HOSTon the controller host. Itsgateline says whether the gate answers. - Run
claude mcp add --transport http moor https://HOST/mcp, then/mcpin Claude Code. It should sign in and list the tools.