For the realm, I'm using an arbitrary string.  Is there a specific realm I 
should be using?  That whole realm thing confuses me a bit, I'm unclear as to 
how it's used.

Scott

From: Francois Papon <[email protected]>
Sent: Thursday, June 20, 2019 11:04 PM
To: [email protected]
Subject: Re: Karaf 4.2.5 Jetty client


Hi Scott,

Are you using the Karaf realm?

I'm not sure how the Jetty client is connected to the authentication store.

regards,

François

[email protected]<mailto:[email protected]>
Le 20/06/2019 à 20:23, Leschke, Scott a écrit :
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