@NotThreadSafe public class BasicScheme extends RFC2617Scheme
The following parameters can be used to customize the behavior of this class:
| Constructor and Description |
|---|
BasicScheme() |
BasicScheme(ChallengeState challengeState)
Creates an instance of BasicScheme with the given challenge
state.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.Header |
authenticate(Credentials credentials,
org.apache.http.HttpRequest request)
|
org.apache.http.Header |
authenticate(Credentials credentials,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context)
Produces basic authorization header for the given set of
Credentials. |
static org.apache.http.Header |
authenticate(Credentials credentials,
String charset,
boolean proxy)
Returns a basic Authorization header value for the given
Credentials and charset. |
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(org.apache.http.Header header)
Processes the Basic challenge.
|
getParameter, getParameters, getRealm, parseChallengegetChallengeState, isProxy, toStringpublic BasicScheme(ChallengeState challengeState)
public BasicScheme()
public String getSchemeName()
basicpublic void processChallenge(org.apache.http.Header header)
throws MalformedChallengeException
processChallenge in interface AuthSchemeprocessChallenge in class AuthSchemeBaseheader - the challenge headerMalformedChallengeException - is thrown if the authentication challenge
is malformedpublic boolean isComplete()
public boolean isConnectionBased()
@Deprecated public org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request) throws AuthenticationException
ContextAwareAuthScheme.authenticate(Credentials, HttpRequest, org.apache.http.protocol.HttpContext)AuthSchemeCredentials.credentials - The set of credentials to be used for athenticationrequest - The request being authenticatedAuthenticationException - if authorization string cannot
be generated due to an authentication failurepublic org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws AuthenticationException
Credentials.authenticate in interface ContextAwareAuthSchemeauthenticate in class AuthSchemeBasecredentials - The set of credentials to be used for authenticationrequest - The request being authenticatedcontext - HTTP contextInvalidCredentialsException - 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 org.apache.http.Header authenticate(Credentials credentials, String charset, boolean proxy)
Credentials and charset.credentials - The credentials to encode.charset - The charset to use for encoding the credentialsCopyright © 1999-2015 The Apache Software Foundation. All Rights Reserved.