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 |
|---|---|
| public static class | BasicAuthentication.BasicResult
Basic authentication result. |
| Access | Constructor and Description |
|---|---|
| public | BasicAuthentication(URI
the URI to match for the authentication uri, String the realm to match for the authentication realm, String the user that wants to authenticate user, String the password of the user password)
|
| Modifier and Type | Method and Description |
|---|---|
| public Authentication. | authenticate(Request
the request to execute the authentication mechanism for request, ContentResponse the 401 response obtained in the previous attempt to request the protected resource response, Authentication.the headerInfo,WWW-Authenticate (or Proxy-Authenticate) header chosen for this
authentication (among the many that the response may contain)the conversation context in case the authentication needs multiple exchanges
to be completed and information needs to be stored across exchanges context)Implements org. Result that can be
used to actually authenticate the request via Authentication..
|
| public String |
| password | back to summary |
|---|---|
| private final String password | |
| user | back to summary |
|---|---|
| private final String user | |
| BasicAuthentication | back to summary |
|---|---|
| public BasicAuthentication(URI uri, String realm, String user, String password) | |
| authenticate | back to summary |
|---|---|
| public Authentication. Implements org. Doc from org. Executes the authentication mechanism for the given request, returning a
If a request for
| |
| getType | back to summary |
|---|---|
| public String getType() Implements abstract org.
| |
Application may utilize this class directly via
AuthenticationStore#addAuthenticationResult(Result)
to perform preemptive authentication, that is immediately
sending the authorization header based on the fact that the
URI is known to require authentication and that username
and password are known a priori.
| Modifier and Type | Field and Description |
|---|---|
| private final HttpHeader | |
| private final URI | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | apply(Request
the request to authenticate request)Implements org. |
| public URI | |
| public String |
| header | back to summary |
|---|---|
| private final HttpHeader header | |
| uri | back to summary |
|---|---|
| private final URI uri | |
| value | back to summary |
|---|---|
| private final String value | |
| BasicResult | back to summary |
|---|---|
| public BasicResult(URI uri, String user, String password) | |
| BasicResult | back to summary |
|---|---|
| public BasicResult(URI uri, HttpHeader header, String user, String password) | |
| BasicResult | back to summary |
|---|---|
| public BasicResult(URI uri, HttpHeader header, String user, String password, Charset charset) | |
| apply | back to summary |
|---|---|
| public void apply(Request request) Implements org. Doc from org. Applies the authentication result to the given request.
Typically, a | |
| getURI | back to summary |
|---|---|
| public URI getURI() Implements org.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |