Admin guide Setup
Accounts and sign-in
Turn on private workspaces, choose the identity providers people sign in with (local accounts, Keycloak, Okta, Entra ID, Google, Auth0, Firebase, a sign-in gateway), or make sign-in mandatory.
On this page
By default Archipelego has no accounts: each browser keeps its own list of canvases, and a canvas link is its access. Configure one or more identity providers and people can sign in to a private workspace that keeps their canvases and groups in their account.
Three modes
ARCHIPELEGO_AUTH |
What happens |
|---|---|
off |
No accounts. This is the mode whenever no identity provider is configured. |
optional (default when a provider is configured) |
Anyone can open a canvas by its link. People who sign in get a private workspace at /workspace. |
required |
Nothing but the sign-in page works without signing in: every API call and every canvas connection needs a signed-in person. Use it for a fully private instance. |
Identity providers supported out of the box
| Provider | Type | Typical use |
|---|---|---|
| Archipelego accounts | local |
Fully on premises with nothing else to install: email and password stored on this server, hashed with scrypt. |
| Keycloak | oidc, preset keycloak |
On-premises single sign-on. Keycloak also federates LDAP, Active Directory and SAML providers, so it is the way to connect those. |
| Okta | oidc, preset okta |
Enterprise single sign-on in the cloud. |
| Microsoft Entra ID | oidc, preset entra |
Microsoft 365 organisations, one tenant or several. |
oidc, preset google |
Google Workspace or Gmail accounts. | |
| Auth0 | oidc, preset auth0 |
Customer identity platforms. |
| Any OpenID Connect provider | oidc |
Authentik, Zitadel, Ping, OneLogin, GitLab, Dex and others. |
| Firebase Authentication | firebase |
When the app is hosted on Firebase: Google, Microsoft, GitHub or Apple sign-in through Firebase. |
| A sign-in gateway | proxy |
oauth2-proxy, Pomerium or Google IAP already in front of the server: they say who the person is in a header. |
The sign-in page shows one button per provider, in the order you configure them, and the email-and-password form below them when local accounts are on.
Configure
Put the configuration in a JSON file and point ARCHIPELEGO_AUTH_CONFIG at it (or put the JSON itself in the variable). Keep secrets out of the file: a value written "env:NAME" is read from the environment variable NAME.
{
"mode": "optional",
"providers": [
{ "id": "keycloak", "type": "oidc", "preset": "keycloak", "name": "ACME sign-in",
"issuer": "https://sso.acme.example/realms/acme", "clientId": "archipelego" },
{ "id": "okta", "type": "oidc", "preset": "okta",
"issuer": "https://acme.okta.com/oauth2/default", "clientId": "0oa1b2c3d4" },
{ "id": "entra", "type": "oidc", "preset": "entra",
"issuer": "https://login.microsoftonline.com/<tenant-id>/v2.0", "clientId": "<application-id>" },
{ "id": "google", "type": "oidc", "preset": "google",
"issuer": "https://accounts.google.com", "clientId": "<client-id>.apps.googleusercontent.com",
"clientSecret": "env:GOOGLE_CLIENT_SECRET" },
{ "id": "local", "type": "local", "signup": false }
],
"allowedEmails": ["*@acme.example", "consultant@partner.example"],
"sessionHours": 168
}allowedEmailslimits who may sign in, whatever the provider:*@domainallows a whole domain. Leave it out to accept everyone the providers vouch for. Signing up cannot prove that a person owns the address they type, so whenallowedEmailsis set, email and password accounts are only created by the administrator (see below).sessionHoursis how long a sign-in lasts (default 168, a week).redirectOriginslists extra addresses the app is served from, when the app and the server are on different hosts and the app's address is not already inARCHIPELEGO_CORS_ORIGINS.
Shortcuts for simple setups, without a file:
ARCHIPELEGO_AUTH_LOCAL=on # email and password accounts
ARCHIPELEGO_AUTH_SIGNUP=off # only existing accounts may sign in
ARCHIPELEGO_AUTH_OIDC='[{"id":"keycloak","preset":"keycloak","issuer":"https://sso.acme.example/realms/acme","clientId":"archipelego"}]'
ARCHIPELEGO_AUTH_FIREBASE='{"apiKey":"…","authDomain":"acme.firebaseapp.com","projectId":"acme","signInWith":["google.com","microsoft.com"]}'
ARCHIPELEGO_AUTH_PROXY_HEADER=x-forwarded-email
ARCHIPELEGO_AUTH_ALLOWED_EMAILS='*@acme.example'
ARCHIPELEGO_AUTH=requiredThe server prints the providers it accepted when it starts, and a warning for each one it left out.
Email and password accounts
With signup on (the default), anyone who opens the sign-in page can create an account. Turn it off with "signup": false or ARCHIPELEGO_AUTH_SIGNUP=off; it is always off when allowedEmails is set. The administrator then manages accounts on the server:
npm run accounts -w server -- list
npm run accounts -w server -- add ana@acme.example "Ana Lima"
npm run accounts -w server -- password ana@acme.example
npm run accounts -w server -- remove ana@acme.exampleadd and password make up a password and print it once, or read it from the first line of standard input (echo "…" | npm run accounts …). A new password signs the person out on every device. The running server sees the change on its next request. Use the same ARCHIPELEGO_DATA as the server.
Register Archipelego with an OpenID Connect provider
Create an application (a "client") in your provider with:
- Redirect URI:
https://<the app's address>/signin/callback, for examplehttps://archipelego.acme.example/signin/callback. - Grant type: authorization code, with PKCE (S256).
- Scopes:
openid email profile. - Client type: public (single-page application) is enough. If your provider insists on a confidential client, as Google does, set
clientSecretwithenv:; the server then sends it when it redeems the code.
The browser goes to the provider and comes back to /signin/callback; the server redeems the code, checks the ID token's signature against the provider's published keys, its issuer, audience, expiry and nonce, and then opens an Archipelego session.
The email address decides who may sign in, so Archipelego only takes it when the provider vouches for it: the ID token must say email_verified: true. Keycloak, Okta, Google and Auth0 send it; in Keycloak, turn on Email verified for users you create by hand.
Microsoft Entra ID does not send email_verified. Archipelego therefore trusts the email of an Entra ID token only when it comes from a tenant you named:
- With one tenant, the issuer names it:
https://login.microsoftonline.com/<tenant-id>/v2.0. - With several tenants, use
https://login.microsoftonline.com/organizations/v2.0as the issuer and list the tenant ids allowed to sign in intenants. Withouttenants, the server leaves this provider out.
{ "id": "entra", "type": "oidc", "preset": "entra", "issuer": "https://login.microsoftonline.com/organizations/v2.0",
"clientId": "<application-id>", "tenants": ["<acme-tenant-id>", "<partner-tenant-id>"] }Firebase Authentication
- In the Firebase console, open Authentication, turn on the sign-in methods you want (Google, Microsoft, GitHub, Apple) and add the app's domain to Authorized domains.
- Copy the web app's
apiKey,authDomainandprojectIdinto thefirebaseprovider. They are public values, not secrets. - List the methods to show as buttons in
signInWith, for example["google.com", "microsoft.com"].
The Firebase SDK opens its sign-in window; the server checks the Firebase ID token against Google's published keys and the project id.
A sign-in gateway in front of the server
When oauth2-proxy, Pomerium, Google IAP or a similar gateway already signs people in, configure a proxy provider with the header it sets (x-forwarded-email by default for oauth2-proxy) and the addresses it connects from:
{ "id": "gateway", "type": "proxy", "name": "ACME sign-in", "header": "x-forwarded-email",
"nameHeader": "x-forwarded-user", "trustedProxies": ["10.0.0.5"] }The header is only believed from trustedProxies (by default the server itself, 127.0.0.1). Make sure nothing else can reach the server directly.
Board access and invitations
Owners, codes and members are kept per board in access/<board id>.json, in the data directory next to the canvases. A board without such a file opens to anyone with its link, as before. Board codes are stored as scrypt hashes; a device that typed the code holds a signed pass for that board and that version of the code, so changing the code signs every device out.
Invitations go by email. They only apply to accounts whose email is known to be theirs: verified by the identity provider (Firebase, OpenID Connect), or created by the administrator with npm run accounts -w server -- add. A self-made local account never opens a board shared with its address.
For a sign-in link by email with Firebase, enable Email link (passwordless sign-in) under the Email/Password provider and add "emailLink" to signInWith, for example ["google.com", "emailLink"]. See Share and protect a board for what people see.
What is stored
Accounts and their workspaces are kept in accounts.json in the data directory, next to the canvases. Back it up with them (see Data and backup). For local accounts it holds a scrypt hash of each password, never the password.
Sessions are signed tokens, sent by the app as Authorization: Bearer. They are signed with a key derived from ARCHIPELEGO_SECRET (or the generated vault key), so changing that secret signs everyone out. Sign out on every device, in the account menu, voids all of one person's sessions. After 10 wrong passwords for the same email from the same address, sign-in pauses for 15 minutes.
The canvas socket uses a separate token that cannot call the API, so a socket address that ends up in an access log cannot be used to read a workspace.