protected AuthnStatement buildAuthnStatement(final SamlProfileBuilderContext context) throws Exception {
        
        val id = buildAuthnStatementSessionIdex(context);
        val authnInstant = DateTimeUtils.zonedDateTimeOf(context.getAuthenticatedAssertion().orElseThrow().getAuthenticationDate());

        val authnContextClass = authnContextClassRefBuilder.build(context);
        val statement = newAuthnStatement(authnContextClass, authnInstant, id);

        if (!context.getRegisteredService().isSkipGeneratingSessionNotOnOrAfter()) {
            statement.setSessionNotOnOrAfter(buildSessionNotOnOrAfter(context));
        }

        val subjectLocality = buildSubjectLocality(context);
        if (subjectLocality != null) {
            statement.setSubjectLocality(subjectLocality);
        }
        return statement;
    }
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