public class DigestAuthenticator extends java.lang.Object implements CachingAuthenticator
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROXY_AUTH |
static java.lang.String |
PROXY_AUTH_RESP |
static java.lang.String |
WWW_AUTH |
static java.lang.String |
WWW_AUTH_RESP |
| Constructor and Description |
|---|
DigestAuthenticator(Credentials credentials) |
DigestAuthenticator(Credentials credentials,
java.nio.charset.Charset credentialsCharset) |
| Modifier and Type | Method and Description |
|---|---|
okhttp3.Request |
authenticate(okhttp3.Route route,
okhttp3.Response response) |
okhttp3.Request |
authenticateWithState(okhttp3.Route route,
okhttp3.Request request)
Authenticate the new request using cached information already established from an earlier
authentication.
|
static java.lang.String |
createCnonce()
Creates a random cnonce value based on the current time.
|
static byte[] |
getAsciiBytes(java.lang.String data) |
java.nio.charset.Charset |
getCredentialsCharset()
Returns the charset used for the credentials.
|
boolean |
isProxy() |
protected void |
parseChallenge(java.lang.String buffer,
int pos,
int len,
java.util.Map<java.lang.String,java.lang.String> params) |
void |
setProxy(boolean proxy) |
public static final java.lang.String PROXY_AUTH
public static final java.lang.String PROXY_AUTH_RESP
public static final java.lang.String WWW_AUTH
public static final java.lang.String WWW_AUTH_RESP
public DigestAuthenticator(Credentials credentials)
public DigestAuthenticator(Credentials credentials, java.nio.charset.Charset credentialsCharset)
public static java.lang.String createCnonce()
protected void parseChallenge(java.lang.String buffer,
int pos,
int len,
java.util.Map<java.lang.String,java.lang.String> params)
public okhttp3.Request authenticate(okhttp3.Route route,
okhttp3.Response response)
throws java.io.IOException
authenticate in interface okhttp3.Authenticatorjava.io.IOExceptionpublic okhttp3.Request authenticateWithState(okhttp3.Route route,
okhttp3.Request request)
throws java.io.IOException
CachingAuthenticatorauthenticateWithState in interface CachingAuthenticatorroute - the route to userequest - the new request to be authenticated.java.io.IOException - in case of a communication problempublic java.nio.charset.Charset getCredentialsCharset()
public static byte[] getAsciiBytes(java.lang.String data)
public boolean isProxy()
public void setProxy(boolean proxy)