Skip to main content

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

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

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)

		- Erich

Erich Bremer
http://www.ebremer.com




Back to the top