| org.apache.commons.httpclient.auth.AuthScheme
All known Subclasses: org.apache.commons.httpclient.auth.NTLMScheme, org.apache.commons.httpclient.auth.RFC2617Scheme, org.apache.commons.httpclient.contrib.auth.NegotiateScheme, org.apache.commons.httpclient.auth.AuthSchemeBase,
AuthScheme | public interface AuthScheme (Code) | |
This interface represents an abstract challenge-response oriented
authentication scheme.
An authentication scheme should be able to support the following
functions:
- Parse and process the challenge sent by the targer server
in response to request for a protected resource
- Provide its textual designation
- Provide its parameters, if available
- Provide the realm this authentication scheme is applicable to,
if available
- Generate authorization string for the given set of credentials,
request method and URI as specificed in the HTTP request line
in response to the actual authorization challenge
Authentication schemes may ignore method name and URI parameters
if they are not relevant for the given authentication mechanism
Authentication schemes may be stateful involving a series of
challenge-response exchanges
author: Oleg Kalnichevski author: Adrian Sutton since: 2.0beta1 |
authenticate | String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException(Code) | | Produces an authorization string for the given set of
Credentials .
Parameters: credentials - The set of credentials to be used for athentication Parameters: method - The method being authenticated throws: AuthenticationException - if authorization string cannot be generated due to an authentication failure the authorization string since: 3.0 |
getID | String getID()(Code) | | Returns a String identifying the authentication challenge. This is
used, in combination with the host and port to determine if
authorization has already been attempted or not. Schemes which
require multiple requests to complete the authentication should
return a different value for each stage in the request.
Additionally, the ID should take into account any changes to the
authentication challenge and return a different value when appropriate.
For example when the realm changes in basic authentication it should be
considered a different authentication attempt and a different value should
be returned.
String a String identifying the authentication challenge. Thereturned value may be null. |
getParameter | String getParameter(String name)(Code) | | Returns authentication parameter with the given name, if available.
Parameters: name - The name of the parameter to be returned the parameter with the given name |
getRealm | String getRealm()(Code) | | Returns authentication realm. If the concept of an authentication
realm is not applicable to the given authentication scheme, returns
null .
the authentication realm |
getSchemeName | String getSchemeName()(Code) | | Returns textual designation of the given authentication scheme.
the name of the given authentication scheme |
isComplete | boolean isComplete()(Code) | | Authentication process may involve a series of challenge-response exchanges.
This method tests if the authorization process has been completed, either
successfully or unsuccessfully, that is, all the required authorization
challenges have been processed in their entirety.
true if the authentication process has been completed, false otherwise. since: 3.0 |
isConnectionBased | boolean isConnectionBased()(Code) | | Tests if the authentication scheme is provides authorization on a per
connection basis instead of usual per request basis
true if the scheme is connection based, falseif the scheme is request based. since: 3.0 |
processChallenge | void processChallenge(String challenge) throws MalformedChallengeException(Code) | | Processes the given challenge token. Some authentication schemes
may involve multiple challenge-response exchanges. Such schemes must be able
to maintain the state information when dealing with sequential challenges
Parameters: challenge - the challenge string since: 3.0 |
|
|