Package org.apache.http.impl.auth
Class SPNegoScheme
- java.lang.Object
-
- org.apache.http.impl.auth.AuthSchemeBase
-
- org.apache.http.impl.auth.GGSSchemeBase
-
- org.apache.http.impl.auth.SPNegoScheme
-
- All Implemented Interfaces:
AuthScheme,ContextAwareAuthScheme
public class SPNegoScheme extends GGSSchemeBase
SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) authentication scheme.- Since:
- 4.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.http.impl.auth.GGSSchemeBase
GGSSchemeBase.State
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringSPNEGO_OID-
Fields inherited from class org.apache.http.impl.auth.AuthSchemeBase
challengeState
-
-
Constructor Summary
Constructors Constructor Description SPNegoScheme()SPNegoScheme(boolean stripPort)SPNegoScheme(boolean stripPort, boolean useCanonicalHostname)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.Headerauthenticate(Credentials credentials, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)Produces SPNEGO authorization Header based on token created by processChallenge.protected byte[]generateToken(byte[] input, java.lang.String authServer)protected byte[]generateToken(byte[] input, java.lang.String authServer, Credentials credentials)java.lang.StringgetParameter(java.lang.String name)There are no valid parameters for SPNEGO authentication so this method always returnsnull.java.lang.StringgetRealm()The concept of an authentication realm is not supported by the Negotiate authentication scheme.java.lang.StringgetSchemeName()Returns textual designation of the given authentication scheme.booleanisConnectionBased()Returnstrue.-
Methods inherited from class org.apache.http.impl.auth.GGSSchemeBase
authenticate, createGSSContext, generateGSSToken, generateGSSToken, getManager, isComplete, parseChallenge
-
Methods inherited from class org.apache.http.impl.auth.AuthSchemeBase
getChallengeState, isProxy, processChallenge, toString
-
-
-
-
Field Detail
-
SPNEGO_OID
private static final java.lang.String SPNEGO_OID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSchemeName
public java.lang.String getSchemeName()
Description copied from interface:AuthSchemeReturns textual designation of the given authentication scheme.- Returns:
- the name of the given authentication scheme
-
authenticate
public org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws AuthenticationException
Produces SPNEGO authorization Header based on token created by processChallenge.- Specified by:
authenticatein interfaceContextAwareAuthScheme- Overrides:
authenticatein classGGSSchemeBase- Parameters:
credentials- not used by the SPNEGO scheme.request- The request being authenticatedcontext- HTTP context- Returns:
- SPNEGO authentication Header
- Throws:
AuthenticationException- if authentication string cannot be generated due to an authentication failure
-
generateToken
protected byte[] generateToken(byte[] input, java.lang.String authServer) throws org.ietf.jgss.GSSException- Overrides:
generateTokenin classGGSSchemeBase- Throws:
org.ietf.jgss.GSSException
-
generateToken
protected byte[] generateToken(byte[] input, java.lang.String authServer, Credentials credentials) throws org.ietf.jgss.GSSException- Overrides:
generateTokenin classGGSSchemeBase- Throws:
org.ietf.jgss.GSSException
-
getParameter
public java.lang.String getParameter(java.lang.String name)
There are no valid parameters for SPNEGO authentication so this method always returnsnull.- Parameters:
name- The name of the parameter to be returned- Returns:
null
-
getRealm
public java.lang.String getRealm()
The concept of an authentication realm is not supported by the Negotiate authentication scheme. Always returnsnull.- Returns:
null
-
isConnectionBased
public boolean isConnectionBased()
Returnstrue. SPNEGO authentication scheme is connection based.- Returns:
true.
-
-