@Override
    public PropertySource<?> locate(final Environment environment) {
        val props = new Properties();

        HttpResponse response = null;
        try {
            val url = getPropertyFromEnvironment(environment, "url");
            if (StringUtils.isBlank(url)) {
                LOGGER.debug("No URL endpoint is defined to fetch CAS settings");
                return new PropertiesPropertySource(getClass().getSimpleName(), props);
            }

            val basicAuthUsername = getPropertyFromEnvironment(environment, "basic-auth-username");
            val basicAuthPassword = getPropertyFromEnvironment(environment, "basic-auth-password");

            val headers = CollectionUtils.<String, String>wrap(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
            val method = StringUtils.defaultIfBlank(getPropertyFromEnvironment(environment, "method"), HttpMethod.GET.name());

            val exec = HttpExecutionRequest.builder()
                .basicAuthPassword(basicAuthPassword)
                .basicAuthUsername(basicAuthUsername)
                .method(HttpMethod.valueOf(method.toUpperCase(Locale.ENGLISH)))
                .url(url)
                .headers(headers)
                .build();
            response = HttpUtils.execute(exec);
            if (response != null && ((HttpEntityContainer) response).getEntity() != null) {
                try (val content = ((HttpEntityContainer) response).getEntity().getContent()) {
                    val results = IOUtils.toString(content, StandardCharsets.UTF_8);
                    LOGGER.trace("Received response from endpoint [{}] as [{}]", url, results);
                    val payload = MAPPER.readValue(results, Map.class);
                    props.putAll(payload);
                }
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        } finally {
            HttpUtils.close(response);
        }

        return new PropertiesPropertySource(getClass().getSimpleName(), props);
    }
Gets property.

@param environment the environment
@param key         the key
@return the property
support/cas-server-support-configuration-cloud-rest/src/main/java/org/apereo/cas/config/RestfulPropertySourceLocator.java