OIDC Sign-in
ProjectAchilles has two sign-in modes, chosen per install:
- Clerk (the default): people sign in through Clerk, a hosted sign-in service. Nothing on this page changes how a Clerk install works.
- OIDC: people sign in through your organization's own identity provider with OpenID Connect, for example Microsoft Entra ID or Keycloak. Active Directory needs a provider in front of it: see Active Directory.
In both modes ProjectAchilles never handles a password, MFA or account recovery. In OIDC mode those stay with your provider, and so do its policies: MFA and Conditional Access apply at sign-in with nothing to set up in ProjectAchilles.
This page covers what both providers share. The provider pages cover the registration at the provider.
When to choose OIDC
Choose OIDC when:
- your organization already runs an identity provider and its access reviews, and wants the console's access governed there;
- you do not want a third party in the chain that grants administrator access to a console that can run commands as root or SYSTEM on every enrolled endpoint;
- the install is on a LAN and should not depend on an internet sign-in service (a Keycloak on the same network is enough).
Clerk is still the right choice when:
- you have no identity provider of your own, or want email, Google or GitHub sign-in for people outside your directory;
- you deploy to Vercel, or to Render or Fly.io with the API on its own address (Render Starter, the default Fly.io setup): OIDC mode needs the console and its API on one origin, which the Server Installer gives you;
- you want to invite people and set their roles inside ProjectAchilles. In OIDC mode, users and roles are managed at the provider only.
Where OIDC mode works
OIDC mode is validated and documented on the
Server Installer, which also gives you
achilles-installer auth and break-glass. Other deployments that serve the
console and its API from one https address (Docker Compose behind your own
TLS proxy, or http://localhost; Render Standard or Fly.io with
BACKEND_HOST) can set the same variables in backend/.env by hand, but were
not tested and have no installer commands. Render Starter, the default Fly.io
setup (VITE_API_URL) and Vercel stay Clerk.
How it works
- A person opens the console and selects Sign in with <provider
name>. The browser goes to the provider (authorization code flow with
PKCE,
stateandnonce). - The provider signs the person in, with its own MFA and policies, and sends
the browser back to
https://<your-host>/api/auth/oidc/callback. - The backend exchanges the code for tokens and checks the ID token. It
reads the person's role from a claim in the ID token (
rolesby default). A person with no mapped role gets no session and lands on a "no access" page. - The backend creates a server-side session and sets one cookie,
__Host-achilles_session(HttpOnly, Secure, SameSite=Lax; without the__Host-prefix andSecureonly onhttp://localhost).
No token reaches the page's scripts. The browser holds only the session
cookie, which scripts cannot read; the session row in the database is keyed
by the cookie's SHA-256, never the cookie itself. Writes carry a CSRF token
that the page keeps in memory. The provider's refresh token stays on the
server, encrypted with ENCRYPTION_SECRET, and is used for the regular
re-check described in When access ends.
In OIDC mode the console loads no Clerk code and needs no Clerk key.
People are recorded by the provider's issuer and subject. Their name and
email come from the ID token (name, else preferred_username; email)
and are used for display only.
Sessions. A session ends after OIDC_SESSION_IDLE_MINUTES without a
request (default 120) or OIDC_SESSION_MAX_HOURS after sign-in (default 12),
whichever comes first. Every request counts as activity, the page's
background refreshes included, so an open tab does not idle out: the idle
limit ends the sessions of closed tabs and sleeping laptops. When a session
has ended, the console starts sign-in again by itself; while the person's
provider session is still alive this needs no password. After a person signs
out, the console waits on "You are signed out" until they select Sign in.
Settings
On a server install, every setting lives in deploy.config.env (section
"Sign-in"), and the deploy script writes it into backend/.env on every run,
so a value set only in backend/.env is lost on the next run. Change them
with achilles-installer auth (see Changing the settings)
rather than by hand. Settings › Sign-in in the console shows them,
read-only, to administrators; it never shows the client secret.
| Setting | Default | What it does | auth set flag |
|---|---|---|---|
AUTH_MODE | clerk | oidc turns this mode on. Any value other than clerk or oidc stops the backend. | --mode |
OIDC_ISSUER | required | The provider's issuer URL. https, or http only for localhost, 127.0.0.1 and [::1]. No user info, query string or fragment. For Entra ID it must name the tenant: common, organizations and consumers are refused. | --issuer |
OIDC_CLIENT_ID | required | The console's client ID at the provider. | --client-id |
OIDC_CLIENT_SECRET | required | The client secret. Never a flag: typed or piped. | --rotate-secret, --secret-stdin |
OIDC_PROVIDER_NAME | your organization | The name on the sign-in button and in messages. | --provider-name |
OIDC_SCOPES | openid profile email offline_access | Scopes requested. Must include openid. Keep offline_access: see When access ends. | --scopes |
OIDC_ROLE_CLAIM | roles | The ID-token claim that holds the person's roles. | --role-claim |
OIDC_ROLE_MAP | admin=admin,operator=operator,analyst=analyst,explorer=explorer | Which provider value gives which console role. See Roles. | --role-map |
OIDC_ORG_ID | unset | The organization every person signs in to. Needed only when the install already holds data under an organization (see Switching an existing install), and required with REQUIRE_ORG_ISOLATION=true. Never default. | --org |
OIDC_SESSION_IDLE_MINUTES | 120 | Minutes without a request before a session ends. 1 to 43200, and at most OIDC_SESSION_MAX_HOURS × 60. | --idle-minutes |
OIDC_SESSION_MAX_HOURS | 12 | Hours a session lasts at most. 1 to 720. | --max-hours |
OIDC_REVALIDATE_MINUTES | 60 | Minutes between re-checks of a signed-in person with the provider. 1 to 1440. | --revalidate-minutes |
OIDC_LOGOUT | local | local: sign-out ends the console session only. provider: it also sends the browser to the provider's sign-out page. | --logout |
OIDC_TOKEN_AUTH_METHOD | basic | How the console sends the client secret to the provider's token endpoint: basic (HTTP Basic header) or post (request body). | --token-auth-method |
OIDC_CA_CERT_FILE | unset | A PEM file with the certificate of a private certificate authority, for a provider whose certificate is not from a public one. Trusted for requests to the provider only. | --ca-file |
Two more values must be right in OIDC mode; the Server Installer sets both:
PUBLIC_APP_URL: the address people open, such ashttps://achilles.example.com. The redirect URI is this address plus/api/auth/oidc/callback. The deploy script writes it fromACHILLES_DOMAIN.ENCRYPTION_SECRET: at least 32 characters. It encrypts the stored refresh tokens; changing it ends every stored one, and people sign in again.
In deploy.config.env, single-quote every OIDC value. A value cannot contain
a single quote or a line break, or end in a backslash.
There is no setting that turns off the check of the provider's certificate,
and none should be added by other means. A provider behind a private
certificate authority gets that CA's certificate in OIDC_CA_CERT_FILE:
see Keycloak: a private CA.
Changing the settings
achilles-installer auth shows and changes the settings on an existing
install:
sudo /opt/projectachilles/achilles-installer auth show
sudo /opt/projectachilles/achilles-installer auth set --revalidate-minutes 30 --logout provider
sudo /opt/projectachilles/achilles-installer auth set --rotate-secret
auth showprints every setting with its default. The client secret shows only as set or not set.auth setchecks the new values and the provider's discovery document, prints the changes, asks before writing (--yesskips the question), keeps the previous file asdeploy.config.env.bak, and re-runs the deploy script. The console restarts.- An empty value (
--logout '') returns an optional setting to its default. --rotate-secretasks for the new secret twice, with nothing shown on screen.--secret-stdinreads it from a pipe instead.- When the provider cannot be reached,
auth setchanges nothing.--no-issuer-checkskips only the discovery check; the certificate is always checked.
scripts/deploy-remote.sh copies the deploy.config.env on your machine over
the server's copy on every run. After a change with achilles-installer auth
on the server, copy the server's deploy.config.env back to your machine, or
the next remote run puts the old values back.
Roles and the role map
The console has the same four roles in both modes: admin, operator,
analyst and explorer. In OIDC mode the role comes from the provider, at
every sign-in and every re-check:
- The backend reads
OIDC_ROLE_CLAIMfrom the ID token. The claim may be a list or a single string. If no claim has that exact name and the name contains dots, it is read as a path (realm_access.roles). - Each value is looked up in
OIDC_ROLE_MAP, case-sensitively. A person with several mapped values gets the highest role: admin, then operator, then analyst, then explorer. - No mapped value means no access, not read-only access. The person lands
on a page that says "Your account has no role in this console." and names
the four roles. At a first sign-in no user row and no session are written;
a person who signed in before and has lost their role is marked inactive,
and their sessions and CLI sign-ins end. The backend logs
[auth] Sign-in of subject "<subject>" refused (no-access): the claim "roles" holds no value mapped to an Achilles role.
The role map is a comma-separated list of role=value pairs. A role may be
listed several times with different values; one value may give only one role:
OIDC_ROLE_MAP='admin=Achilles.Admin,operator=Achilles.Operator,analyst=Achilles.Analyst,analyst=SOC.Readers,explorer=Achilles.Explorer'
Keep the provider's values equal to the default map (admin, operator,
analyst, explorer) and you need no OIDC_ROLE_MAP at all.
The first administrator is whoever holds the admin value at the provider. There is no invitation step: assign the admin role at the provider, then sign in.
Settings › Users lists everyone who has signed in, with their role, their last sign-in and their status (active or inactive). There is no invite, role change or delete: "Users are managed in <provider name>". A role changed at the provider applies at the person's next sign-in or re-check; a changed role also ends their CLI sign-ins.
An administrator can run commands on every enrolled endpoint. Whoever can assign the admin role (or edit the group or claim it comes from) at the provider can make console administrators. Treat that permission at the provider accordingly.
When access ends
Remove or disable a person at the provider. ProjectAchilles then ends their access on its own:
- A request after the interval is checked first. The console and the CLI check a person with
the provider (by using the stored refresh token) when the last successful
check is older than
OIDC_REVALIDATE_MINUTES(default 60). The check runs on the person's next request after that interval, before the request is served. - A refusal ends access at once. When the provider refuses the refresh
token (a disabled account, a removed assignment in Entra ID), or the new ID
token holds no mapped role, the person is marked inactive, their console
sessions and CLI sign-ins end, and that request already fails. Validated:
Keycloak (user disabled) and Entra ID (app assignment removed with
"Assignment required" on), both with the backend logging
[auth] User ou_… was marked inactive: the provider refused the refresh token. - So access ends within
OIDC_REVALIDATE_MINUTESof the change at the provider, counted from the person's last successful check, at their next request after that. - An idle or closed tab is not checked, because it sends no request. Its
session ends by itself after
OIDC_SESSION_IDLE_MINUTES, and any request it sends earlier is checked first. - When the provider cannot be reached, a person whose check is due keeps access for one more interval (grace), so a short outage does not sign everyone out. After that every request answers 503 until the provider answers again. Access never extends beyond one extra interval this way. See When the provider is down.
- Without a refresh token there is no re-check. If the provider issues
none (because
offline_accesswas removed fromOIDC_SCOPES, or the provider withholds it), the person is checked only at sign-in, and their access lasts untilOIDC_SESSION_MAX_HOURSafter it (default 12 hours). The backend warns at start whenOIDC_SCOPESlacksoffline_access, and Settings › Sign-in shows how many active users have a refresh token.
To cut a session off at once instead of waiting for the re-check, use Sign out everywhere as well.
What the provider does not end: API keys. An API key a person created keeps working after their account is disabled. Review Settings › API keys when someone leaves.
A person re-enabled at the provider signs in again normally.
Sign out everywhere
An administrator can select Sign out everywhere on a person's row in Settings › Users. It ends that person's console sessions and CLI sign-ins at once (it needs a signed-in administrator; an API key or a CLI token cannot do it).
It does not end:
- their access. The person is not disabled. A console tab they have open signs in again by itself while the provider still lets them in. To remove access, change it at the provider.
- API keys they created. Review them in Settings › API keys.
- their session at the provider.
Signing out
With OIDC_LOGOUT=local (the default), Log out ends the console session
and leaves the provider session alone: the next Sign in may need no
password. With OIDC_LOGOUT=provider, the browser also goes to the
provider's sign-out page and comes back to the console's "You are signed
out" page; the next sign-in asks for the password again.
The console sends the provider no ID-token hint, so the provider may ask a question first: Keycloak can show "Do you want to log out?", and Microsoft asks which account to sign out of when the browser holds several.
When the provider is down
- People already signed in keep working until their check is due plus
one more interval (see When access ends). After that
the console's API answers 503 (
provider_unreachable), never a sign-out, so the console does not loop through a sign-in that would fail too. - A page that is already open keeps showing the data it loaded last, with no notice that its refreshes are failing.
- A page opened fresh shows "The console could not check your sign-in. It keeps trying." with Try again.
- New sign-ins fail with "Your organization's sign-in service could not be reached. Try again in a moment."
- Agents keep working. They authenticate with their own keys, not through the provider: during a provider outage on a real install, agents kept checking in and ran a task.
- When the provider is back, open sessions continue with no new sign-in.
To act during an outage, use break-glass.
The CLI
The achilles CLI works in OIDC mode. achilles login prints
https://<your-host>/cli-auth and a code; approve it in the browser, signed
in as yourself. CLI requests are checked with the provider like the
console's, so a person disabled at the provider loses the CLI within the same
interval. achilles logout ends the CLI sign-in on the server.
Break-glass
Break-glass is a way into the console when the provider is down or every administrator is locked out. It exists only in OIDC mode, and only someone with root on the server can start it. On the server:
sudo /opt/projectachilles/achilles-installer break-glass
It prints (the time is the server's local time, often UTC on a cloud server):
One-time break-glass link (valid until 14:05, about 10 minutes; it works once):
https://achilles.example.com/api/auth/break-glass?t=<token>
Open it in your own browser and press "Open the break-glass session". Do not send it by mail or chat: link scanners and previews open links.
It opens a 60-minute administrator session that is not checked with your identity provider. It cannot manage users, API keys or CLI sign-ins. Its use is written to the backend's log.
To end it early: sudo /opt/projectachilles/achilles-installer break-glass --end
Never send a break-glass link by mail, chat or a ticket. Link scanners and previews open links. The link is a credential until it is used or expires.
- The link works once and for 10 minutes. Opening it shows a page with one button; the session opens only when you press it, so a link scanner that fetches the page spends nothing.
- The session is an administrator session of its own kind. Every page
shows a banner that cannot be closed ("Break-glass session. Signed in from
the server, not through <provider>. It ends at …"). It is never
checked with the provider and ends 60 minutes after it opened at the latest
(sooner if
OIDC_SESSION_IDLE_MINUTESis under 60 and it goes unused). - What it cannot do: create or manage API keys, users, CLI sign-ins or administrators, edit the console identity, or read the sign-in settings. Settings hides General, Users, API keys and Sign-in.
- What it can do is what an admin-scope API key can: stop tasks, pause schedules, change settings, run tests and commands on agents.
- Ending it early:
achilles-installer break-glass --endends every open break-glass session and cancels every link not yet used. It works with the backend stopped too. An open tab of an ended session moves to "The break-glass session has ended."
Without the installer, run the same script in the backend container: on a
server install, from /opt/projectachilles,
docker compose -f docker-compose.server.yml exec backend node dist/scripts/breakGlass.js;
on another deployment, node dist/scripts/breakGlass.js in its backend
container.
It prints one JSON line ({"ok":true,"url":"…","expiresAt":…}) instead of the
text above; the link is its url. With --end it ends the sessions, but this
way only while the backend runs: only the installer falls back to a one-off
container when the backend is stopped.
What stays after a session. The session ends, but what it set up does not: enrollment tokens, an agent's rotated key, agent versions, signing certificates, test binary uploads, schedules and campaigns, integration and alert settings, the Elasticsearch connection, and commands it ran on agents.
After a session nobody expected:
- Run
achilles-installer break-glass --end. - Review the tasks it ran: command and test tasks created by
break-glass. This is the first place to look. - Review enrollment tokens, agent versions, signing certificates, test binary uploads, schedules and campaigns, integration and alert settings, the Elasticsearch connection, and agents whose key was rotated.
The record is the backend's log: [auth] Break-glass link created (valid until …),
… session opened (link made …) from <address>, … link refused (<reason>) from <address>,
… sessions ended from the server (<n> sessions, <m> unused links) and
… session ended by sign-out. The token itself is left out of the backend's
and both proxies' logs. Every break-glass session acts as the user
break-glass, labelled Break-glass (host), so the console cannot tell one
session's actions from another's: match them against the log's open times and
addresses.
Test break-glass once after the install, while the provider works, so you know it works before you need it.
Switching an existing install
achilles-installer auth set --mode switches an install between the two
modes and re-runs the deploy script. The wizard never switches an existing
install.
From Clerk to OIDC
sudo /opt/projectachilles/achilles-installer auth set --mode oidc \
--issuer https://login.microsoftonline.com/<tenant-id>/v2.0 \
--client-id <client-id> --provider-name 'Microsoft Entra ID'
The client secret is asked for after the checks (or piped with
--secret-stdin).
Before you switch: register https://<your-host>/api/auth/oidc/callback
at the provider, and give at least one person the admin role there. Without
the first, nobody can sign in after the switch; without the second, nobody
signs in as administrator.
The organization report. Before anything is written, the installer asks
the install which organizations hold its data (a read-only report, no
migration), and chooses OIDC_ORG_ID from it:
-
No data under an organization:
OIDC_ORG_IDstays unset. Nothing is listed. -
Data under one organization only:
OIDC_ORG_IDis set to it, and the summary names it. -
Data under several organizations: the installer lists them and stops, changing nothing, until you name one with
--org <id>. The others' data stays in place, out of reach. -
One organization and rows that belong to no organization: the installer stops, changing nothing, and asks you to run it again with
--org <id>(even with--yes), because of the next point. It prints, for example:org_example01 1 rows(no organization) 1 rows
Rows that belong to no organization were created by people who signed in
to Clerk without an active organization. When the install holds no data
under an organization, OIDC_ORG_ID stays unset and everyone keeps seeing
these rows after the switch, as before. When OIDC_ORG_ID is set (the
install holds data under one or more organizations), every person signs in
to that organization, so nobody sees the rows of no organization in the
console; they stay in the database, and schedules among them keep running.
There is no step that moves them into the chosen organization: in that case,
review and stop those schedules in Clerk mode before you switch.
Nothing in the database is rewritten: every row, setting and result keeps
its organization id. The backend also refuses to start in OIDC mode when the
install holds data under an organization and OIDC_ORG_ID is unset, and
warns when data exists under other ids.
After the switch:
- people signed in now are signed out, and sign in again through the provider;
- CLI sign-ins from before the switch no longer work: run
achilles loginagain; - API keys keep working, with the organization they were created with: review them in Settings › API keys;
- the first administrator is whoever holds the admin value at the provider;
- the success message repeats the redirect URI to register at the provider.
From OIDC back to Clerk
sudo /opt/projectachilles/achilles-installer auth set --mode clerk
The Clerk keys must still be in deploy.config.env. The OIDC_* settings
stay in the file for a later switch. The deploy script refuses to run a
config without AUTH_MODE=oidc on an OIDC install unless the run is a
deliberate switch, so a stale copy of the config cannot switch the install
by accident.
What stays in the database after a switch back: the OIDC user rows
(auth_users) and session rows (auth_sessions), including each user's
provider refresh token, encrypted. Those tokens are no longer used, but they
may still be valid at the provider. If you will not switch back, remove the
console's registration at the provider, or its client secret, so they cannot
be used.
Known limits
- One provider and one organization per install. Both modes at once, several providers, and installs shared by several organizations are not supported in OIDC mode.
- One origin. The console and its API must be served from one address
(see Where OIDC mode works). Render Starter, the default
Fly.io setup and Vercel (
backend-serverless) stay Clerk only. - No setting is changed from the console. Sign-in settings are changed
on the server only, with
achilles-installer auth. - No list of open break-glass sessions in the console, and no alert when
one opens. The backend log is the record, and every session has the user id
break-glass. - Rows that belong to no organization cannot be brought into the chosen
organization on a switch (installs where
OIDC_ORG_IDis set; see Switching). - Logs.
- nginx's error log cannot be filtered. The callback and break-glass paths
have their own quiet error log, but nginx error lines for other
/apiaddresses still carry the address as requested. - A break-glass link requested with an unusual spelling of its path (
/./, percent-encoded letters), which the backend answers with 404, leaves its token in the backend's and nginx's logs; Caddy's log redacts it. Such a request does not spend the link: if you suspect one, runachilles-installer break-glass --end. - Caddy's access log records the sign-in redirect's
Locationheader: the provider address withstate,nonceandcode_challenge(no code, no token).
- nginx's error log cannot be filtered. The callback and break-glass paths
have their own quiet error log, but nginx error lines for other
- A wrong client secret shows at the first sign-in. The installer checks the issuer's discovery document, which needs no secret, so a mistyped secret is found only when someone signs in. See the Entra ID troubleshooting.
- The provider's sign-out page may ask a question (see Signing out).
- Changing
deploy.config.envwithdeploy-remote.sh: see Changing the settings.
Troubleshooting
The console shows a fixed sentence; the reason is in the backend's log:
sudo docker compose -f /opt/projectachilles/docker-compose.server.yml logs --tail 50 backend
| The console shows | Look for in the log | Usual cause |
|---|---|---|
| "Your account has no role in this console." | refused (no-access): the claim "roles" holds no value mapped to an Achilles role | The person holds no role at the provider, or its value differs from OIDC_ROLE_MAP (case counts), or the claim is not in the ID token. |
| "Sign-in did not complete. Try again, or ask your administrator." | [oidc] completing the sign-in failed (sign_in_failed) … with the provider's error | A wrong client secret (invalid_client), or a provider-side refusal. |
| The provider's own page reports a redirect URI error | nothing (the console's callback is never reached) | Register PUBLIC_APP_URL + /api/auth/oidc/callback exactly at the provider. |
| "Your organization's sign-in service could not be reached. Try again in a moment." | [oidc] beginning the sign-in failed (provider_unreachable) … | The server cannot reach the provider, or does not trust its certificate (UNABLE_TO_VERIFY_LEAF_SIGNATURE: set OIDC_CA_CERT_FILE). |
| "Sign-in took too long or was already completed. Try again." | The sign-in took more than 10 minutes, or the browser went back to an old callback. |