Werkmail Docs
Contents

Guides

Single sign-on and SCIM

Single sign-on is included from the Growth plan and supports OpenID Connect and SAML 2.0. SCIM provisioning is included from the Pro plan. Both are managed in Settings, SSO and SCIM by someone with the team management permission.

You pick the protocol on the connection itself. Switching between them keeps the settings of the other one, so you can prepare SAML and stay on OpenID Connect until you are ready.

How sign-in is kept safe

Sessions belong to an email address and work across every workspace that address belongs to. So a workspace may only sign in people whose email domain it has proven to own. Without that proof, an identity provider the workspace controls could claim any address. That is why the first step is always a DNS record.

Verify your domains

Add each domain and publish the TXT record shown, for example _werkmail-sso.corp.example.com with a value that starts with werkmail-sso-verify=. Use Check record once DNS has propagated. A domain can be verified by one workspace only.

Set up OpenID Connect

  1. Register the redirect URI shown on the page at your identity provider and create an OpenID Connect web application. Use the authorization code flow. Scopes: openid email profile.
  2. Enter issuer, client ID and client secret. The issuer must serve /.well-known/openid-configuration and match exactly. We read it when you save. The secret is stored encrypted and never shown again.
  3. Pick the role for new people (not the owner role) and turn single sign-on on.

Set up SAML 2.0

  1. In your identity provider, create a SAML application. It needs two values from us, both shown on the page:
    • Entity ID and metadata address: https://werkmail.eu/api/public/sso/saml/metadata?practice=YOUR_WORKSPACE_ID
    • Assertion Consumer Service URL: https://werkmail.eu/api/public/sso/saml/acs?practice=YOUR_WORKSPACE_ID
  2. We publish our signing and encryption certificate in that metadata. Set your provider to sign the response or the assertion with the certificate it publishes in its own metadata.
  3. Give us your provider's metadata, either as the metadata URL or as the metadata XML. We read entity ID, sign-on URL and certificate from it and show what we parsed, including the certificate fingerprint and its expiry, so you can check the values without trusting the upload.
  4. Name the attributes that carry the email address, display name and optional role, if your provider does not use the defaults. The address is usually the NameID in the email address format.
  5. Pick the role for new people and turn single sign-on on.

Two things worth knowing:

  • IdP-initiated sign-in is off by default. A response that arrives without a sign-in we started is refused, unless you turn that on for the connection. Keep it off unless your provider cannot start the flow.
  • We sign our authentication requests, and we require the response or the assertion to be signed. An unsigned response is refused.

People then choose Sign in with single sign-on on the sign-in page, or open /api/auth/sso/start?email= with their address.

What happens at sign-in

  • The browser is sent to your provider with PKCE and a one-time state that only we can read. Responses must carry the matching nonce and be signed by your provider's keys.
  • With SAML we check the signature over the response or the assertion against the certificate from your metadata, the validity window, the audience and the recipient, and we refuse a response whose assertion ID we have already seen.
  • Whichever protocol you use, the provider must return an email address, and it must not be marked unverified. The domain of that address must be one of your verified domains.
  • First sign-in creates the account and adds the person with the role for new people. Existing members keep their role. The workspace owner is never changed.
  • The session is handed to the dashboard in the URL fragment and removed from the address bar at once.

Your provider's own multi-factor policy applies. Signing in through your provider does not ask for the authenticator code of Second factor.

Require it

Require it for these domains turns off passwords and email codes for addresses on your verified domains. Test the sign-in first. The platform admin address is exempt so a broken provider cannot lock everyone out, and other domains are unaffected. Turning it off restores the other methods at once.

SCIM provisioning

Create a SCIM token under SCIM provisioning and give the base URL and the token to your provider as a bearer credential. The token is shown once.

Resource What it does
Users Create a member with the role for new people, change the display name, deactivate, delete. userName is the email address.
Groups Workspace roles appear as groups. Adding a member to a group assigns that role; removing them returns them to the default role. Roles themselves are created in the dashboard.

Details that matter when you configure a provider:

  • Deactivating (active: false) or deleting a user removes the membership; the account itself stays because it may belong to other workspaces.
  • The workspace owner cannot be changed or removed through SCIM.
  • Filtering supports userName eq "value". Display names are only updated for addresses on your verified domains.
  • Tokens stop working when the workspace is no longer on a plan that includes SCIM.
bash
curl https://app.example.com/scim/v2/Users \
  -H "Authorization: Bearer $SCIM_TOKEN" \
  -H "Content-Type: application/scim+json" \
  -d '{"userName": "dana@corp.example.com", "name": {"givenName": "Dana", "familyName": "Scott"}}'

Troubleshooting

Message Cause
Could not read the identity provider's configuration The issuer is wrong, not public https, or does not serve its discovery document.
The sign-in response could not be verified The signature does not match the certificate in your metadata, or the response is for another address.
The sign-in response is outside its validity window The response is older than the accepted few minutes. Start the sign-in again.
This sign-in response was already used The same assertion arrived twice. Start the sign-in again.
The asserted email address is not on a verified domain The provider returned an address outside your verified domains.
Verify at least one email domain first Single sign-on can only be turned on with a verified domain.
The TXT record was not found yet DNS has not propagated or the value differs. Publish it exactly as shown.
Single sign-on needs the Growth plan or higher The plan does not include single sign-on.
SCIM provisioning needs the Pro plan or higher The plan does not include SCIM.

View this page as Markdown · llms.txt · full corpus