protected Instant buildSessionNotOnOrAfter(final SamlProfileBuilderContext context) {
        val dt = DateTimeUtils.zonedDateTimeOf(context.getAuthenticatedAssertion().orElseThrow().getValidUntilDate());
        val skewAllowance = context.getRegisteredService().getSkewAllowance() != 0
            ? context.getRegisteredService().getSkewAllowance()
            : Beans.newDuration(casProperties.getAuthn().getSamlIdp().getResponse().getSkewAllowance()).toSeconds();
        return dt.plusSeconds(skewAllowance).toInstant();
    }
This is {@link SamlProfileSamlAuthNStatementBuilder}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/authn/SamlProfileSamlAuthNStatementBuilder.java