brikar-client/src/main/java/com/truward/brikar/client/rest/RestOperationsFactory.java
public void setCredentials(@Nonnull List<ServiceClientCredentials> credentials) {
    credentialsProvider.clear();

    for (final ServiceClientCredentials cred : credentials) {
      final URI uri = cred.getBaseUri();
      credentialsProvider.setCredentials(new AuthScope(
              new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme())),
          new UsernamePasswordCredentials(cred.getUsername(), cred.getPassword().toString()));
    }
  }
public void setCredentials(@Nonnull List<ServiceClientCredentials> credentials) {
    credentialsProvider.clear();

    for (final ServiceClientCredentials cred : credentials) {
      final URI uri = cred.getBaseUri();
      credentialsProvider.setCredentials(new AuthScope(
              new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme())),
          new UsernamePasswordCredentials(cred.getUsername(), cred.getPassword().toString()));
    }
  }
Sets credentials for use when accessing service APIs.
Note, that multiple calls to this method override previously set credentials.

@param credentials Credential list to use