Class NegotiateScheme
java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.contrib.auth.NegotiateScheme
- All Implemented Interfaces:
AuthScheme
-
Constructor Summary
ConstructorDescriptionDefault constructor for the Negotiate authentication scheme.NegotiateScheme
(String challenge) Constructor for the Negotiate authentication scheme. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(Credentials credentials, HttpMethod method) Produces Negotiate authorization string based on token created by processChallenge.authenticate
(Credentials credentials, String method, String uri) Deprecated.getID()
Deprecated.no longer usedgetParameter
(String name) Returns the authentication parameter with the given name, if available.getRealm()
The concept of an authentication realm is not supported by the Negotiate authentication scheme.Returns textual designation of the Negotiate authentication scheme.protected void
Init GSSContext for negotiation.boolean
Tests if the Negotiate authentication process has been completed.boolean
Returns true.void
processChallenge
(String challenge) Processes the Negotiate challenge.
-
Constructor Details
-
NegotiateScheme
public NegotiateScheme()Default constructor for the Negotiate authentication scheme.- Since:
- 3.0
-
NegotiateScheme
Constructor for the Negotiate authentication scheme.- Parameters:
challenge
- The authentication challenge
-
-
Method Details
-
init
Init GSSContext for negotiation.- Parameters:
server
- servername only (e.g: radar.it.su.se)- Throws:
GSSException
-
processChallenge
Processes the Negotiate challenge.- Specified by:
processChallenge
in interfaceAuthScheme
- Parameters:
challenge
- the challenge string- Since:
- 3.0
-
isComplete
public boolean isComplete()Tests if the Negotiate authentication process has been completed.- Specified by:
isComplete
in interfaceAuthScheme
- Returns:
- true if authorization has been processed, false otherwise.
- Since:
- 3.0
-
getSchemeName
Returns textual designation of the Negotiate authentication scheme.- Specified by:
getSchemeName
in interfaceAuthScheme
- Returns:
Negotiate
-
getRealm
The concept of an authentication realm is not supported by the Negotiate authentication scheme. Always returnsnull
.- Specified by:
getRealm
in interfaceAuthScheme
- Returns:
null
-
getID
Deprecated.no longer usedReturns a String identifying the authentication challenge. This is used, in combination with the host and port to determine if authorization has already been attempted or not. Schemes which require multiple requests to complete the authentication should return a different value for each stage in the request.Additionally, the ID should take into account any changes to the authentication challenge and return a different value when appropriate. For example when the realm changes in basic authentication it should be considered a different authentication attempt and a different value should be returned.
- Specified by:
getID
in interfaceAuthScheme
- Returns:
- String a String identifying the authentication challenge. The returned value may be null.
-
getParameter
Returns the authentication parameter with the given name, if available.There are no valid parameters for Negotiate authentication so this method always returns null.
- Specified by:
getParameter
in interfaceAuthScheme
- Parameters:
name
- The name of the parameter to be returned- Returns:
- the parameter with the given name
-
isConnectionBased
public boolean isConnectionBased()Returns true. Negotiate authentication scheme is connection based.- Specified by:
isConnectionBased
in interfaceAuthScheme
- Returns:
- true.
- Since:
- 3.0
-
authenticate
public String authenticate(Credentials credentials, String method, String uri) throws AuthenticationException Deprecated.Method not supported by Negotiate scheme.- Specified by:
authenticate
in interfaceAuthScheme
- Parameters:
credentials
- The set of credentials to be used for athenticationmethod
- The name of the method that requires authorization. This parameter may be ignored, if it is irrelevant or not applicable to the given authentication schemeuri
- The URI for which authorization is needed. This parameter may be ignored, if it is irrelevant or not applicable to the given authentication scheme- Returns:
- the authorization string
- Throws:
AuthenticationException
- if called.- See Also:
-
authenticate
public String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException Produces Negotiate authorization string based on token created by processChallenge.- Specified by:
authenticate
in interfaceAuthScheme
- Parameters:
credentials
- Never used be the Negotiate scheme but must be provided to satisfy common-httpclient API. Credentials from JAAS will be used insted.method
- The method being authenticated- Returns:
- an Negotiate authorization string
- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure- Since:
- 3.0
-
authenticate(Credentials, HttpMethod)