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 |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final Random | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | DigestAuthentication(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)Construct a DigestAuthentication with a |
| public |
| 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. Executes the authentication mechanism for the given request, returning a |
| private MessageDigest | |
| public String | |
| public boolean | matches(String
the 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 headerOverrides org. Implements org. Matches |
| password | back to summary |
|---|---|
| private final String password | |
| random | back to summary |
|---|---|
| private final Random random | |
| user | back to summary |
|---|---|
| private final String user | |
| DigestAuthentication | back to summary |
|---|---|
| public DigestAuthentication(URI uri, String realm, String user, String password) Construct a DigestAuthentication with a | |
| DigestAuthentication | back to summary |
|---|---|
| public DigestAuthentication(URI uri, String realm, String user, String password, Random random) | |
| 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
| |
| getMessageDigest | back to summary |
|---|---|
| private MessageDigest getMessageDigest(String algorithm) | |
| getType | back to summary |
|---|---|
| public String getType() Implements abstract org.
| |
| matches | back to summary |
|---|---|
| public boolean matches(String type, URI uri, String realm) Overrides org. Implements org. Doc from org. Matches
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final byte[] | |
| private final HttpHeader | |
| private final String | |
| private final AtomicInteger | |
| private final String | |
| private final String | |
| private final String | |
| private final String | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | DigestResult(HttpHeader header, byte[] content, String realm, String user, String password, String algorithm, String nonce, String qop, String opaque)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | apply(Request
the request to authenticate request)Implements org. Applies the authentication result to the given request. |
| public URI | |
| private String | |
| private String | |
| private String |
| algorithm | back to summary |
|---|---|
| private final String algorithm | |
| content | back to summary |
|---|---|
| private final byte[] content | |
| header | back to summary |
|---|---|
| private final HttpHeader header | |
| nonce | back to summary |
|---|---|
| private final String nonce | |
| nonceCount | back to summary |
|---|---|
| private final AtomicInteger nonceCount | |
| opaque | back to summary |
|---|---|
| private final String opaque | |
| password | back to summary |
|---|---|
| private final String password | |
| qop | back to summary |
|---|---|
| private final String qop | |
| realm | back to summary |
|---|---|
| private final String realm | |
| user | back to summary |
|---|---|
| private final String user | |
| DigestResult | back to summary |
|---|---|
| public DigestResult(HttpHeader header, byte[] content, String realm, String user, String password, String algorithm, String nonce, String qop, String opaque) | |
| 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.
| |
| newClientNonce | back to summary |
|---|---|
| private String newClientNonce() | |
| nextNonceCount | back to summary |
|---|---|
| private String nextNonceCount() | |
| toHexString | back to summary |
|---|---|
| private String toHexString(byte[] bytes) | |