I realize this isn't strictly a Karaf question but I'm having trouble 
authenticating using the Jetty client in Karaf 4.2.5.  I'm getting a 401 from a 
server (on a GET) that I'm unable to resolve even though I've verified that the 
user/pwd I have is correct using both Chrome and Postman.

The code I'm using to setup the client is as shown below.  To the best of my 
knowledge this is correct yet I'm still getting a 401.
Any help on this would be greatly appreciated.

client = new HttpClient(new SslContextFactory (true));
client.start();

...  elsewhere ....

AuthenticationStore auths = getClient().getAuthenticationStore();
String authRealm          = "Any";

if (auths.findAuthentication("Basic", uri, authRealm) != null) return;

auths.addAuthentication(new BasicAuthentication(uri, authRealm, "myUserName", 
"myPassword");

Reply via email to