Sign-in with OIDC¶
Connect Hivemind to your organization's OpenID Connect (OIDC) identity provider so that people sign in to the Portal with their organization account.
What a sign-in grants, and what it does not¶
A sign-in proves who a person is. It never decides what that person may do.
- No rights. Signing in creates no grant. A new account has no access to any shared space and no operator rights, even when the person is an operator elsewhere. An operator grants access afterwards, in the Portal.
- What a first sign-in records. When the email domain is allowed, the first sign-in creates the account, links it to the provider's stable subject, makes the person a member of the default tenant and reserves their private personal space.
- One browser session. A sign-in opens one Portal session, carried by a secure cookie. The session carries the person's current rights, re-read on every request. An existing deployment operator grant works in that same session; there is no separate operator login.
- Not an agent's authority. A browser session is for a human in the Portal. MCP and the agent APIs never accept it. An assistant reaches memory with its own credential, issued to an agent the person owns, for example through the OAuth MCP connector. Signing out of the Portal does not disconnect such an assistant, and an assistant's connection never receives the person's operator rights.
Local email, password and authenticator sign-in works alongside OIDC, on the same accounts and with the same rights. It is set up separately; see the local credentials reference.
Provider status in 1.7.0¶
| Provider | Details |
|---|---|
| Keycloak 26.8.1 | Written against Keycloak 26.8.1. A verified admitted-domain user signs in, unverified and out-of-domain users are refused, and the account is created with no grants. |
| Google Workspace | Configuration rules are documented (two token issuers, signed hd domain claim, standard SSO profile). |
| JumpCloud | Configuration rules are documented (stable subject required). |
| Any other OIDC provider | The generic client follows the standard authorization code flow with PKCE; verify it on an isolated configuration first. |
Directory provisioning (SCIM) is not part of 1.7.0. A person who leaves your organization is not detected automatically: suspend their account in Hivemind, and rely on the session limits described in Verify.
Before you start¶
- A production Hivemind 1.7.0 instance installed with the authority store, as
in Install in production, reachable over HTTPS at its
public origin (here
https://hivemind.example.org). The development HTTP listener cannot host OIDC sign-in. - Shell access to the host, and the ability to stop and restart Core.
- An administrator account at your identity provider that can register a web application.
- The email domains whose people may sign in, for example
example.org. - If you plan to let the installer's first owner, or accounts imported from
1.6, sign in through OIDC: their user IDs. The installer prints the owner's
ID as
owner_id; an operator also finds every user ID under Operator tools → Identity & Groups → Users.
OIDC providers are configured in a file on the server, read once at startup. The Portal lists them under Identity & Groups → Identity providers but does not edit them.
The Portal has no setup form for providers. Under First-time setup, the
sign-in panel only says that sign-in providers are configured by the
deployment operator in the OIDC connections file, next to Assign the first
operator. Configure providers with the connections file and the
oidc provision command below.
Steps¶
1. Register Hivemind at your identity provider¶
Create a web application client with these properties:
- Grant: authorization code, with PKCE
S256. - Redirect (callback) URI, registered exactly:
https://hivemind.example.org/auth/oidc/callback. Any HTTPS path on the public origin works, as long as the provider and the connections file name the same one. For Google, use/auth/oidc/google/callback: the bundled WAF carries a path-exact exception for Google'sscopeecho on that path only. - Scopes: at least
openidandemail. - Client authentication: a client secret (
client_secret_basicorclient_secret_post), a private-key JWT, or none for a public client. - The provider must return a verified email claim. Keep the client secret in your secret manager.
Note the issuer URL, the client ID and the provider's discovery URL (usually
<issuer>/.well-known/openid-configuration).
2. Choose a connection ID¶
Each connection is identified by a canonical lowercase UUID that you choose once and keep. For example:
uuidgen | tr 'A-Z' 'a-z'
3. Write the connections file¶
Write the file on the Core private volume, for example at
/data/core/connections.toml. It must be a regular file, not a symbolic link,
not writable by group or others, and at most 1 MiB. Unknown keys refuse
startup. A worked example for a generic provider:
version = 1
[connections."<connection-id>"]
display_name = "Example IdP"
revision = 1
created_at_utc = "2026-11-16T00:00:00.000000Z"
updated_at_utc = "2026-11-16T00:00:00.000000Z"
issuer = "https://idp.example.org/realms/example"
configured_token_issuers = [{ value = "https://idp.example.org/realms/example", conformance = "discovery_exact" }]
endpoint_source = { kind = "discovery", discovery_url = "https://idp.example.org/realms/example/.well-known/openid-configuration" }
network_policy = { allowed_origins = ["https://idp.example.org:443"], allowed_private_networks = [], redirect_limit = 0, timeout_seconds = 10, max_response_bytes = 1048576 }
[connections."<connection-id>".client]
client_id = "<client-id>"
redirect_uri = "https://hivemind.example.org/auth/oidc/callback"
token_endpoint_auth_method = "client_secret_basic"
scopes = ["openid", "email"]
response_type = "code"
pkce_method = "S256"
id_token_signing_algorithms = ["RS256"]
[connections."<connection-id>".claims]
email = { source = "id_token", pointer = "/email" }
email_attestation = { kind = "verified_claim", selector = { source = "id_token", pointer = "/email_verified" }, encoding = "boolean_true" }
required_claims = []
Every key shown is mandatory, even when empty: a missing key, like an unknown
one, refuses provisioning and startup with oidc_config_invalid. The only
keys that may be left out are display_name in claims, evidence (required
on a documented issuer variant, see below), userinfo_endpoint of the static
endpoint form, and the client's client_assertion_alg,
client_assertion_kid and id_token_symmetric_secret. required_claims lists
signed claims that must hold one of the permitted values; leave it empty when
the allowed email domains are your only restriction.
Every endpoint origin must appear in allowed_origins, written with its
explicit port (https://idp.example.org:443). The file holds no secret: the
client secret is named at provisioning time. Field limits and the
static-endpoint form are in the
connections file reference.
One way to write it into the volume, with Core's own user and permissions,
from a prepared local copy named connections.toml:
docker compose -f docker-compose.yml -f docker-compose.auth17.yml \
run --rm --no-deps -T hivemind \
sh -c 'umask 077; cat > /data/core/connections.toml' < connections.toml
Google Workspace variant¶
Google signs ID tokens with two spellings of its issuer. Declare both, and
restrict sign-in to your Workspace domain with Google's signed hd claim:
issuer = "https://accounts.google.com"
configured_token_issuers = [
{ value = "https://accounts.google.com", conformance = "discovery_exact" },
{ value = "accounts.google.com", conformance = "documented_provider_variant", evidence = "Google documents both iss values for ID tokens" },
]
endpoint_source = { kind = "discovery", discovery_url = "https://accounts.google.com/.well-known/openid-configuration" }
In the claims table, replace the empty required_claims with:
required_claims = [{ selector = { source = "id_token", pointer = "/hd" }, permitted_values = ["example.org"] }]
Set allowed_origins to every origin that Google's discovery document names
for its endpoints and keys, each with its explicit port (for example
https://accounts.google.com:443), and use the redirect path
/auth/oidc/google/callback. Google does not send the signed auth_time that
the default strict profile requires, so a Google connection also needs the
standard SSO profile (step 6).
4. Assign pending accounts (optional)¶
A first OIDC sign-in normally creates a new account. An existing account with the same email is linked only when it is still pending, comes from the installer or a 1.6 import, and is assigned to this connection in the same file:
[pending_user_connections]
"<user-id>" = "<connection-id>"
Use this for the installer's first owner when they should sign in through OIDC. Omit the table when no pending account needs it. An already active account, including one created by an operator with a local password, cannot be linked to an OIDC subject this way: that person keeps signing in locally.
5. Provision the connection¶
Stop Core. Then record the connection in the authority store, with its client secret reference and its allowed email domains:
docker compose -f docker-compose.yml -f docker-compose.auth17.yml \
run --rm --no-deps hivemind \
python -m live_mem.auth_install_cli oidc provision \
--store-path /data/core/authority.sqlite \
--connections-file /data/core/connections.toml \
--secret-ref <connection-id>=env:OIDC_CLIENT_SECRET \
--allowed-domain <connection-id>=example.org
env:OIDC_CLIENT_SECRETmakes Core read the secret from that environment variable at each start. Set it in the protected.env, never on the command line.- To seal the secret in Core's private OIDC store instead, replace
--secret-refwith--secret-env <connection-id>=<variable-name>: pass the variable's name, never its value. - A public client uses
--secret-ref <connection-id>=none. - Repeat
--allowed-domainfor each domain. Only these domains can create new accounts or link pending ones.
Replaying the identical command changes nothing. Changing the issuer, client
ID, secret reference or domains of an active connection through oidc provision
is refused. Use the dedicated rotation procedure below for an existing sealed
secret.
After a rotation, use the current secret value when replaying --secret-env
or adding another connection with the complete file. Provisioning recognizes
the rotated version without replacing it or enabling a disabled connection.
6. Configure Core and restart it¶
Add to the protected .env:
AUTH_OIDC_CONNECTIONS_FILE=/data/core/connections.toml
When TLS terminates at a proxy in front of Core (the bundled WAF does), list
that proxy's exact address or network so that Core trusts its
X-Forwarded-Proto: https:
AUTH_BROWSER_TRUSTED_PROXIES=["<proxy-cidr>"]
For Google, or any provider that does not send a signed auth_time, select the
standard SSO profile for the connection:
AUTH_OIDC_STANDARD_SSO_CONNECTIONS=["<connection-id>"]
Start Core the way you deployed it, for example with
scripts/authority-compose.sh. Core validates the file and the store at
startup and refuses to start on any mismatch; see Troubleshoot.
Rotate the client secret¶
Use this procedure for a secret that expires or needs replacement. Rotation keeps the existing connection ID and linked accounts. It preserves the connection's active/disabled status and existing browser sessions.
- Create a replacement secret at the identity provider while keeping the old one valid if the provider supports overlap. If a leaked secret needs immediate revocation, revoke it there first and accept the sign-in interruption until the replacement is installed.
- Stop Core. For a sealed connection, set the new value in a temporary private Bash shell environment, then run the offline command with that variable passed into the one-shot container:
docker compose -f docker-compose.yml -f docker-compose.auth17.yml stop hivemind
read -r -s OIDC_ROTATION_SECRET
export OIDC_ROTATION_SECRET
docker compose -f docker-compose.yml -f docker-compose.auth17.yml \
run --rm --no-deps -e OIDC_ROTATION_SECRET hivemind \
python -m live_mem.auth_install_cli oidc rotate-secret \
--store-path /data/core/authority.sqlite \
--secret-env <connection-id>=OIDC_ROTATION_SECRET
unset OIDC_ROTATION_SECRET
Enter the replacement when read waits for input; its value is not part of
shell history or arguments. For a multiline private key, populate the
environment variable from your private secret manager instead of read.
rotated: 1 means a version was committed; rotated: 0 means the same value
was already current. The previous sealed frame is retired after commit.
The command also accepts disabled sealed connections without enabling them.
3. For an env: connection, skip rotate-secret: update the existing
environment variable in the protected deployment configuration. This changes
no authority row and produces no rotation audit event. Public clients
(secret_ref = "none") have no client secret to rotate.
4. Start Core using the normal deployment command (for example
scripts/authority-compose.sh) so its container receives the new environment.
Core loads secrets only at startup. Verify sign-in with an already linked
account before revoking the old provider secret.
5. Delete/revoke the old secret at the provider if it is still valid. Removing
the local sealed frame does not revoke the credential at the provider.
If interrupted, leave Core stopped for the retry and supply the same replacement
value. If that uncommitted value is lost or needs replacing, supply the new desired
value to the same command: it safely discards only a proven uncommitted candidate
and prepares a fresh version. The old reference remains usable before the audited
commit; the new one is usable after it. Retry finishes pending work without a
duplicate rotation event. Keep the private volume and its recovery metadata intact;
never use private-stores reinit for routine rotation. See the
exact contract and refusal codes.
Strict and standard SSO profiles¶
Each connection uses one of two profiles:
- Strict (default): every sign-in asks the provider for a fresh
authentication (
prompt=login,max_age=0) and requires a signedauth_timefrom that moment. - Standard SSO: listed in
AUTH_OIDC_STANDARD_SSO_CONNECTIONS. An open session at the provider may confirm identity without a new password prompt. The token is still fully verified (signature, issuer, audience, nonce, PKCE, verified email, required claims). It does not prove fresh password entry or MFA.
The profile also applies to step-up: before sensitive identity, access and
Mesh actions, the Portal asks the person to confirm their identity again
(15 minutes by default, AUTH_BROWSER_STEP_UP_SECONDS). On a standard SSO
connection an open provider session passes that confirmation silently, so keep
sensitive operator accounts on a strict connection when that matters. See the
step-up reference.
MFA is only as strong as your provider's policy. Hivemind does not perform back-channel logout: signing out of Hivemind ends the Hivemind session only.
Verify¶
- Open
https://hivemind.example.org/in a private browser window. The sign-in panel shows Continue with followed by your provider's name. - Sign in with an account from an allowed domain. You return to the Portal, signed in, with no access to shared spaces yet.
- As an operator, open Operator tools → Identity & Groups → Users: the new account is listed. Grant it access to the spaces it needs.
- Under Identity & Groups → Identity providers, the connection is listed as active.
- Sign in with an account from a domain you did not allow. The sign-in ends on This account cannot be used here, and no account is created.
Browser sessions end after 30 days of inactivity and at most 90 days after
sign-in (AUTH_BROWSER_SESSION_SECONDS,
AUTH_BROWSER_SESSION_ABSOLUTE_SECONDS). A person ends all their sessions with
Sign out of all sessions; an operator does it from the user's details with
End all sessions. See the
sessions reference.
Changing an email address¶
A person's user ID and provider link stay stable; the email is profile data.
- At sign-in. When the provider returns a different verified email for an already linked account, Hivemind updates the account's email in the same transaction.
- By an operator. In Identity & Groups → Users, open the user and choose Edit email. A verified provider may update it again at the next sign-in. An address that another account already holds is refused. For a pending installed or imported account, verify the address first: someone signing in with that verified address can claim the account.
When the new address belongs to another account. If the provider returns a verified email that another Hivemind account already holds, the sign-in is refused, even for an account that is already linked: the person sees This account cannot be used here and cannot sign in through that provider until the conflict is resolved. Nothing is changed or merged: both accounts, their email addresses, agents, credentials and grants stay as they were. To resolve it, either correct the person's address at the identity provider, or have an operator give the other account a different address with Edit email in Identity & Groups → Users, after checking which account should own the address. Then the person signs in again.
An email change never moves agents, credentials, grants, the personal space or authorship.
Troubleshoot¶
When a sign-in cannot complete, the person sees one of these pages, with a Reference value:
| Page | Usual cause | Fix |
|---|---|---|
| Sign-in cancelled | The person cancelled at the provider. | Try again. |
| This sign-in cannot be completed | The attempt expired (five minutes), was already used, or a newer sign-in in another tab replaced it. | Start a new sign-in. |
| Sign-in is unavailable | Core could not reach the provider, or cannot serve sign-in right now. | Check network policy, allowed_origins and provider status. |
| This account cannot be used here | One message for every admission refusal, so accounts are not enumerated: domain not allowed, unverified email, address already used by another account, active account that cannot be linked, pending account not assigned. | Find the reason in the log, below. |
Each refusal writes one log line on the live_mem.auth.oidc logger, with no
token, claim or secret:
oidc_refusal route=callback reason=<reason> reference=<reference>
Search Core's log for the reference the person reports. Common reasons:
| Reason | Meaning |
|---|---|
auth_time_missing |
Strict connection, but the provider sent no signed auth_time. For Google, add the connection to AUTH_OIDC_STANDARD_SSO_CONNECTIONS. |
auth_time_stale |
The provider's authentication is older than the attempt. Sign in again. |
provider_transport |
Discovery, token or key fetch failed or left the allowed origins. |
proof_invalid |
The ID token failed signature, nonce, audience, issuer or claim checks. |
callback_refused |
Callback input, browser binding or current policy refused. |
runtime_unavailable |
Core's authentication runtime or private store cannot serve. |
Core refuses to start when the file and the store disagree. The log names
a fixed code and the connection ID only, for example oidc_row_missing (the
connection was not provisioned), oidc_row_mismatch (issuer or client ID
differ), oidc_secret_unresolvable (the environment variable is absent or
empty) or oidc_config_invalid (the file has an unknown key or a wrong shape).
The full list is in the
connections file reference.
If every sign-in fails right after the provider returns, check the redirect
URI (exact match at the provider and in the file), the public Host your
proxy forwards, and AUTH_BROWSER_TRUSTED_PROXIES. The bundled WAF accepts
Google's scope echo only on /auth/oidc/google/callback.
If your identity provider is down, new sign-ins fail; existing sessions keep working until they expire. Keep a local operator account with password and authenticator as a recovery path; do not weaken the trust configuration to restore sign-in.
Next¶
- OAuth MCP connector: let members connect assistants with their Hivemind sign-in.
- Identity and access: grant access to the people who signed in.
- Production checklist