SAML: signature validation failed in Nextcloud
Nextcloud (user_saml with php-saml) could not verify the SAML response signature with the stored IdP certificate and rejects the login. Common causes The identity provider (Entra ID, ADFS, Keycloak) rotated
Nextcloud (user_saml with php-saml) could not verify the SAML response signature with the stored IdP certificate and rejects the login.
Common 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).
How to check it
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
openssl x509 -in idp.crt -noout -fingerprint -sha256 -enddate
What actually helps
- 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.
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.
Full page with every command and the German/Italian version: daniele-michelin.com/en/errors/nextcloud-saml-signature-validation-failed/
First published at daniele-michelin.com. The error lexicon covers HTTP, DNS, TLS, mail, database, PHP, nginx, systemd and Nextcloud, in German, English and Italian.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.