private String getMappedAuthenticationContextClass(final SamlProfileBuilderContext context,
                                                       final Pair<AuthnContextClassRef, String> mappedMethod) {

        val requestedMappedValues = new ArrayList<>(org.springframework.util.StringUtils.commaDelimitedListToSet(mappedMethod.getValue()));
        val attributes = context.getAuthenticatedAssertion().orElseThrow().getAttributes();
        val contextAttributes = org.springframework.util.StringUtils.commaDelimitedListToSet(
            casProperties.getAuthn().getMfa().getCore().getAuthenticationContextAttribute());
        for (val contextAttribute : contextAttributes) {
            LOGGER.debug("Checking for mapped authentication context method [{}] in attributes [{}] via [{}]",
                requestedMappedValues, attributes, contextAttribute);
            if (attributes.containsKey(contextAttribute)) {
                val authnContext = attributes.get(contextAttribute);
                val satisfiedContext = CollectionUtils.firstElement(authnContext)
                    .map(Object::toString)
                    .orElse(StringUtils.EMPTY);
                LOGGER.debug("Comparing satisfied authentication context [{}] against [{}]", satisfiedContext, mappedMethod.getValue());
                if (requestedMappedValues.contains(satisfiedContext)) {
                    return mappedMethod.getLeft().getURI();
                }
            }
        }
        return null;
    }
This is {@link SamlProfileAuthnContextClassRefBuilder}.

@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/SamlProfileAuthnContextClassRefBuilder.java