From:   Simone Bordet <[email protected]>
To:     JETTY user mailing list <[email protected]>
Date:   02.08.2016 16:13
Subject:        Re: [jetty-users] Jetty HttpClient Baisc Authentication - 
could not find any realm
Sent by:        [email protected]



Hi,

On Tue, Aug 2, 2016 at 2:41 PM,  <[email protected]> wrote:
> Hello everybody,
>
> I am trying to migrate from Apache HttpClient 3.x to Jetty HttpClient
> 9.2.12, but I am facing problems, how to make a simple basic 
authentication.
>
> I have no specific realm to match.
> In the BasicAuthentication constuctor  - BasicAuthentication(URI uri, 
String
> realm, String user, String password), I have passed a null as second
> parameter, but I noticed that passing null as a realm results in an NPE
> during the request.
>
> I am searching for something as any realm value. What value should I 
use?

Have you tried the empty string ?

Is the server sending the challenge with a realm at all ?

Can you detail the server response headers ?

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe 
from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Hi, 

I have set up a local Proxy Server and made a few tests:
- I have tried with the empty String - I received 407 Unauthorized as 
response;
- I have tried with a valid realm value ("CCProxy Authorization"), I 
receive 200 OK as response;
- empty realm String ends with NPE;
- the server is sending the challenge with a realm;
- Response headers :
Server: Proxy
Proxy-Authenticate: Basic realm="CCProxy Authorization"
Cache-Control: no-cache
Connection: close
Proxy-Connection: Close
Content-Length: 265

The question remains still the same - is there any option like in the 
Apache HttpClient API to set credentials for any realm ? 

BR
Svilen Valkanov 
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to