org.apache.commons.httpclient.auth
Class BasicScheme
java.lang.Object
|
+--org.apache.commons.httpclient.auth.AuthSchemeBase
|
+--org.apache.commons.httpclient.auth.RFC2617Scheme
|
+--org.apache.commons.httpclient.auth.BasicScheme
- public class BasicScheme
- extends RFC2617Scheme
Basic authentication scheme as defined in RFC 2617.
- Author:
- Remy Maucherat, Rodney Waldhoff, Jeff Dever, Ortwin Gl?ck, Sean C. Sullivan, Adrian Sutton, Mike Bowler, Oleg Kalnichevski
Constructor Summary |
BasicScheme(java.lang.String challenge)
Constructor for the basic authetication scheme. |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
BasicScheme
public BasicScheme(java.lang.String challenge)
throws MalformedChallengeException
- Constructor for the basic authetication scheme.
- Parameters:
challenge
- authentication challenge- Throws:
- MalformedChallengeException - is thrown if the authentication challenge
is malformed
getSchemeName
public java.lang.String getSchemeName()
- Returns textual designation of the basic authentication scheme.
- Returns:
basic
authenticate
public java.lang.String authenticate(Credentials credentials,
java.lang.String method,
java.lang.String uri)
throws AuthenticationException
- Produces basic authorization string for the given set of
Credentials
.
- 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
authenticate
public static java.lang.String authenticate(UsernamePasswordCredentials credentials)
- Return a basic Authorization header value for the given
UsernamePasswordCredentials
.
- Parameters:
credentials
- The credentials to encode.- Returns:
- a basic authorization string
Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.