org.apache.commons.httpclient
Class Authenticator

java.lang.Object
  |
  +--org.apache.commons.httpclient.Authenticator

Deprecated. use HttpAuthenticator

public class Authenticator
extends Object

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 BasicScheme 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, Rodney Waldhoff, Jeff Dever, Ortwin Gl?ck, Sean C. Sullivan, Adrian Sutton, Mike Bowler, Oleg Kalnichevski

Field Summary
static String PROXY_AUTH
          Deprecated. The proxy authenticate challange header.
static String PROXY_AUTH_RESP
          Deprecated. The proxy authenticate response header.
static String WWW_AUTH
          Deprecated. The www authenticate challange header.
static String WWW_AUTH_RESP
          Deprecated. The www authenticate response header.
 
Constructor Summary
Authenticator()
          Deprecated.  
 
Method Summary
static boolean authenticate(HttpMethod method, HttpState state)
          Deprecated. use HttpAuthenticator.authenticate(AuthScheme, HttpMethod, HttpConnection, HttpState)
static boolean authenticateProxy(HttpMethod method, HttpState state)
          Deprecated. use HttpAuthenticator.authenticateProxy(AuthScheme, HttpMethod, HttpConnection, HttpState)
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WWW_AUTH

public static final String WWW_AUTH
Deprecated. 
The www authenticate challange header.

WWW_AUTH_RESP

public static final String WWW_AUTH_RESP
Deprecated. 
The www authenticate response header.

PROXY_AUTH

public static final String PROXY_AUTH
Deprecated. 
The proxy authenticate challange header.

PROXY_AUTH_RESP

public static final String PROXY_AUTH_RESP
Deprecated. 
The proxy authenticate response header.
Constructor Detail

Authenticator

public Authenticator()
Deprecated. 
Method Detail

authenticate

public static boolean authenticate(HttpMethod method,
                                   HttpState state)
                            throws HttpException,
                                   UnsupportedOperationException
Deprecated. use HttpAuthenticator.authenticate(AuthScheme, HttpMethod, HttpConnection, HttpState)

Add requisite authentication credentials to the given method in the given state if possible.
Parameters:
method - the HttpMethod which requires authentication
state - the HttpState object providing Credentials
Returns:
true if the Authenticate response header was added
Throws:
HttpException - when a parsing or other error occurs
UnsupportedOperationException - when the challenge type is not supported
See Also:
HttpState.setCredentials(String,Credentials)

authenticateProxy

public static boolean authenticateProxy(HttpMethod method,
                                        HttpState state)
                                 throws HttpException,
                                        UnsupportedOperationException
Deprecated. use HttpAuthenticator.authenticateProxy(AuthScheme, HttpMethod, HttpConnection, HttpState)

Add requisite proxy authentication credentials to the given method in the given state if possible.
Parameters:
method - the HttpMethod which requires authentication
state - the HttpState object providing Credentials
Returns:
true if the Authenticate response header was added
Throws:
HttpException - when a parsing or other error occurs
UnsupportedOperationException - when the given challenge type is not supported
See Also:
HttpState.setProxyCredentials(String,Credentials)


Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.