Karaf 4.2.5 Jetty client

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Karaf 4.2.5 Jetty client

Scott

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 | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.5 Jetty client

fpapon

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
[hidden email]
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”);

 

François Papon
fpapon@apache.org
Yupiik - https://www.yupiik.com
Reply | Threaded
Open this post in threaded view
|

RE: Karaf 4.2.5 Jetty client

Scott

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 <[hidden email]>
Sent: Thursday, June 20, 2019 11:04 PM
To: [hidden email]
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
[hidden email]

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 | Threaded
Open this post in threaded view
|

RE: Karaf 4.2.5 Jetty client

Scott

I’m curious if anybody has any thoughts on my message below.  I’m I setting up for HTTPS correctly?

 

Regards,

 

Scott

 

From: Leschke, Scott <[hidden email]>
Sent: Friday, June 21, 2019 9:16 AM
To: [hidden email]
Subject: RE: Karaf 4.2.5 Jetty client

 

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
Sent: Thursday, June 20, 2019 11:04 PM
To: [hidden email]
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
[hidden email]
 

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”);