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 If the Secret already exists, add the file to it instead: delete and recreate it with every
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:--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)
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.4
Apply and restart
overleaf-certs also needs this restart.Several replicas
The IdP returns the user to the ACS URL with a cross-sitePOST. 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.
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 fromoverleaf-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
Logging in through SAML shows "Something went wrong" right away
Logging in through SAML shows "Something went wrong" right away
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).Does the IdP need to reach Overleaf, or Overleaf the IdP?
Does the IdP need to reach Overleaf, or Overleaf the IdP?
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.
