| java.lang.Object org.apache.commons.httpclient.auth.HttpAuthenticator
HttpAuthenticator | final public class HttpAuthenticator (Code) | | Utility methods for HTTP authorization and authentication. This class
provides utility methods for generating responses to HTTP www and proxy
authentication challenges.
A client SHOULD assume that all paths at or deeper than the depth of the
last symbolic element in the path field of the Request-URI also are within
the protection space specified by the basic realm value of the current
challenge. A client MAY preemptively send the corresponding Authorization
header with requests for resources in that space without receipt of another
challenge from the server. Similarly, when a client sends a request to a
proxy, it may reuse a userid and password in the Proxy-Authorization header
field without receiving another challenge from the proxy server.
author: Remy Maucherat author: Rodney Waldhoff author: Jeff Dever author: Ortwin Gl�ck author: Sean C. Sullivan author: Adrian Sutton author: Mike Bowler author: Oleg Kalnichevski |
Method Summary | |
public static boolean | authenticate(AuthScheme authscheme, HttpMethod method, HttpConnection conn, HttpState state) Attempt to provide requisite authentication credentials to the
given method in the given context using the given
authentication scheme.
Parameters: authscheme - The authentication scheme to be used Parameters: method - The HttpMethod which requires authentication Parameters: conn - the connection to a specific host. | public static boolean | authenticateDefault(HttpMethod method, HttpConnection conn, HttpState state) Attempt to provide default authentication credentials
to the given method in the given context using basic
authentication scheme.
Parameters: method - the HttpMethod which requires authentication Parameters: conn - the connection to a specific host. | public static boolean | authenticateProxy(AuthScheme authscheme, HttpMethod method, HttpConnection conn, HttpState state) Attempt to provide requisite proxy authentication credentials
to the given method in the given context using
the given authentication scheme.
Parameters: authscheme - The authentication scheme to be used Parameters: method - the HttpMethod which requires authentication Parameters: conn - the connection to a specific host. | public static boolean | authenticateProxyDefault(HttpMethod method, HttpConnection conn, HttpState state) Attempt to provide default proxy authentication credentials
to the given method in the given context using basic
authentication scheme.
Parameters: method - the HttpMethod which requires authentication Parameters: conn - the connection to a specific host. | public static AuthScheme | selectAuthScheme(Header[] challenges) Chooses the strongest authentication scheme supported from the
array of authentication challenges. |
PROXY_AUTH | final public static String PROXY_AUTH(Code) | | The proxy authenticate challange header.
|
PROXY_AUTH_RESP | final public static String PROXY_AUTH_RESP(Code) | | The proxy authenticate response header.
|
WWW_AUTH | final public static String WWW_AUTH(Code) | | The www authenticate challange header.
|
WWW_AUTH_RESP | final public static String WWW_AUTH_RESP(Code) | | The www authenticate response header.
|
authenticate | public static boolean authenticate(AuthScheme authscheme, HttpMethod method, HttpConnection conn, HttpState state) throws AuthenticationException(Code) | | Attempt to provide requisite authentication credentials to the
given method in the given context using the given
authentication scheme.
Parameters: authscheme - The authentication scheme to be used Parameters: method - The HttpMethod which requires authentication Parameters: conn - the connection to a specific host. This parameter may be null if default credentials (not specific to any particular host) are to be used Parameters: state - The HttpState object providing Credentials true if the Authenticate response header was added throws: CredentialsNotAvailableException - if authentication credentialsrequired to respond to the authentication challenge are not available throws: AuthenticationException - when a parsing or other error occurs See Also: HttpState.setCredentials(StringStringCredentials) |
authenticateDefault | public static boolean authenticateDefault(HttpMethod method, HttpConnection conn, HttpState state) throws AuthenticationException(Code) | | Attempt to provide default authentication credentials
to the given method in the given context using basic
authentication scheme.
Parameters: method - the HttpMethod which requires authentication Parameters: conn - the connection to a specific host. This parameter may be null if default credentials (not specific to any particular host) are to be used Parameters: state - the HttpState object providing Credentials true if the Authenticate response header was added throws: InvalidCredentialsException - if authentication credentialsare not valid or not applicable for basic scheme throws: AuthenticationException - when a parsing or other error occurs See Also: HttpState.setCredentials(StringStringCredentials) |
authenticateProxy | public static boolean authenticateProxy(AuthScheme authscheme, HttpMethod method, HttpConnection conn, HttpState state) throws AuthenticationException(Code) | | Attempt to provide requisite proxy authentication credentials
to the given method in the given context using
the given authentication scheme.
Parameters: authscheme - The authentication scheme to be used Parameters: method - the HttpMethod which requires authentication Parameters: conn - the connection to a specific host. This parameter may be null if default credentials (not specific to any particular host) are to be used Parameters: state - the HttpState object providing Credentials true if the Proxy-Authenticate response header was added throws: CredentialsNotAvailableException - if authentication credentialsrequired to respond to the authentication challenge are not available throws: AuthenticationException - when a parsing or other error occurs See Also: HttpState.setCredentials(StringStringCredentials) |
authenticateProxyDefault | public static boolean authenticateProxyDefault(HttpMethod method, HttpConnection conn, HttpState state) throws AuthenticationException(Code) | | Attempt to provide default proxy authentication credentials
to the given method in the given context using basic
authentication scheme.
Parameters: method - the HttpMethod which requires authentication Parameters: conn - the connection to a specific host. This parameter may be null if default credentials (not specific to any particular host) are to be used Parameters: state - the HttpState object providing Credentials true if the Proxy-Authenticate response header was added throws: InvalidCredentialsException - if authentication credentialsare not valid or not applicable for basic scheme throws: AuthenticationException - when a parsing or other error occurs See Also: HttpState.setCredentials(StringStringCredentials) |
|
|