[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] Digest Authentication not working
|
Hi,
I submitted the bug.
I've tried both Basic and Digest authentication and the wireshark logs
don't show the actual credentials being sent. If I just use a browser
on the same page as the code, I can see credentials being sent and the
browser can authenticate. Is there anything in addition to the sample
code that needs to be done for the jetty http client to actually
authenticate? - Erich
On 4/6/2013 6:38 PM, Simone Bordet wrote:
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.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users