public static void trackTrustedMultifactorAuthenticationAttribute(final Authentication authentication, final String attributeName) {

        val newAuthn = DefaultAuthenticationBuilder.newInstance(authentication)
            .addAttribute(attributeName, Boolean.TRUE)
            .build();
        LOGGER.debug("Updated authentication session to remember trusted multifactor record via [{}]", attributeName);
        authentication.updateAttributes(newAuthn);
    }
Track trusted multifactor authentication attribute.

@param authentication the authentication
@param attributeName  the attribute name
support/cas-server-support-trusted-mfa-core/src/main/java/org/apereo/cas/trusted/util/MultifactorAuthenticationTrustUtils.java