default String getClientNameFromAuthentication(final Authentication authentication) {
        val clientNames = authentication.getAttributes().getOrDefault(
            ClientCredential.AUTHENTICATION_ATTRIBUTE_CLIENT_NAME, new ArrayList<>());
        return CollectionUtils.firstElement(clientNames).map(Object::toString).orElse(StringUtils.EMPTY);
    }
Gets client name from authentication.

@param authentication the authentication
@return the client name from authentication
support/cas-server-support-pac4j-api/src/main/java/org/apereo/cas/web/flow/DelegatedClientIdentityProviderAuthorizer.java