What the message looks like
OneLogin\Saml2\ValidationError: Signature validation failed. SAML Response rejectedCommon causes
- The identity provider (Entra ID, ADFS, Keycloak) rotated its signing certificate and Nextcloud still has the old one.
- The wrong certificate is stored, e.g. the encryption instead of the signing certificate.
- Signature settings do not match: Nextcloud expects signed assertions while the IdP only signs the response (or vice versa).
- The certificate was damaged while copying (line breaks, missing characters).
Check
- Show the SAML configuration in Nextcloud
sudo -u www-data php /var/www/nextcloud/occ saml:config:get - Read the current IdP certificates from the metadata
curl -s https://sso.example.com/realms/main/protocol/saml/descriptor | grep -o '<ds:X509Certificate>[^<]*' - Fingerprint and expiry of the stored certificate
- Find SAML errors in the Nextcloud log
grep -i 'saml' /var/www/nextcloud/data/nextcloud.log | tail -n 5
Fix
- Paste the current signing certificate from the IdP metadata into Nextcloud's SSO settings (Base64 block only, no blank lines).
- Align signature options with the IdP, e.g. signed assertions vs. signed response.
- For planned rotations, add the new certificate in time if the IdP uses both in parallel.
- For debugging, set
loglevelto 0 briefly and revert afterwards.
Typical scenario
Since Monday nobody can sign in to Nextcloud with single sign-on; the identity provider's certificate rotation ran over the weekend. The log says 'Signature validation failed. SAML Response rejected'. First compare the fingerprint of the signing certificate in the user_saml settings with the current certificate in the IdP metadata. If they differ, the IdP has simply moved to a new certificate.
FAQ
Is this about the website's TLS certificate?
No. SAML uses a separate signing certificate from the IdP. Nextcloud's HTTPS certificate plays no role here.
Why did it work yesterday?
Almost always the IdP certificate was renewed. Entra ID and ADFS rotate automatically; compare the fingerprint in the metadata with the one in Nextcloud.
Why does this often show up months after the setup?
IdP signing certificates expire or are replaced on a schedule, in some systems automatically. Nextcloud keeps the old certificate until someone replaces it. The expiry date of the IdP certificate therefore belongs in your monitoring.
Is the response or the assertion signed in this case?
That depends on the IdP: some sign the whole response, others only the assertion, some both. If Nextcloud expects a particular signature that the IdP does not provide, validation fails as well. The IdP administrator can tell you the setting.
Does this error have anything to do with system time?
No, that would be a separate error (NotBefore or NotOnOrAfter). Here either the stored certificate is wrong or it was altered when pasted, for example by truncated lines. A fingerprint comparison settles it quickly.