public class DigestAuthentication extends Object implements Authentication
AuthenticationStore retrieved from the HttpClient
via HttpClient.getAuthenticationStore().Authentication.Result| Constructor and Description |
|---|
DigestAuthentication(URI uri,
String realm,
String user,
String password) |
| Modifier and Type | Method and Description |
|---|---|
Authentication.Result |
authenticate(Request request,
ContentResponse response,
String wwwAuthenticate,
Attributes context)
Executes the authentication mechanism for the given request, returning a
Authentication.Result that can be
used to actually authenticate the request via Authentication.Result.apply(Request). |
boolean |
matches(String type,
URI uri,
String realm)
Matches
Authentications based on the given parameters |
public boolean matches(String type, URI uri, String realm)
AuthenticationAuthentications based on the given parametersmatches in interface Authenticationtype - the Authentication type such as "Basic" or "Digest"uri - the request URIrealm - the authentication realm as provided in the WWW-Authenticate response headerpublic Authentication.Result authenticate(Request request, ContentResponse response, String wwwAuthenticate, Attributes context)
AuthenticationAuthentication.Result that can be
used to actually authenticate the request via Authentication.Result.apply(Request).
If a request for "/secure" returns a Authentication.Result, then the result may be used for other
requests such as "/secure/foo" or "/secure/bar", unless those resources are protected
by other realms.authenticate in interface Authenticationrequest - the request to execute the authentication mechanism forresponse - the 401 response obtained in the previous attempt to request the protected resourcewwwAuthenticate - the WWW-Authenticate header chosen for this authentication
(among the many that the response may contain)context - the conversation context in case the authentication needs multiple exchanges
to be completed and information needs to be stored across exchangesCopyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.