HttpRequestInterceptor () { return new HttpRequestInterceptor() { @Override public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { // pass if (request instanceof HttpRequestWrapper wrapper) { try { wrapper.setURI(new URIBuilder(wrapper.getURI()) .addParameter("token", myPassword) .addParameter("key", TrelloRepositoryType.DEVELOPER_KEY) .build()); } catch (URISyntaxException e) { LOG.error("Illegal URL: " + wrapper.getURI(), e); } } else { LOG.error("Cannot add required authentication query parameters to request: " + request); } } }; }