@Override
    public ByteSource getGraphics(final String username) {
        val gua = casProperties.getAuthn().getGua();
        val response = searchForId(username);
        if (LdapUtils.containsResultEntry(response)) {
            val entry = response.getEntry();
            val attribute = entry.getAttribute(gua.getLdap().getImageAttribute());
            if (attribute != null && attribute.isBinary()) {
                return ByteSource.wrap(attribute.getBinaryValue());
            }
        }
        return ByteSource.empty();
    }
This is {@link LdapUserGraphicalAuthenticationRepository}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-gua/src/main/java/org/apereo/cas/gua/impl/LdapUserGraphicalAuthenticationRepository.java