public class BasicAuthentication extends AbstractAuthentication
Applications should create objects of this class and add them to the
AuthenticationStore retrieved from the HttpClient
via HttpClient.getAuthenticationStore().
| Modifier and Type | Class and Description |
|---|---|
static class |
BasicAuthentication.BasicResult
Basic authentication result.
|
Authentication.HeaderInfo, Authentication.ResultANY_REALM| Constructor and Description |
|---|
BasicAuthentication(URI uri,
String realm,
String user,
String password) |
| Modifier and Type | Method and Description |
|---|---|
Authentication.Result |
authenticate(Request request,
ContentResponse response,
Authentication.HeaderInfo headerInfo,
Attributes context)
Executes the authentication mechanism for the given request, returning a
Result that can be
used to actually authenticate the request via Authentication.Result.apply(Request). |
String |
getType() |
getRealm, getURI, matches, matchesURIpublic String getType()
getType in class AbstractAuthenticationpublic Authentication.Result authenticate(Request request, ContentResponse response, Authentication.HeaderInfo headerInfo, Attributes context)
AuthenticationResult that can be
used to actually authenticate the request via Authentication.Result.apply(Request).
If a request for "/secure" returns a 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 © 2010 - 2020 Adobe. All Rights Reserved