You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "Leschke, Scott" <SL...@medline.com> on 2019/06/20 16:23:03 UTC
Karaf 4.2.5 Jetty client
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");
RE: Karaf 4.2.5 Jetty client
Posted by "Leschke, Scott" <SL...@medline.com>.
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 <SL...@medline.com>
Sent: Friday, June 21, 2019 9:16 AM
To: user@karaf.apache.org
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: user@karaf.apache.org
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
fpapon@apache.org<ma...@apache.org>
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");
RE: Karaf 4.2.5 Jetty client
Posted by "Leschke, Scott" <SL...@medline.com>.
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 <fr...@openobject.fr>
Sent: Thursday, June 20, 2019 11:04 PM
To: user@karaf.apache.org
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
fpapon@apache.org<ma...@apache.org>
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");
Re: Karaf 4.2.5 Jetty client
Posted by Francois Papon <fr...@openobject.fr>.
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
fpapon@apache.org
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”);
>
>
>