protected void decideIfCredentialPasswordShouldBeReleasedAsAttribute(final Map<String, List<Object>> attributes,
                                                                         final Authentication authentication,
                                                                         final RegisteredService service) {
        val policy = service.getAttributeReleasePolicy();
        val isAuthorized = policy != null && policy.isAuthorizedToReleaseCredentialPassword();
        val element = CollectionUtils.firstElement(authentication.getAttributes().get(CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL));
        val credential = element.map(Object::toString).orElse(null);
        decideAttributeReleaseBasedOnServiceAttributePolicy(attributes, credential,
            CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL, service, isAuthorized);
    }
Default AuthenticationAttributeReleasePolicy implementation.

@author Daniel Frett
@since 5.2.0
core/cas-server-core-authentication-attributes/src/main/java/org/apereo/cas/authentication/DefaultAuthenticationAttributeReleasePolicy.java