Skip to main content
SAML login is handled by the web service (the authentication module) inside every Ayakaleaf Pro pod. It has no background job and no separate pod. Set up the identity provider (IdP) as in SAML Authentication, then put the values and the IdP certificate into Kubernetes as below.

Where things run

Configuration

1

Register Overleaf at the IdP

The goauthentik walkthrough shows where these are.
2

Put the IdP certificate into the Secret overleaf-certs

The Toolkit reads the certificate from data/overleaf/certs/. On Kubernetes it comes from the Secret overleaf-certs, mounted at /var/lib/overleaf/certs as described in Certificates and other files:
If the Secret already exists, add the file to it instead: delete and recreate it with every --from-file, or kubectl -n overleaf edit secret overleaf-certs.OVERLEAF_SAML_IDP_CERT takes a path, or a JSON list of paths during a certificate rollover. It does not take the PEM text itself.
3

Add the settings to the ConfigMap

30-config.yaml (additions)
Every OVERLEAF_SAML_* setting is listed in Environment Variables. They all go into the ConfigMap: none is a secret itself. Key files (OVERLEAF_SAML_PRIVATE_KEY, OVERLEAF_SAML_DECRYPTION_PVK) go into overleaf-certs, and the ConfigMap holds their paths.
Quote "true", "false" and JSON values such as OVERLEAF_SAML_AUTHN_CONTEXT: '["urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"]'. A setting that is not a valid boolean or JSON value makes the SAML strategy fail to load while the pod still reports ready; logging in through SAML then fails. Check web.log after every change, see the Q&A below.
4

Apply and restart

The IdP certificate and keys are read when web starts, so a new certificate in overleaf-certs also needs this restart.

Several replicas

The IdP returns the user to the ACS URL with a cross-site POST. Browsers do not send SameSite=Lax cookies with it, so the request carries neither Overleaf’s session cookie nor, in Chrome and Edge, the load balancer’s sticky cookie, and it can arrive at any replica. With the default settings this does not matter: the replica that receives it creates the session in Redis and the load balancer keeps the user there from then on.
Leave OVERLEAF_SAML_VALIDATE_IN_RESPONSE_TO unset (it defaults to never) when you run several replicas. With always or ifPresent, each replica remembers the requests it sent to the IdP in its own memory, and a response that arrives at another replica is refused with “InResponseTo is not valid”: the user stays on /saml/login/callback. In our test with three replicas and always, 12 of the 19 SAML test cases failed this way, while all passed with the default. With one replica, the SAML logins also pass with always.

Tested on Kubernetes

With goauthentik as the IdP (HTTP-POST binding, signed assertions and responses), on Kubernetes 1.37 with three replicas behind HAProxy, our end-to-end tests for SAML pass (19 cases): the first admin from the launchpad logging in through SAML, login with the IdP certificate from overleaf-certs, account creation and logging in again, the admin mapping by group and without mapping, name and admin flag updated at each login, logout through the IdP, password rules for SAML accounts, and suspended accounts. OVERLEAF_SAML_VALIDATE_IN_RESPONSE_TO was left at its default.

Q&A

Answer: The SAML strategy failed to load. The pod still becomes ready, so look in the web log of each pod:
Common causes: OVERLEAF_SAML_IDP_CERT points to a file that is not in overleaf-certs, a boolean that is not "true" or "false", or invalid JSON. With EXTERNAL_AUTH listing several methods, such an error also turns off the methods after SAML (ldap, then saml, then oidc).
Answer: Neither, for login and logout: the IdP and Overleaf only exchange messages through the user’s browser. Only if you configure the IdP with a metadata URL does it download ${OVERLEAF_SITE_URL}/saml/meta.
Last modified on November 2, 2026