Authenticationpublic class DigestAuthentication extends AbstractAuthentication
Applications should create objects of this class and add them to the
AuthenticationStore retrieved from the HttpClient
via HttpClient.getAuthenticationStore().
Authentication.HeaderInfo, Authentication.ResultANY_REALM| Constructor | Description |
|---|---|
DigestAuthentication(java.net.URI uri,
java.lang.String realm,
java.lang.String user,
java.lang.String password) |
| Modifier and Type | Method | Description |
|---|---|---|
Authentication.Result |
authenticate(Request request,
ContentResponse response,
Authentication.HeaderInfo headerInfo,
org.eclipse.jetty.util.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). |
java.lang.String |
getType() |
|
boolean |
matches(java.lang.String type,
java.net.URI uri,
java.lang.String realm) |
Matches
Authentications based on the given parameters |
getRealm, getURI, matchesURIpublic DigestAuthentication(java.net.URI uri,
java.lang.String realm,
java.lang.String user,
java.lang.String password)
uri - the URI to match for the authenticationrealm - the realm to match for the authenticationuser - the user that wants to authenticatepassword - the password of the userpublic java.lang.String getType()
getType in class AbstractAuthenticationpublic boolean matches(java.lang.String type,
java.net.URI uri,
java.lang.String realm)
AuthenticationAuthentications based on the given parametersmatches in interface Authenticationmatches in class AbstractAuthenticationtype - 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, Authentication.HeaderInfo headerInfo, org.eclipse.jetty.util.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.
request - the request to execute the authentication mechanism forresponse - the 401 response obtained in the previous attempt to request the protected resourceheaderInfo - the WWW-Authenticate (or Proxy-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–2018 Webtide. All rights reserved.