What the message looks like
Could not validate timestamp: not yet valid. Check system clock.Common causes
- Server clock without NTP runs fast or slow, typical for VMs after a snapshot restore.
- The NTP service runs but cannot reach a time server (firewall on UDP 123).
- The IdP server (e.g. ADFS) has the wrong time itself.
- Wrong time zone confused with wrong time – SAML always uses UTC.
- Very short assertion lifetime at the IdP combined with a slow redirect.
Check
- Show time and NTP status
timedatectl status - Show the offset to the time server
chronyc tracking 2>/dev/null || ntpq -p - Compare UTC time of SP and IdP directly
date -u; ssh idp.example.com date -u
Fix
- Enable NTP:
timedatectl set-ntp true, or install and start chrony. - Allow outbound UDP 123 to the time servers.
- Check the time on the IdP as well; with ADFS set
NotBeforeSkewto 1–2 minutes if needed. - Do not raise tolerances to many minutes – that weakens protection against replayed assertions.
- On VMs make sure time is synced via the hypervisor or NTP.
Typical scenario
After restoring a VM snapshot, SAML logins in Nextcloud fail. The log says 'Could not validate timestamp: not yet valid. Check system clock.'. After the restore the virtual machine has the wrong time because no time sync was running. The direction of the message helps: 'not yet valid' means the IdP's time is ahead of the service provider's. Use timedatectl to check that the system clock is synchronised before you change any settings.
FAQ
How much skew is allowed?
Most libraries tolerate a few seconds up to about 3 minutes. With working NTP the offset stays below one second.
Why does it only happen sometimes?
Because the clock drifts slowly. Right after a correction it works, hours later it does not. Only a running NTP service fixes it for good.
How do I tell which clock is wrong?
'Not yet valid' (NotBefore) means the assertion comes from the future from the service provider's point of view, so its clock is slow or the IdP's is fast. 'Expired' (NotOnOrAfter) points to the opposite or to a very long login process.
Can I raise the tolerance in the service provider?
Some implementations allow a small deviation, but that is only a plaster. Masking time errors opens windows for replay attacks with expired assertions. The proper fix is reliable time synchronisation via NTP on both sides.
Does the time zone matter?
SAML uses UTC and the system time itself is independent of the time zone. Trouble starts when someone sets the clock by hand to local time without setting the time zone correctly. The UTC time is then off by hours and every assertion is rejected.