Class GGSSchemeBase
- java.lang.Object
-
- org.apache.hc.client5.http.impl.auth.GGSSchemeBase
-
- All Implemented Interfaces:
AuthScheme
- Direct Known Subclasses:
KerberosScheme
,SPNegoScheme
@Deprecated public abstract class GGSSchemeBase extends java.lang.Object implements AuthScheme
Deprecated.Do not use. The GGS based experimental authentication schemes are no longer supported. Consider using Basic or Bearer authentication with TLS instead.Common behavior forGSS
based authentication schemes.- Since:
- 4.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
GGSSchemeBase.State
Deprecated.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
challenge
Deprecated.private KerberosConfig
config
Deprecated.private DnsResolver
dnsResolver
Deprecated.private org.ietf.jgss.GSSCredential
gssCredential
Deprecated.private static java.lang.String
KERBEROS_SCHEME
Deprecated.private static org.slf4j.Logger
LOG
Deprecated.private static java.lang.String
NO_TOKEN
Deprecated.private GGSSchemeBase.State
state
Deprecated.Authentication process stateprivate byte[]
token
Deprecated.
-
Constructor Summary
Constructors Constructor Description GGSSchemeBase()
Deprecated.GGSSchemeBase(KerberosConfig config)
Deprecated.GGSSchemeBase(KerberosConfig config, DnsResolver dnsResolver)
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method 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)
Deprecated.java.lang.String
generateAuthResponse(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context)
Deprecated.Generates an authorization response based on the current state.protected byte[]
generateGSSToken(byte[] input, org.ietf.jgss.Oid oid, java.lang.String serviceName, java.lang.String authServer)
Deprecated.protected abstract byte[]
generateToken(byte[] input, java.lang.String serviceName, java.lang.String authServer)
Deprecated.protected org.ietf.jgss.GSSManager
getManager()
Deprecated.java.security.Principal
getPrincipal()
Deprecated.ReturnsPrincipal
whose credentials are used to generate an authentication response.java.lang.String
getRealm()
Deprecated.Returns authentication realm.boolean
isChallengeComplete()
Deprecated.Authentication process may involve a series of challenge-response exchanges.boolean
isResponseReady(org.apache.hc.core5.http.HttpHost host, CredentialsProvider credentialsProvider, org.apache.hc.core5.http.protocol.HttpContext context)
Deprecated.Determines whether or not an authorization response can be generated based on the actual authentication state.void
processChallenge(AuthChallenge authChallenge, org.apache.hc.core5.http.protocol.HttpContext context)
Deprecated.Processes the given auth challenge.java.lang.String
toString()
Deprecated.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.hc.client5.http.auth.AuthScheme
getName, isConnectionBased
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
Deprecated.
-
NO_TOKEN
private static final java.lang.String NO_TOKEN
Deprecated.- See Also:
- Constant Field Values
-
KERBEROS_SCHEME
private static final java.lang.String KERBEROS_SCHEME
Deprecated.- See Also:
- Constant Field Values
-
config
private final KerberosConfig config
Deprecated.
-
dnsResolver
private final DnsResolver dnsResolver
Deprecated.
-
state
private GGSSchemeBase.State state
Deprecated.Authentication process state
-
gssCredential
private org.ietf.jgss.GSSCredential gssCredential
Deprecated.
-
challenge
private java.lang.String challenge
Deprecated.
-
token
private byte[] token
Deprecated.
-
-
Constructor Detail
-
GGSSchemeBase
GGSSchemeBase(KerberosConfig config, DnsResolver dnsResolver)
Deprecated.
-
GGSSchemeBase
GGSSchemeBase(KerberosConfig config)
Deprecated.
-
GGSSchemeBase
GGSSchemeBase()
Deprecated.
-
-
Method Detail
-
getRealm
public java.lang.String getRealm()
Deprecated.Description copied from interface:AuthScheme
Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returnsnull
.- Specified by:
getRealm
in interfaceAuthScheme
- Returns:
- the authentication realm
-
processChallenge
public void processChallenge(AuthChallenge authChallenge, org.apache.hc.core5.http.protocol.HttpContext context) throws MalformedChallengeException
Deprecated.Description copied from interface:AuthScheme
Processes the given auth challenge. Some authentication schemes may involve multiple challenge-response exchanges. Such schemes must be able to maintain internal state when dealing with sequential challenges- Specified by:
processChallenge
in interfaceAuthScheme
- Parameters:
authChallenge
- the auth challengecontext
- HTTP context- Throws:
MalformedChallengeException
- in case the auth challenge is incomplete, malformed or otherwise invalid.
-
getManager
protected org.ietf.jgss.GSSManager getManager()
Deprecated.
-
generateGSSToken
protected byte[] generateGSSToken(byte[] input, org.ietf.jgss.Oid oid, java.lang.String serviceName, java.lang.String authServer) throws org.ietf.jgss.GSSException
Deprecated.- Throws:
org.ietf.jgss.GSSException
- Since:
- 4.4
-
createGSSContext
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
Deprecated.- Throws:
org.ietf.jgss.GSSException
- Since:
- 5.0
-
generateToken
protected abstract byte[] generateToken(byte[] input, java.lang.String serviceName, java.lang.String authServer) throws org.ietf.jgss.GSSException
Deprecated.- Throws:
org.ietf.jgss.GSSException
- Since:
- 4.4
-
isChallengeComplete
public boolean isChallengeComplete()
Deprecated.Description copied from interface:AuthScheme
Authentication process may involve a series of challenge-response exchanges. This method tests if the authorization process has been fully completed (either successfully or unsuccessfully), that is, all the required authorization challenges have been processed in their entirety.- Specified by:
isChallengeComplete
in interfaceAuthScheme
- Returns:
true
if the authentication process has been completed,false
otherwise.
-
isResponseReady
public boolean isResponseReady(org.apache.hc.core5.http.HttpHost host, CredentialsProvider credentialsProvider, org.apache.hc.core5.http.protocol.HttpContext context) throws AuthenticationException
Deprecated.Description copied from interface:AuthScheme
Determines whether or not an authorization response can be generated based on the actual authentication state. Generally the outcome of this method will depend upon availability of user credentials necessary to produce an authorization response.- Specified by:
isResponseReady
in interfaceAuthScheme
credentialsProvider
- The credentials to be used for authenticationcontext
- HTTP context- Returns:
true
if an authorization response can be generated and the authentication handshake can proceed,false
otherwise.- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure
-
getPrincipal
public java.security.Principal getPrincipal()
Deprecated.Description copied from interface:AuthScheme
ReturnsPrincipal
whose credentials are used to generate an authentication response. Connection based schemes are required to return a userPrincipal
if authorization applies to for the entire life span of connection.- Specified by:
getPrincipal
in interfaceAuthScheme
- Returns:
- user principal
- See Also:
AuthScheme.isConnectionBased()
-
generateAuthResponse
public java.lang.String generateAuthResponse(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context) throws AuthenticationException
Deprecated.Description copied from interface:AuthScheme
Generates an authorization response based on the current state. Some authentication schemes may need to load user credentials required to generate an authorization response from aCredentialsProvider
prior to this method call.- Specified by:
generateAuthResponse
in interfaceAuthScheme
request
- The request being authenticatedcontext
- HTTP context- Returns:
- authorization header
- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure- See Also:
AuthScheme.isResponseReady(HttpHost, CredentialsProvider, HttpContext)
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
-