Authentication represents a mechanism to authenticate requests for protected resources.
Authentications are added to an AuthenticationStore, which is then
queried to find the right
Authentication mechanism to use based on its type, URI and realm, as returned by
WWW-Authenticate response headers.
If an Authentication mechanism is found, it is then
executed for the given request,
returning an Authentication., which is then stored in the AuthenticationStore
so that subsequent requests can be preemptively authenticated.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Authentication.HeaderInfo
Structure holding information about the |
| public static interface | Authentication.Result
|
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ANY_REALM
Constant used to indicate that any realm will match. |
| Modifier and Type | Method and Description |
|---|---|
| public Authentication. | Returns: the authentication result, or null if the authentication could not be performedthe 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)Executes the authentication mechanism for the given request, returning a |
| public boolean | Returns: true if this authentication matches, false otherwisethe type, URI Authentication type such as "Basic" or "Digest"the request URI uri, String the authentication realm as provided in the realm)WWW-Authenticate response headerMatches |
| ANY_REALM | back to summary |
|---|---|
| public static final String ANY_REALM Constant used to indicate that any realm will match.
| |
| authenticate | back to summary |
|---|---|
| public Authentication. Executes the authentication mechanism for the given request, returning a
If a request for
| |
| matches | back to summary |
|---|---|
| public boolean matches(String type, URI uri, String realm) Matches
| |
WWW-Authenticate (or Proxy-Authenticate) header.
| Modifier and Type | Field and Description |
|---|---|
| private final HttpHeader | |
| private final Map | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public HttpHeader | |
| public String | |
| public Map | |
| public String | |
| public String |
| header | back to summary |
|---|---|
| private final HttpHeader header | |
| params | back to summary |
|---|---|
| private final Map<String, String> params | |
| type | back to summary |
|---|---|
| private final String type | |
| HeaderInfo | back to summary |
|---|---|
| public HeaderInfo(HttpHeader header, String type, Map<String, String> params) throws IllegalArgumentException | |
| getBase64 | back to summary |
|---|---|
public String getBase64()
| |
| getHeader | back to summary |
|---|---|
public HttpHeader getHeader()
| |
| getParameter | back to summary |
|---|---|
public String getParameter(String paramName)
| |
| getParameters | back to summary |
|---|---|
| public Map | |
| getRealm | back to summary |
|---|---|
public String getRealm()
| |
| getType | back to summary |
|---|---|
public String getType()
| |
Result holds the information needed to authenticate a Request via Authentication.Result#apply(Request) .
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public URI |
| apply | back to summary |
|---|---|
| public void apply(Request request) Applies the authentication result to the given request.
Typically, a
| |
| getURI | back to summary |
|---|---|
| public URI getURI() | |