Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Digest Authentication not working

Hi,

On Sat, Apr 6, 2013 at 4:52 AM, Erich Bremer <erich@xxxxxxxxxxx> wrote:
> Digest authentication does not seem to be working.  I checked with wireshark
> and the auth information is not present but verified it was visible with
> curl which does upload fine and does send the digest auth credentials.
>
> The code example used is on the following URL:
>
> http://www.eclipse.org/jetty/documentation/current/http-client-other.html
>
> under the section "Authentication Support":
>
> String uri ="http://domain.com/secure";;
> String realm ="MyRealm";
> String user ="username";
> String pass ="password";
>
> // Add authentication credentials
> AuthenticationStore auth = httpClient.getAuthenticationStore();
> auth.addAuthentication(new  BasicAuthentication(uri, realm, user, pass));

You are adding a BasicAuthentication for Digest authentication ?

You should add a DigestAuthentication, not a BasicAuthentication.

Perhaps the documentation is too laconic about... it shows an example
of Basic authentication.
Did you misinterpret it that the same code would work for Digest
authentication too ?

> ContentResponse response = httpClient
>         .newRequest(uri)
>         .send()
>         .get(5, TimeUnit.SECONDS);
>
>
> There also seems to be an error in the text:
>
> new  BasicAuthentication(uri, realm, user, pass)
> looks like it is
> expecting (uri, string, string, string)
> not (string, string, string, string)

Right.

Please file an issue at the documentation component here:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top