protected void validateAuthenticationStatements(final Iterable<AuthnStatement> authnStatements,
                                                    final SAML2MessageContext context) {
        final List<String> authnClassRefs = new ArrayList<>();
        val now = Instant.now();
        for (val statement : authnStatements) {
            if (!isAuthnInstantValid(context, statement.getAuthnInstant())) {
                throw new SAMLAuthnInstantException("Authentication issue instant is too old or in the future");
            }
            if (statement.getSessionNotOnOrAfter() != null) {
                val expired = statement.getSessionNotOnOrAfter().isBefore(now);
                if (expired) {
                    throw new SAMLAuthnSessionCriteriaException("Authentication session between IDP and subject has ended");
                }
            }
            if (statement.getAuthnContext().getAuthnContextClassRef() != null) {
                authnClassRefs.add(statement.getAuthnContext().getAuthnContextClassRef().getURI());
            }
        }

        validateAuthnContextClassRefs(context, authnClassRefs);
    }
Validate the given authnStatements:
- authnInstant
- sessionNotOnOrAfter

@param authnStatements the authn statements
@param context         the context
pac4j-saml/src/main/java/org/pac4j/saml/sso/impl/SAML2AuthnResponseValidator.java