Running Fettledesk
Sign-in, single sign-on and two-step sign-in
Single sign-on with Microsoft Entra ID, Google Workspace, Okta or any OpenID Connect or SAML provider, who may use a password, and two-step sign-in with an authenticator app.
People sign in with an email and password, optionally with a second step from an authenticator app, or through your organisation's identity provider (single sign-on).
Single sign-on
Fettledesk works with any OpenID Connect provider (Microsoft Entra ID, Google Workspace, Okta, Keycloak, Authentik and others) and with SAML 2.0. The providers are set in the server's .env, the same settings Fettleboard and Fettlecode use; what they may do is set by an admin in Organisation settings → Sign-in. The sign-in page shows a Continue with … button for each. Restart Fettledesk after changing .env (docker compose up -d).
OpenID Connect
Register Fettledesk with your provider as a web application with the redirect URL <PUBLIC_URL>/api/v1/auth/sso/<id>/callback, then set:
OIDC_ID=entra # lower-case letters, digits and dashes; part of the redirect URL
OIDC_NAME=Microsoft # the button says "Continue with Microsoft"
OIDC_ISSUER=https://login.microsoftonline.com/<tenant-id>/v2.0
OIDC_CLIENT_ID=...
OIDC_CLIENT_SECRET=...
For several providers, set OIDC_PROVIDERS to a JSON array of { "id", "name", "issuer", "clientId", "clientSecret" }.
- Microsoft Entra ID: App registrations → New registration, a Web redirect URI as above, then a client secret under Certificates & secrets. Use the tenant's issuer, not
common, so only your organisation can sign in. - Google Workspace: Google Cloud console → APIs & Services → Credentials → OAuth client ID (Web application). The issuer is
https://accounts.google.com; set the email domains below, since any Google account can sign in there. - Okta: Applications → Create App Integration → OIDC, Web Application. The issuer is
https://<your-domain>.okta.com.
Fettledesk uses the authorisation code flow with PKCE, a state tied to the browser, and a nonce, and checks the ID token's signature, issuer, audience and expiry. It asks for openid email profile.
SAML
Give your identity provider the metadata at <PUBLIC_URL>/api/v1/auth/sso/saml/metadata (its entity ID is that address, and responses go to <PUBLIC_URL>/api/v1/auth/sso/saml/acs). Then either point Fettledesk at the provider's metadata file:
SAML_IDP_METADATA=/data/idp-metadata.xml
SAML_NAME=Okta
Copy the file into the data volume first: docker compose cp idp-metadata.xml app:/data/. Or give the three values it holds: SAML_ENTRY_POINT (the provider's sign-in address, HTTP-Redirect binding), SAML_IDP_ENTITY_ID and SAML_IDP_CERT (its signing certificate, as PEM or base64). Optional: SAML_EMAIL_ATTR (default email; the NameID is used if it's an email), SAML_NAME_ATTR (default displayName) and SAML_WANT_ASSERTIONS_SIGNED=true to insist the assertion itself is signed, not only the response.
Sign-in starts in Fettledesk: a response must answer a request Fettledesk made in the same browser, be signed by the provider's certificate, be meant for Fettledesk, be in date and hold exactly one assertion, and each is accepted once. Sign-in started from the provider's own portal isn't supported. SAML needs Fettledesk on https:// (or http://localhost for trying it out), because the browser only sends back the cookie that ties the response to it over a secure connection.
Who gets in
The first time someone signs in through a provider, Fettledesk matches them to the account with the same email address, if the provider says the address is verified, and remembers the link. After that it goes by the provider's own id for them, so a changed email still signs in to the same account.
Admins choose, in Organisation settings → Sign-in:
- When someone new signs in with single sign-on: only people who already have an account (the default), or create them as customers or as members. Created accounts are in the audit log.
- Email domains for single sign-on: only these can sign in or get an account through single sign-on. Set them whenever your provider also serves people outside your organisation (Google, or a shared Entra tenant).
- Who can sign in with a password:
- Everyone (the default).
- Organisation admins only: members must use single sign-on; admins keep a password in case the provider is down.
- Nobody on the team: admins too. You can only choose this while signed in with single sign-on, so you know it works. Customers can always use a password, as the help centre has no single sign-on.
Limiting passwords also signs out anyone who signed in with a password and isn't allowed one any more, the next time they do anything, so they sign in again with single sign-on.
If the provider breaks while passwords are off, set SSO_BREAK_GLASS=true in .env and restart: admins can then sign in with their password. Remove it afterwards.
Single sign-on sessions don't ask for two-step sign-in: the identity provider is responsible for that step. Deactivated accounts can't sign in this way either.
Two-step sign-in
Two-step sign-in asks for a 6-digit code from an authenticator app as well as the password. Any app that supports time-based codes works: Microsoft Authenticator, Google Authenticator, 1Password, Bitwarden and others.
Turning it on
- Open Profile and preferences → Two-step sign-in → Set up two-step sign-in.
- Scan the QR code with the app, or type the key shown beside it.
- Enter the code the app shows, and Turn on two-step sign-in.
- Save the ten backup codes: copy them into a password manager or download them. They're shown once.
From then on, signing in takes the password and then a code. Use a backup code instead takes one of the backup codes; each works once. The profile shows how many are left and warns when three or fewer remain; New backup codes replaces them all (it needs a current code).
Turn off two-step sign-in also needs a current code, and isn't offered while the organisation requires it.
Requiring it
Admins choose who must use it under Organisation settings → Sign-in:
- Nobody has to (the default): people choose for themselves.
- Organisation admins.
- Everyone on the team: admins and members. Customers are never asked.
Someone who is required to use it and hasn't set it up is taken to a setup page the next time they open any page, and can't use anything else until they finish. They can sign out instead.
Lost phone
An admin opens People, finds the person (they show "Two-step on"), and chooses Reset two-step sign-in from the row's menu. Their authenticator app and backup codes stop working and they're signed out everywhere. They sign in with their password and set it up again. Admins can't reset their own: another admin can, or they can use a backup code.
Details
- Codes follow RFC 6238: SHA-1, 30-second steps, 6 digits. Codes from one step either side are accepted, for phone clocks that drift. Each code works once.
- The app's secret is encrypted with the instance's secret key, as mail passwords are. Backup codes are stored as hashes.
- After a correct password there are five minutes and five tries to enter a code; then the password is needed again. Wrong codes also count towards a limit for the account wherever they come from: five wrong codes in 15 minutes pause the code step for that account for the rest of the 15 minutes.
- Turning it on or off, new backup codes, signing in with a backup code, an admin's reset and policy changes are all in the audit log.