Package org.apache.http.impl.auth
Class GGSSchemeBase
- java.lang.Object
-
- org.apache.http.impl.auth.AuthSchemeBase
-
- org.apache.http.impl.auth.GGSSchemeBase
-
- All Implemented Interfaces:
AuthScheme
,ContextAwareAuthScheme
- Direct Known Subclasses:
KerberosScheme
,NegotiateScheme
,SPNegoScheme
public abstract class GGSSchemeBase extends AuthSchemeBase
- Since:
- 4.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
GGSSchemeBase.State
-
Field Summary
Fields Modifier and Type Field Description private org.apache.commons.codec.binary.Base64
base64codec
private org.apache.commons.logging.Log
log
private GGSSchemeBase.State
state
Authentication process stateprivate boolean
stripPort
private byte[]
token
base64 decoded challengeprivate boolean
useCanonicalHostname
-
Fields inherited from class org.apache.http.impl.auth.AuthSchemeBase
challengeState
-
-
Constructor Summary
Constructors Constructor Description GGSSchemeBase()
GGSSchemeBase(boolean stripPort)
GGSSchemeBase(boolean stripPort, boolean useCanonicalHostname)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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 an authorization string for the given set ofCredentials
.(package private) org.ietf.jgss.GSSContext
createGSSContext(org.ietf.jgss.GSSManager manager, org.ietf.jgss.Oid oid, org.ietf.jgss.GSSName serverName, org.ietf.jgss.GSSCredential gssCredential)
protected byte[]
generateGSSToken(byte[] input, org.ietf.jgss.Oid oid, java.lang.String authServer)
protected byte[]
generateGSSToken(byte[] input, org.ietf.jgss.Oid oid, java.lang.String authServer, Credentials credentials)
protected byte[]
generateToken(byte[] input, java.lang.String authServer)
Deprecated.protected byte[]
generateToken(byte[] input, java.lang.String authServer, Credentials credentials)
protected org.ietf.jgss.GSSManager
getManager()
boolean
isComplete()
Authentication process may involve a series of challenge-response exchanges.protected void
parseChallenge(org.apache.http.util.CharArrayBuffer buffer, int beginIndex, int endIndex)
private java.lang.String
resolveCanonicalHostname(java.lang.String host)
-
Methods inherited from class org.apache.http.impl.auth.AuthSchemeBase
getChallengeState, isProxy, processChallenge, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.http.auth.AuthScheme
getParameter, getRealm, getSchemeName, isConnectionBased
-
-
-
-
Field Detail
-
log
private final org.apache.commons.logging.Log log
-
base64codec
private final org.apache.commons.codec.binary.Base64 base64codec
-
stripPort
private final boolean stripPort
-
useCanonicalHostname
private final boolean useCanonicalHostname
-
state
private GGSSchemeBase.State state
Authentication process state
-
token
private byte[] token
base64 decoded challenge
-
-
Method Detail
-
getManager
protected org.ietf.jgss.GSSManager getManager()
-
generateGSSToken
protected byte[] generateGSSToken(byte[] input, org.ietf.jgss.Oid oid, java.lang.String authServer) throws org.ietf.jgss.GSSException
- Throws:
org.ietf.jgss.GSSException
-
generateGSSToken
protected byte[] generateGSSToken(byte[] input, org.ietf.jgss.Oid oid, java.lang.String authServer, Credentials credentials) throws org.ietf.jgss.GSSException
- Throws:
org.ietf.jgss.GSSException
- Since:
- 4.4
-
createGSSContext
org.ietf.jgss.GSSContext createGSSContext(org.ietf.jgss.GSSManager manager, org.ietf.jgss.Oid oid, org.ietf.jgss.GSSName serverName, org.ietf.jgss.GSSCredential gssCredential) throws org.ietf.jgss.GSSException
- Throws:
org.ietf.jgss.GSSException
-
generateToken
@Deprecated protected byte[] generateToken(byte[] input, java.lang.String authServer) throws org.ietf.jgss.GSSException
Deprecated.- Throws:
org.ietf.jgss.GSSException
-
generateToken
protected byte[] generateToken(byte[] input, java.lang.String authServer, Credentials credentials) throws org.ietf.jgss.GSSException
- Throws:
org.ietf.jgss.GSSException
- Since:
- 4.4
-
isComplete
public boolean isComplete()
Description copied from interface:AuthScheme
Authentication process may involve a series of challenge-response exchanges. This method tests if the authorization process has been completed, either successfully or unsuccessfully, that is, all the required authorization challenges have been processed in their entirety.- Returns:
true
if the authentication process has been completed,false
otherwise.
-
authenticate
@Deprecated public org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request) throws AuthenticationException
Deprecated.Description copied from interface:AuthScheme
Produces an authorization string for the given set ofCredentials
.- Parameters:
credentials
- The set of credentials to be used for athenticationrequest
- The request being authenticated- Returns:
- the authorization string
- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure
-
authenticate
public org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws AuthenticationException
Description copied from interface:ContextAwareAuthScheme
Produces an authorization string for the given set ofCredentials
.- Specified by:
authenticate
in interfaceContextAwareAuthScheme
- Overrides:
authenticate
in classAuthSchemeBase
- 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
-
parseChallenge
protected void parseChallenge(org.apache.http.util.CharArrayBuffer buffer, int beginIndex, int endIndex) throws MalformedChallengeException
- Specified by:
parseChallenge
in classAuthSchemeBase
- Throws:
MalformedChallengeException
-
resolveCanonicalHostname
private java.lang.String resolveCanonicalHostname(java.lang.String host) throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
-
-