@Override
    public void populateAttributes(final AuthenticationBuilder builder, final AuthenticationTransaction transaction) {
        transaction.getPrimaryCredential().ifPresent(c -> {
            val credentialsClass = c.getClass().getName();
            val authenticationMethod = this.authenticationMethods.getOrDefault(credentialsClass, AUTHN_METHOD_UNSPECIFIED);
            builder.addAttribute(ATTRIBUTE_AUTHENTICATION_METHOD, authenticationMethod);
        });

    }
Instantiates a new SAML authentication meta data populator.
support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/authentication/SamlAuthenticationMetaDataPopulator.java