Top Description Inners Fields Constructors Methods
org.apache.hc.client5.http.impl.auth

public abstract Class GGSSchemeBase

extends Object
implements AuthScheme
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.auth.AuthScheme
Known Direct Subclasses
org.apache.hc.client5.http.impl.auth.KerberosScheme, org.apache.hc.client5.http.impl.auth.SPNegoScheme
Annotations
@Deprecated
Imports
java.net.UnknownHostException, java.security.Principal, org.apache.hc.client5.http.DnsResolver, .SystemDefaultDnsResolver, org.apache.hc.client5.http.auth.AuthChallenge, .AuthScheme, .AuthScope, .AuthenticationException, .Credentials, .CredentialsProvider, .InvalidCredentialsException, .MalformedChallengeException, .StandardAuthScheme, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.client5.http.utils.Base64, org.apache.hc.core5.http.HttpHost, .HttpRequest, org.apache.hc.core5.http.protocol.HttpContext, org.apache.hc.core5.util.Args, org.ietf.jgss.GSSContext, .GSSCredential, .GSSException, .GSSManager, .GSSName, .Oid, org.slf4j.Logger, .LoggerFactory

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 for GSS based authentication schemes.
Since
4.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private String
private final KerberosConfig
config

Deprecated as a consequence of KerberosConfig being deprecated.
private final DnsResolver
private GSSCredential
private static final String
private static final Logger
private static final String
private GGSSchemeBase.State
state

Authentication process state

private byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
GGSSchemeBase(final KerberosConfig config, final DnsResolver dnsResolver)

Deprecated as a consequence of KerberosConfig being deprecated.
pack-priv
GGSSchemeBase(final KerberosConfig config)

Deprecated as a consequence of KerberosConfig being deprecated.
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected GSSContext
createGSSContext(final GSSManager manager, final Oid oid, final GSSName serverName, final GSSCredential gssCredential)

public String
generateAuthResponse(final HttpHost host, final HttpRequest
The request being authenticated
request
,
final HttpContext
HTTP context
context
)

Implements org.apache.hc.client5.http.auth.AuthScheme.generateAuthResponse.

Generates an authorization response based on the current state.
protected byte[]
generateGSSToken(final byte[] input, final Oid oid, final String serviceName, final String authServer)

protected abstract byte[]
generateToken(byte[] input, String serviceName, String authServer)

protected GSSManager
public Principal
getPrincipal()

Implements org.apache.hc.client5.http.auth.AuthScheme.getPrincipal.

Returns Principal whose credentials are used to generate an authentication response.
public String
getRealm()

Implements org.apache.hc.client5.http.auth.AuthScheme.getRealm.

Returns authentication realm.
public boolean
isChallengeComplete()

Implements org.apache.hc.client5.http.auth.AuthScheme.isChallengeComplete.

Authentication process may involve a series of challenge-response exchanges.
public boolean
isResponseReady(final HttpHost host, final CredentialsProvider
The credentials to be used for authentication
credentialsProvider
,
final HttpContext
HTTP context
context
)

Implements org.apache.hc.client5.http.auth.AuthScheme.isResponseReady.

Determines whether or not an authorization response can be generated based on the actual authentication state.
public void
processChallenge(final AuthChallenge
the auth challenge
authChallenge
,
final HttpContext
HTTP context
context
)

Implements org.apache.hc.client5.http.auth.AuthScheme.processChallenge.

Processes the given auth challenge.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

challengeback to summary
private String challenge
configback to summary
private final KerberosConfig config

Deprecated

as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

dnsResolverback to summary
private final DnsResolver dnsResolver
gssCredentialback to summary
private GSSCredential gssCredential
KERBEROS_SCHEMEback to summary
private static final String KERBEROS_SCHEME
LOGback to summary
private static final Logger LOG
NO_TOKENback to summary
private static final String NO_TOKEN
stateback to summary
private GGSSchemeBase.State state

Authentication process state

tokenback to summary
private byte[] token

Constructor Detail

GGSSchemeBaseback to summary
pack-priv GGSSchemeBase(final KerberosConfig config, final DnsResolver dnsResolver)

Deprecated

as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

GGSSchemeBaseback to summary
pack-priv GGSSchemeBase(final KerberosConfig config)

Deprecated

as a consequence of KerberosConfig being deprecated. See corresponding docs for further information.

GGSSchemeBaseback to summary
pack-priv GGSSchemeBase()

Method Detail

createGSSContextback to summary
protected GSSContext createGSSContext(final GSSManager manager, final Oid oid, final GSSName serverName, final GSSCredential gssCredential) throws GSSException
Since
5.0
generateAuthResponseback to summary
public String generateAuthResponse(final HttpHost host, final HttpRequest request, final HttpContext context) throws AuthenticationException

Implements org.apache.hc.client5.http.auth.AuthScheme.generateAuthResponse.

Doc from org.apache.hc.client5.http.auth.AuthScheme.generateAuthResponse.

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 a CredentialsProvider prior to this method call.

Parameters
request:HttpRequest

The request being authenticated

context:HttpContext

HTTP context

Returns:String

authorization header

Annotations
@Override
Exceptions
AuthenticationException:
if authorization string cannot be generated due to an authentication failure
generateGSSTokenback to summary
protected byte[] generateGSSToken(final byte[] input, final Oid oid, final String serviceName, final String authServer) throws GSSException
Since
4.4
generateTokenback to summary
protected abstract byte[] generateToken(byte[] input, String serviceName, String authServer) throws GSSException
Since
4.4
getManagerback to summary
protected GSSManager getManager()
getPrincipalback to summary
public Principal getPrincipal()

Implements org.apache.hc.client5.http.auth.AuthScheme.getPrincipal.

Doc from org.apache.hc.client5.http.auth.AuthScheme.getPrincipal.

Returns 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.

Returns:Principal

user principal

Annotations
@Override
getRealmback to summary
public String getRealm()

Implements org.apache.hc.client5.http.auth.AuthScheme.getRealm.

Doc from org.apache.hc.client5.http.auth.AuthScheme.getRealm.

Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returns null.

Returns:String

the authentication realm

Annotations
@Override
isChallengeCompleteback to summary
public boolean isChallengeComplete()

Implements org.apache.hc.client5.http.auth.AuthScheme.isChallengeComplete.

Doc from org.apache.hc.client5.http.auth.AuthScheme.isChallengeComplete.

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.

Returns:boolean

true if the authentication process has been completed, false otherwise.

Annotations
@Override
isResponseReadyback to summary
public boolean isResponseReady(final HttpHost host, final CredentialsProvider credentialsProvider, final HttpContext context) throws AuthenticationException

Implements org.apache.hc.client5.http.auth.AuthScheme.isResponseReady.

Doc from org.apache.hc.client5.http.auth.AuthScheme.isResponseReady.

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.

Parameters
credentialsProvider:CredentialsProvider

The credentials to be used for authentication

context:HttpContext

HTTP context

Returns:boolean

true if an authorization response can be generated and the authentication handshake can proceed, false otherwise.

Annotations
@Override
Exceptions
AuthenticationException:
if authorization string cannot be generated due to an authentication failure
processChallengeback to summary
public void processChallenge(final AuthChallenge authChallenge, final HttpContext context) throws MalformedChallengeException

Implements org.apache.hc.client5.http.auth.AuthScheme.processChallenge.

Doc from org.apache.hc.client5.http.auth.AuthScheme.processChallenge.

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

Parameters
authChallenge:AuthChallenge

the auth challenge

context:HttpContext

HTTP context

Annotations
@Override
Exceptions
MalformedChallengeException:
in case the auth challenge is incomplete, malformed or otherwise invalid.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.apache.hc.client5.http.impl.auth back to summary

pack-priv final Enum GGSSchemeBase.State

extends Enum<GGSSchemeBase.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final GGSSchemeBase.State
public static final GGSSchemeBase.State
public static final GGSSchemeBase.State
public static final GGSSchemeBase.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static GGSSchemeBase.State
public static GGSSchemeBase.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CHALLENGE_RECEIVEDback to summary
public static final GGSSchemeBase.State CHALLENGE_RECEIVED
FAILEDback to summary
public static final GGSSchemeBase.State FAILED
TOKEN_GENERATEDback to summary
public static final GGSSchemeBase.State TOKEN_GENERATED
UNINITIATEDback to summary
public static final GGSSchemeBase.State UNINITIATED

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static GGSSchemeBase.State valueOf(String name)
valuesback to summary
public static GGSSchemeBase.State[] values()