As one requests needs basic auth credentials, and apparently calling setCredentials() causes an error, your best be might be to not use the credentials provider at all and set the Basic auth header manually (using setHeader() on the request) only when you need it.

Edit: Here's how you should create a threadsafe shared HttpClient instance: