public class BasicScheme extends RFC2617Scheme
The following parameters can be used to customize the behavior of this class:
Constructor and Description |
---|
BasicScheme()
Default constructor for the basic authentication scheme.
|
Modifier and Type | Method and Description |
---|---|
Header |
authenticate(Credentials credentials,
HttpRequest request)
Produces basic authorization header for the given set of
Credentials . |
static Header |
authenticate(Credentials credentials,
java.lang.String charset,
boolean proxy)
Returns a basic Authorization header value for the given
Credentials and charset. |
java.lang.String |
getSchemeName()
Returns textual designation of the basic authentication scheme.
|
boolean |
isComplete()
Tests if the Basic authentication process has been completed.
|
boolean |
isConnectionBased()
Returns false.
|
void |
processChallenge(Header header)
Processes the Basic challenge.
|
getParameter, getParameters, getRealm, parseChallenge
isProxy, toString
public BasicScheme()
public java.lang.String getSchemeName()
basic
public void processChallenge(Header header) throws MalformedChallengeException
processChallenge
in interface AuthScheme
processChallenge
in class AuthSchemeBase
header
- the challenge headerMalformedChallengeException
- is thrown if the authentication challenge
is malformedpublic boolean isComplete()
public boolean isConnectionBased()
public Header authenticate(Credentials credentials, HttpRequest request) throws AuthenticationException
Credentials
.credentials
- The set of credentials to be used for authenticationrequest
- The request being authenticatedInvalidCredentialsException
- if authentication credentials are not
valid or not applicable for this authentication schemeAuthenticationException
- if authorization string cannot
be generated due to an authentication failurepublic static Header authenticate(Credentials credentials, java.lang.String charset, boolean proxy)
Credentials
and charset.credentials
- The credentials to encode.charset
- The charset to use for encoding the credentials