Top Description Fields Constructors Methods
org.apache.http.impl.auth

public Class SPNegoScheme

extends GGSSchemeBase
Class Inheritance
Imports
org.apache.http.Header, .HttpRequest, org.apache.http.auth.AuthenticationException, .Credentials, org.apache.http.protocol.HttpContext, org.apache.http.util.Args, org.ietf.jgss.GSSException, .Oid

SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) authentication scheme.
Since
4.2

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public
SPNegoScheme(final boolean stripPort, final boolean useCanonicalHostname)

public
SPNegoScheme(final boolean stripPort)

public

Method Summary

Modifier and TypeMethod and Description
public Header

Returns:

SPNEGO authentication Header
authenticate
(final Credentials
not used by the SPNEGO scheme.
credentials
,
final HttpRequest
The request being authenticated
request
,
final HttpContext
HTTP context
context
)

Overrides org.apache.http.impl.auth.GGSSchemeBase.authenticate.

Implements org.apache.http.auth.ContextAwareAuthScheme.authenticate.

Produces SPNEGO authorization Header based on token created by processChallenge.
protected byte[]
generateToken(final byte[] input, final String authServer)

Overrides org.apache.http.impl.auth.GGSSchemeBase.generateToken.

protected byte[]
generateToken(final byte[] input, final String authServer, final Credentials credentials)

Overrides org.apache.http.impl.auth.GGSSchemeBase.generateToken.

public String

Returns:

null
getParameter
(final String
The name of the parameter to be returned
name
)

Implements org.apache.http.auth.AuthScheme.getParameter.

There are no valid parameters for SPNEGO authentication so this method always returns null.
public String

Returns:

null
getRealm
()

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

The concept of an authentication realm is not supported by the Negotiate authentication scheme.
public String
getSchemeName()

Implements org.apache.http.auth.AuthScheme.getSchemeName.

Returns textual designation of the given authentication scheme.
public boolean
Inherited from org.apache.http.impl.auth.GGSSchemeBase:
authenticatecreateGSSContextgenerateGSSTokengenerateGSSTokengetManagerisCompleteparseChallenge

Field Detail

SPNEGO_OIDback to summary
private static final String SPNEGO_OID

Constructor Detail

SPNegoSchemeback to summary
public SPNegoScheme(final boolean stripPort, final boolean useCanonicalHostname)
Since
4.4
SPNegoSchemeback to summary
public SPNegoScheme(final boolean stripPort)
SPNegoSchemeback to summary
public SPNegoScheme()

Method Detail

authenticateback to summary
public Header authenticate(final Credentials credentials, final HttpRequest request, final HttpContext context) throws AuthenticationException

Overrides org.apache.http.impl.auth.GGSSchemeBase.authenticate.

Implements org.apache.http.auth.ContextAwareAuthScheme.authenticate.

Produces SPNEGO authorization Header based on token created by processChallenge.

Parameters
credentials:Credentials

not used by the SPNEGO scheme.

request:HttpRequest

The request being authenticated

context:HttpContext

Doc from org.apache.http.auth.ContextAwareAuthScheme.authenticate.

HTTP context

Returns:Header

SPNEGO authentication Header

Annotations
@Override
Exceptions
AuthenticationException:
if authentication string cannot be generated due to an authentication failure
generateTokenback to summary
protected byte[] generateToken(final byte[] input, final String authServer) throws GSSException

Overrides org.apache.http.impl.auth.GGSSchemeBase.generateToken.

Annotations
@Override
@SuppressWarnings:deprecation
generateTokenback to summary
protected byte[] generateToken(final byte[] input, final String authServer, final Credentials credentials) throws GSSException

Overrides org.apache.http.impl.auth.GGSSchemeBase.generateToken.

Annotations
@Override
getParameterback to summary
public String getParameter(final String name)

Implements org.apache.http.auth.AuthScheme.getParameter.

There are no valid parameters for SPNEGO authentication so this method always returns null.

Parameters
name:String

Doc from org.apache.http.auth.AuthScheme.getParameter.

The name of the parameter to be returned

Returns:String

null

Annotations
@Override
getRealmback to summary
public String getRealm()

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

The concept of an authentication realm is not supported by the Negotiate authentication scheme. Always returns null.

Returns:String

null

Annotations
@Override
getSchemeNameback to summary
public String getSchemeName()

Implements org.apache.http.auth.AuthScheme.getSchemeName.

Doc from org.apache.http.auth.AuthScheme.getSchemeName.

Returns textual designation of the given authentication scheme.

Returns:String

the name of the given authentication scheme

Annotations
@Override
isConnectionBasedback to summary
public boolean isConnectionBased()

Implements org.apache.http.auth.AuthScheme.isConnectionBased.

Returns true. SPNEGO authentication scheme is connection based.

Returns:boolean

true.

Annotations
@Override