@Override
    public PersonAttributes getPerson(final String uid, final Set<PersonAttributes> resultPeople, final PersonAttributeDaoFilter filter) {
        try {
            if (!this.isEnabled()) {
                return null;
            }
            val builder = HttpClientBuilder.create();
            val uriBuilder = new URIBuilder(this.url);
            if (StringUtils.isNotBlank(this.basicAuthUsername) && StringUtils.isNotBlank(this.basicAuthPassword)) {
                val provider = new BasicCredentialsProvider();
                val credentials = new UsernamePasswordCredentials(this.basicAuthUsername, this.basicAuthPassword.toCharArray());
                provider.setCredentials(new AuthScope(new HttpHost(uriBuilder.getHost())), credentials);
                builder.setDefaultCredentialsProvider(provider);
            }
            
            uriBuilder.addParameter(principalId, Objects.requireNonNull(uid, () -> principalId + " cannot be null"));
            this.parameters.forEach(uriBuilder::addParameter);

            val uri = uriBuilder.build();
            val request = method.equalsIgnoreCase(HttpMethod.GET.name()) ? new HttpGet(uri) : new HttpPost(uri);
            this.headers.forEach(request::addHeader);

            try (val client = builder.build(); val response = client.execute(request)) {
                val attributes = MAPPER.readValue(response.getEntity().getContent(), Map.class);
                return new SimplePersonAttributes(uid, PersonAttributeDao.stuffAttributesIntoList(attributes));
            }
        } catch (final Exception e) {
            throw new IllegalArgumentException(e.getMessage(), e);
        }
    }
Provides the ability to contact a URL resource to ask for attributes.
Support GET/POST endpoints, and provides the username in form of a parameter.
The response is expected to be a JSON map.

@author Misagh Moayyed
@since 7.1.0
support/cas-server-support-person-directory-core/src/main/java/org/apereo/cas/persondir/RestfulPersonAttributeDao.java