public class BasicScheme extends RFC2617Scheme
challengeState
Constructor and Description |
---|
BasicScheme() |
BasicScheme(ChallengeState challengeState)
Deprecated.
(4.3) do not use.
|
BasicScheme(Charset credentialsCharset) |
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)
Deprecated.
|
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.
|
String |
toString() |
getCredentialsCharset, getParameter, getParameters, getRealm, parseChallenge
getChallengeState, isProxy
public BasicScheme(Charset credentialsCharset)
@Deprecated public BasicScheme(ChallengeState challengeState)
BasicScheme
with the given challenge
state.public BasicScheme()
public String getSchemeName()
basic
public void processChallenge(org.apache.http.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()
true
if Basic authorization has been processed,
false
otherwise.public boolean isConnectionBased()
false
. Basic authentication scheme is request based.false
.@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)
AuthScheme
Credentials
.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 ContextAwareAuthScheme
authenticate
in class AuthSchemeBase
credentials
- 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 failure@Deprecated public static org.apache.http.Header authenticate(Credentials credentials, String charset, boolean proxy)
authenticate(Credentials, HttpRequest, HttpContext)
.Authorization
header value for the given
Credentials
and charset.credentials
- The credentials to encode.charset
- The charset to use for encoding the credentialspublic String toString()
toString
in class AuthSchemeBase
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.