public abstract class GGSSchemeBase extends Object implements AuthScheme
GSS
based authentication schemes.Modifier and Type | Method and Description |
---|---|
protected 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) |
String |
generateAuthResponse(HttpHost host,
HttpRequest request,
HttpContext context)
Generates an authorization response based on the current state.
|
protected byte[] |
generateGSSToken(byte[] input,
org.ietf.jgss.Oid oid,
String serviceName,
String authServer) |
protected abstract byte[] |
generateToken(byte[] input,
String serviceName,
String authServer) |
protected org.ietf.jgss.GSSManager |
getManager() |
Principal |
getPrincipal()
Returns
Principal whose credentials are used to generate
an authentication response. |
String |
getRealm()
Returns authentication realm.
|
boolean |
isChallengeComplete()
Authentication process may involve a series of challenge-response exchanges.
|
boolean |
isResponseReady(HttpHost host,
CredentialsProvider credentialsProvider,
HttpContext context)
Determines whether or not an authorization response can be generated based on
the actual authentication state.
|
void |
processChallenge(AuthChallenge authChallenge,
HttpContext context)
Processes the given auth challenge.
|
String |
toString()
Returns a string representation of the object.
|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, isConnectionBased
protected 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
org.ietf.jgss.GSSException
public String generateAuthResponse(HttpHost host, HttpRequest request, HttpContext context) throws AuthenticationException
AuthScheme
CredentialsProvider
prior to this method call.generateAuthResponse
in interface AuthScheme
request
- The request being authenticatedcontext
- HTTP contextAuthenticationException
- if authorization string cannot
be generated due to an authentication failureAuthScheme.isResponseReady(HttpHost, CredentialsProvider, HttpContext)
protected byte[] generateGSSToken(byte[] input, org.ietf.jgss.Oid oid, String serviceName, String authServer) throws org.ietf.jgss.GSSException
org.ietf.jgss.GSSException
protected abstract byte[] generateToken(byte[] input, String serviceName, String authServer) throws org.ietf.jgss.GSSException
org.ietf.jgss.GSSException
protected org.ietf.jgss.GSSManager getManager()
public Principal getPrincipal()
AuthScheme
Principal
whose credentials are used to generate
an authentication response. Connection based schemes are required
to return a user Principal
if authorization applies to
for the entire life span of connection.getPrincipal
in interface AuthScheme
AuthScheme.isConnectionBased()
public String getRealm()
AuthScheme
null
.getRealm
in interface AuthScheme
public boolean isChallengeComplete()
AuthScheme
isChallengeComplete
in interface AuthScheme
true
if the authentication process has been completed,
false
otherwise.public boolean isResponseReady(HttpHost host, CredentialsProvider credentialsProvider, HttpContext context) throws AuthenticationException
AuthScheme
isResponseReady
in interface AuthScheme
credentialsProvider
- The credentials to be used for authenticationcontext
- HTTP contexttrue
if an authorization response can be generated and
the authentication handshake can proceed, false
otherwise.AuthenticationException
- if authorization string cannot
be generated due to an authentication failurepublic void processChallenge(AuthChallenge authChallenge, HttpContext context) throws MalformedChallengeException
AuthScheme
processChallenge
in interface AuthScheme
authChallenge
- the auth challengecontext
- HTTP contextMalformedChallengeException
- in case the auth challenge is incomplete,
malformed or otherwise invalid.public String toString()
Object
toString
method returns a
string that "textually represents" this object. The result should be a concise but informative
representation that is easy for a person to read. It is recommended that all subclasses override
this method.
The toString
method for class Object
returns a string consisting of the name of
the class of which the object is an instance, the at-sign character `@
', and the unsigned
hexadecimal representation of the hash code of the object. In other words, this method returns a
string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())