@Override
    public Optional<PasswordlessAuthenticationToken> findToken(final String username) {
        HttpResponse response = null;
        try {
            val parameters = new HashMap<String, String>();
            parameters.put("username", username);
            val exec = HttpExecutionRequest.builder()
                .basicAuthPassword(restProperties.getBasicAuthPassword())
                .basicAuthUsername(restProperties.getBasicAuthUsername())
                .method(HttpMethod.GET)
                .url(restProperties.getUrl())
                .headers(restProperties.getHeaders())
                .parameters(parameters)
                .build();

            response = HttpUtils.execute(exec);
            if (response != null && ((HttpEntityContainer) response).getEntity() != null) {
                try (val content = ((HttpEntityContainer) response).getEntity().getContent()) {
                    val token = IOUtils.toString(content, StandardCharsets.UTF_8);
                    val result = decodePasswordlessAuthenticationToken(token);
                    return Optional.of(result);
                }
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        } finally {
            HttpUtils.close(response);
        }
        return Optional.empty();
    }
This is {@link RestfulPasswordlessTokenRepository}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-passwordless-api/src/main/java/org/apereo/cas/impl/token/RestfulPasswordlessTokenRepository.java