@EverythingIsNonNull public final class JavaNetAuthenticator extends java.lang.Object implements Authenticator
Authenticator
to Authenticator
. Configure OkHttp to use Authenticator
with OkHttpClient.Builder.authenticator
or OkHttpClient.Builder.proxyAuthenticator(Authenticator)
.NONE
Constructor and Description |
---|
JavaNetAuthenticator() |
Modifier and Type | Method and Description |
---|---|
Request |
authenticate(Route route,
Response response)
Returns a request that includes a credential to satisfy an authentication challenge in
response . |
private java.net.InetAddress |
getConnectToInetAddress(java.net.Proxy proxy,
HttpUrl url) |
public Request authenticate(Route route, Response response) throws java.io.IOException
Authenticator
response
. Returns null if the challenge cannot be satisfied.
The route is best effort, it currently may not always be provided even when logically available. It may also not be provided when an authenticator is re-used manually in an application interceptor, such as when implementing client-specific retries.
authenticate
in interface Authenticator
java.io.IOException
private java.net.InetAddress getConnectToInetAddress(java.net.Proxy proxy, HttpUrl url) throws java.io.IOException
java.io.IOException