Package org.apache.http.impl.auth
Class AuthSchemeBase
java.lang.Object
org.apache.http.impl.auth.AuthSchemeBase
- All Implemented Interfaces:
AuthScheme,ContextAwareAuthScheme
- Direct Known Subclasses:
GGSSchemeBase,NTLMScheme,RFC2617Scheme
Abstract authentication scheme class that serves as a basis
for all authentication schemes supported by HttpClient. This class
defines the generic way of parsing an authentication challenge. It
does not make any assumptions regarding the format of the challenge
nor does it impose any specific way of responding to that challenge.
- Since:
- 4.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Credentials credentials, HttpRequest request, HttpContext context) Produces an authorization string for the given set ofCredentials.ReturnsChallengeStatevalue ornullif unchallenged.booleanisProxy()Returnstrueif authenticating against a proxy,falseotherwise.voidprocessChallenge(Header header) Processes the given challenge token.toString()Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.http.auth.AuthScheme
authenticate, getParameter, getRealm, getSchemeName, isComplete, isConnectionBased
-
Constructor Details
-
AuthSchemeBase
Deprecated.(4.3) do not use.Creates an instance ofAuthSchemeBasewith the given challenge state.- Since:
- 4.2
-
AuthSchemeBase
public AuthSchemeBase()
-
-
Method Details
-
processChallenge
Processes the given challenge token. Some authentication schemes may involve multiple challenge-response exchanges. Such schemes must be able to maintain the state information when dealing with sequential challenges- Specified by:
processChallengein interfaceAuthScheme- Parameters:
header- the challenge header- Throws:
MalformedChallengeException- is thrown if the authentication challenge is malformed
-
authenticate
public Header authenticate(Credentials credentials, HttpRequest request, HttpContext context) throws AuthenticationException Description copied from interface:ContextAwareAuthSchemeProduces an authorization string for the given set ofCredentials.- Specified by:
authenticatein interfaceContextAwareAuthScheme- Parameters:
credentials- The set of credentials to be used for athenticationrequest- The request being authenticatedcontext- HTTP context- Returns:
- the authorization string
- Throws:
AuthenticationException- if authorization string cannot be generated due to an authentication failure
-
isProxy
public boolean isProxy()Returnstrueif authenticating against a proxy,falseotherwise. -
getChallengeState
ReturnsChallengeStatevalue ornullif unchallenged.- Since:
- 4.2
-
toString
-