Package com.squareup.okhttp
Interface OkAuthenticator
public interface OkAuthenticator
Responds to authentication challenges from the remote web or proxy server by
returning credentials.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classOkAuthenticator.ChallengeAn RFC 2617 challenge.static classOkAuthenticator.CredentialAn RFC 2617 credential. -
Method Summary
Modifier and Type Method Description OkAuthenticator.Credentialauthenticate(Proxy proxy, URL url, List<OkAuthenticator.Challenge> challenges)Returns a credential that satisfies the authentication challenge made byurl.OkAuthenticator.CredentialauthenticateProxy(Proxy proxy, URL url, List<OkAuthenticator.Challenge> challenges)Returns a credential that satisfies the authentication challenge made byproxy.
-
Method Details
-
authenticate
OkAuthenticator.Credential authenticate(Proxy proxy, URL url, List<OkAuthenticator.Challenge> challenges) throws IOExceptionReturns a credential that satisfies the authentication challenge made byurl. Returns null if the challenge cannot be satisfied. This method is called in response to an HTTP 401 unauthorized status code sent by the origin server.- Parameters:
challenges- parsed "WWW-Authenticate" challenge headers from the HTTP response.- Throws:
IOException
-
authenticateProxy
OkAuthenticator.Credential authenticateProxy(Proxy proxy, URL url, List<OkAuthenticator.Challenge> challenges) throws IOExceptionReturns a credential that satisfies the authentication challenge made byproxy. Returns null if the challenge cannot be satisfied. This method is called in response to an HTTP 401 unauthorized status code sent by the proxy server.- Parameters:
challenges- parsed "Proxy-Authenticate" challenge headers from the HTTP response.- Throws:
IOException
-