title: Setting basic auth in microprofile rest client
body: <p>I have a service which exposes a number of Jax-RS interfaces for its services. I now want to use those interfaces to connect with the services. I am using Quarkus, which means I am using the microprofile rest client. Because I already have the JaxRS interface, using the @RegisterRestClient method is not really viable. Instead I am using the RestClientBuilder.</p>
  <pre><code>    MyService client = RestClientBuilder.newBuilder()
          .baseUri(URI.create(&quot;https://localhost:8080&quot;))
          .build(MyService.class);
  </code></pre>
  <p>The problem I am running into is authentication. The services i need to reach are locked behind basic Auth. All the guides I have found for the microprofile REST client are variations of <a href="https://itnext.io/authentication-with-microprofile-rest-client-d1e9da774f70" rel="nofollow noreferrer">this</a> where the solution is to add a headerparam. This is not possible however, because I already have the interface premade, and copy-pasting the entire thing to add a header parameter is really something i would rather avoid.</p>
  <p>It should also be mentioned that i have tried a @Provider filter to set the headers, but I can't seem to figure out how to only target a single REST client using that method, and I have several.</p>
  <p>So: How do i set up basic authentication without messing with the Jax-Rs interface itself, using the microprofile rest client?</p>