@Override
    public Collection<? extends OneTimeTokenAccount> get(final String username) {
        val rest = gauth.getRest();
        HttpResponse response = null;
        try {
            val headers = CollectionUtils.<String, String>wrap(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE, "username", username);
            headers.putAll(rest.getHeaders());

            val exec = HttpExecutionRequest.builder()
                .basicAuthPassword(rest.getBasicAuthPassword())
                .basicAuthUsername(rest.getBasicAuthUsername())
                .method(HttpMethod.GET)
                .url(rest.getUrl())
                .headers(headers)
                .build();
            response = HttpUtils.execute(exec);

            if (response != null) {
                val status = HttpStatus.valueOf(response.getCode());
                if (status.is2xxSuccessful()) {
                    try (val contis = ((HttpEntityContainer) response).getEntity().getContent()) {
                        val content = IOUtils.toString(contis, StandardCharsets.UTF_8);
                        if (content != null) {
                            val values = new TypeReference<List<GoogleAuthenticatorAccount>>() {
                            };
                            val result = MAPPER.readValue(JsonValue.readHjson(content).toString(), values);
                            return decode(Objects.requireNonNull(result));
                        }
                    }
                }
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        } finally {
            HttpUtils.close(response);
        }
        return null;
    }
This is {@link RestGoogleAuthenticatorTokenCredentialRepository}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-gauth-core/src/main/java/org/apereo/cas/gauth/credential/RestGoogleAuthenticatorTokenCredentialRepository.java