org.apache.http.impl.auth
Class NegotiateScheme

java.lang.Object
  extended by org.apache.http.impl.auth.AuthSchemeBase
      extended by org.apache.http.impl.auth.NegotiateScheme
All Implemented Interfaces:
AuthScheme, ContextAwareAuthScheme

public class NegotiateScheme
extends AuthSchemeBase

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

Since:
4.1

Constructor Summary
NegotiateScheme()
           
NegotiateScheme(SpnegoTokenGenerator spengoGenerator)
           
NegotiateScheme(SpnegoTokenGenerator spengoGenerator, boolean stripPort)
          Default constructor for the Negotiate authentication scheme.
 
Method Summary
 org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request)
          Deprecated. 
 org.apache.http.Header authenticate(Credentials credentials, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)
          Produces Negotiate authorization Header based on token created by processChallenge.
protected  org.ietf.jgss.GSSManager getManager()
           
 java.lang.String getParameter(java.lang.String name)
          Returns the authentication parameter with the given name, if available.
 java.lang.String getRealm()
          The concept of an authentication realm is not supported by the Negotiate authentication scheme.
 java.lang.String getSchemeName()
          Returns textual designation of the Negotiate authentication scheme.
 boolean isComplete()
          Tests if the Negotiate authentication process has been completed.
 boolean isConnectionBased()
          Returns true.
protected  void parseChallenge(org.apache.http.util.CharArrayBuffer buffer, int beginIndex, int endIndex)
           
 
Methods inherited from class org.apache.http.impl.auth.AuthSchemeBase
isProxy, processChallenge, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NegotiateScheme

public NegotiateScheme(SpnegoTokenGenerator spengoGenerator,
                       boolean stripPort)
Default constructor for the Negotiate authentication scheme.


NegotiateScheme

public NegotiateScheme(SpnegoTokenGenerator spengoGenerator)

NegotiateScheme

public NegotiateScheme()
Method Detail

isComplete

public boolean isComplete()
Tests if the Negotiate authentication process has been completed.

Returns:
true if authorization has been processed, false otherwise.

getSchemeName

public java.lang.String getSchemeName()
Returns textual designation of the Negotiate authentication scheme.

Returns:
Negotiate

authenticate

@Deprecated
public org.apache.http.Header authenticate(Credentials credentials,
                                                      org.apache.http.HttpRequest request)
                                    throws AuthenticationException
Deprecated. 

Description copied from interface: AuthScheme
Produces an authorization string for the given set of Credentials.

Parameters:
credentials - The set of credentials to be used for athentication
request - The request being authenticated
Returns:
the authorization string
Throws:
AuthenticationException - if authorization string cannot be generated due to an authentication failure

getManager

protected org.ietf.jgss.GSSManager getManager()

authenticate

public org.apache.http.Header authenticate(Credentials credentials,
                                           org.apache.http.HttpRequest request,
                                           org.apache.http.protocol.HttpContext context)
                                    throws AuthenticationException
Produces Negotiate authorization Header based on token created by processChallenge.

Specified by:
authenticate in interface ContextAwareAuthScheme
Overrides:
authenticate in class AuthSchemeBase
Parameters:
credentials - Never used be the Negotiate scheme but must be provided to satisfy common-httpclient API. Credentials from JAAS will be used instead.
request - The request being authenticated
context - HTTP context
Returns:
an Negotiate authorisation Header
Throws:
AuthenticationException - if authorisation string cannot be generated due to an authentication failure

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the authentication parameter with the given name, if available.

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

Parameters:
name - The name of the parameter to be returned
Returns:
the parameter with the given name

getRealm

public java.lang.String getRealm()
The concept of an authentication realm is not supported by the Negotiate authentication scheme. Always returns null.

Returns:
null

isConnectionBased

public boolean isConnectionBased()
Returns true. Negotiate authentication scheme is connection based.

Returns:
true.

parseChallenge

protected void parseChallenge(org.apache.http.util.CharArrayBuffer buffer,
                              int beginIndex,
                              int endIndex)
                       throws MalformedChallengeException
Specified by:
parseChallenge in class AuthSchemeBase
Throws:
MalformedChallengeException


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.