Security
Single sign-on
Let administrators, auditors and customers sign in to Berth through your identity provider with OpenID Connect or SAML 2.0, with verified provider MFA, single logout and SSO-only logins.
On this page
With single sign-on, people sign in to Berth with the account they already have at your organisation: Entra ID (Azure AD), Google Workspace, Keycloak, Authentik, Okta or any other OpenID Connect provider, or a SAML 2.0 provider such as ADFS or SURFconext. Offboarding then happens in one place: with Linked logins only via the provider switched on, someone who is disabled at the provider can no longer sign in to the panel.
This article covers how linking works, the behaviour switches, and the setup steps for both protocols.
How it works
A provider does not create logins in Berth. It vouches for an external account, and that external account is linked to an existing Berth login. A login can be linked in three ways:
- By the user, under Account → Through your organisation → Link to …, after signing in normally once.
- By an administrator in advance, under the provider's page → Link an account in advance, using the provider's fixed account ID (for Entra ID the object ID), or
berth sso link. - Automatically at first sign-in, if you turn on Link on e-mail address at first sign-in. This only links when exactly one login has that address, and never links administrators or auditors; they link themselves under Account. For OpenID Connect the provider must mark the address as verified (
email_verified; Entra ID does not, so link Entra accounts from Account or in advance). For SAML the signed attribute counts.
Per provider you choose who may sign in this way: Administrators, Customers and Auditors (read-only). The provider then appears as a button on the sign-in screen.
What Berth checks
OpenID Connect uses the authorisation code flow with PKCE. Berth fetches the provider's discovery document and verifies the ID token: signature via the provider's JWKS (only from an allow-list of signing algorithms), issuer, audience, validity and nonce. A public client without a secret works too, protected by PKCE.
SAML 2.0 has Berth act as a service provider. Authentication requests are signed. Responses must be signed and are checked for audience, validity, destination and that they answer the request Berth sent. Encrypted assertions are supported. The provider must send a stable NameID: persistent, e-mail or user name.
Behaviour switches
Each provider has these options under Behaviour:
| Switch | What it does |
|---|---|
| The provider does two-step verification | After signing in through the provider, Berth does not ask for its own TOTP code. |
| Check that the provider did two-step verification | On by default for a new provider. The response must state that a second factor was used: OpenID Connect amr or acr, SAML AuthnContextClassRef, or the Entra ID authentication-methods claim. If it does not, Berth asks for its own second step and records this in the activity log. Turn it off only for a provider that never sends this information. |
| Also sign out at the provider | Single logout, see below. |
| Linked logins only via the provider | SSO-only: linked logins can no longer sign in with a password. |
| On: button on the sign-in screen | Enables or disables the provider. |
Use the first two together. "The provider does MFA" without verification means trusting the provider's configuration blindly. With verification, a provider policy that was loosened by mistake does not quietly remove the second step from the panel.
Single logout
With single logout on, signing out of the panel also signs out at the provider:
- OpenID Connect through the provider's
end_session_endpoint(Keycloak, Authentik, Entra ID and Okta have one). - SAML with a signed logout request to the provider's SingleLogoutService.
The reverse always works for SAML. When the provider sends a signed logout request (IdP-initiated), Berth verifies the signature, ends that login's sessions and answers with a signed response.
Re-confirming through the provider
Sensitive actions in Berth ask for a fresh confirmation, see Sign-in security. Someone with a linked provider can confirm by signing in at the provider again (Account → Confirm again). Berth explicitly asks the provider to prompt again (OpenID Connect prompt=login and max_age=0, SAML ForceAuthn). It then checks that the new sign-in happened after the request and belongs to the same account.
A session that started through a provider also re-confirms there before destructive actions and before approving a four-eyes request. A session belonging to someone who has since been disabled at the provider therefore cannot be used for those actions. If a provider ignores the re-prompt, Berth tells you so and you adjust the provider.
Set up an OpenID Connect provider
- In Berth, go to Settings → Access → Sign in via a provider and choose New provider.
- Enter a short Name (lowercase, used in the URLs, for example
entra) and a Button text (for example "Entra ID"). Choose OpenID Connect. - Copy the Redirect-URI shown under Register at the provider. It has the form
https://panel.example.nl/login/sso/entra/callback. - At your provider, register an application (web, confidential client) with that redirect URI. Note the issuer URL, client ID and client secret.
- Back in Berth, fill in Issuer (for Entra ID
https://login.microsoftonline.com/<tenant-id>/v2.0), Client-ID and Client secret. Leave Scopes empty foropenid email profile. - Choose who may sign in, set the behaviour switches and save. Use Test connection to fetch the discovery document.
- Link the first account and sign in with the new button in a private window before you turn on SSO-only.
The same on the server, with the secret read from standard input so it never lands in shell history:
berth sso set entra --type oidc \
--issuer https://login.microsoftonline.com/<tenant-id>/v2.0 \
--client-id <client-id> --client-secret-file - \
--label "Entra ID" --roles admin,customer \
--trust-mfa --verify-mfa --single-logout
berth sso test entra
berth sso link --provider entra --login acme --subject <object-id>Set up a SAML provider
- Create the provider as above, but choose SAML 2.0.
- Enter the Provider's metadata URL, or paste the metadata XML when there is no URL. Set E-mail attribute only if your provider uses an unusual name.
- Save. Under Register at the provider Berth shows its own metadata URL, the ACS URL (POST) and the single logout URL (redirect and POST), of the form
https://panel.example.nl/login/sso/<name>/metadata,/acsand/slo. - At the provider, register Berth with its metadata URL, or enter the ACS URL by hand. Configure a persistent NameID, or e-mail or user name.
- Choose who may sign in and the behaviour switches, test, and link the first account.
On the server:
berth sso set surf --type saml --metadata-url https://idp.example.nl/metadata \
--label "SURFconext" --roles admin --trust-mfa --verify-mfa
berth sso list
berth sso linksKeep a way in
Before you make administrator logins SSO-only, create a break-glass account that does not depend on the provider, so an outage at the provider does not lock you out of your own servers. See Audit trail and approvals.
Fleet
On a Fleet panel, administrators who signed in there can click through to member servers without signing in again.