Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.commons.httpclient.auth.RFC2617Scheme
org.apache.commons.httpclient.auth.BasicScheme
public class BasicScheme
extends RFC2617Scheme
Constructor Summary | |
| |
|
Method Summary | |
String |
|
String |
|
static String |
|
static String |
|
String |
|
boolean |
|
boolean |
|
void |
|
Methods inherited from class org.apache.commons.httpclient.auth.RFC2617Scheme | |
getID , getParameter , getParameters , getRealm , processChallenge |
public BasicScheme()
Default constructor for the basic authetication scheme.
- Since:
- 3.0
public BasicScheme(String challenge) throws MalformedChallengeException
Deprecated. Use parameterless constructor and
AuthScheme.processChallenge(String)
methodConstructor for the basic authetication scheme.
- Parameters:
challenge
- authentication challenge
- Throws:
MalformedChallengeException
- is thrown if the authentication challenge is malformed
public String authenticate(Credentials credentials, String method, String uri) throws AuthenticationException
Deprecated. Use
authenticate(Credentials,HttpMethod)
Produces basic authorization string for the given set ofCredentials
.
- Specified by:
- authenticate in interface AuthScheme
- Parameters:
credentials
- The set of credentials to be used for athenticationmethod
- Method name is ignored by the basic authentication schemeuri
- URI is ignored by the basic authentication scheme
- Returns:
- a basic authorization string
- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure
public String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException
Produces basic authorization string for the given set ofCredentials
.
- Specified by:
- authenticate in interface AuthScheme
- Parameters:
credentials
- The set of credentials to be used for athenticationmethod
- The method being authenticated
- Returns:
- a basic authorization string
- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure
- Since:
- 3.0
public static String authenticate(UsernamePasswordCredentials credentials)
Deprecated. Use
authenticate(UsernamePasswordCredentials,String)
Returns a basic Authorization header value for the givenUsernamePasswordCredentials
.
- Parameters:
credentials
- The credentials to encode.
- Returns:
- a basic authorization string
public static String authenticate(UsernamePasswordCredentials credentials, String charset)
Returns a basic Authorization header value for the givenUsernamePasswordCredentials
and charset.
- Parameters:
credentials
- The credentials to encode.charset
- The charset to use for encoding the credentials
- Returns:
- a basic authorization string
- Since:
- 3.0
public String getSchemeName()
Returns textual designation of the basic authentication scheme.
- Specified by:
- getSchemeName in interface AuthScheme
- Returns:
basic
public boolean isComplete()
Tests if the Basic authentication process has been completed.
- Specified by:
- isComplete in interface AuthScheme
- Returns:
- true if Basic authorization has been processed, false otherwise.
- Since:
- 3.0
public boolean isConnectionBased()
Returns false. Basic authentication scheme is request based.
- Specified by:
- isConnectionBased in interface AuthScheme
- Returns:
- false.
- Since:
- 3.0
public void processChallenge(String challenge) throws MalformedChallengeException
Processes the Basic challenge.
- Specified by:
- processChallenge in interface AuthScheme
- Overrides:
- processChallenge in interface RFC2617Scheme
- Parameters:
challenge
- the challenge string
- Throws:
MalformedChallengeException
- is thrown if the authentication challenge is malformed
- Since:
- 3.0