com.microsoft.tfs.core.httpclient.auth
Class NTLMScheme

java.lang.Object
  extended by com.microsoft.tfs.core.httpclient.auth.AuthorizationHeaderScheme
      extended by com.microsoft.tfs.core.httpclient.auth.NTLMScheme
All Implemented Interfaces:
AuthScheme

public class NTLMScheme
extends AuthorizationHeaderScheme
implements AuthScheme


Field Summary
 
Fields inherited from class com.microsoft.tfs.core.httpclient.auth.AuthorizationHeaderScheme
HOST_CHALLENGE_HEADER, HOST_RESPONSE_HEADER, PROXY_CHALLENGE_HEADER, PROXY_RESPONSE_HEADER
 
Constructor Summary
NTLMScheme()
           
 
Method Summary
 java.lang.String authenticate(AuthScope authscope, Credentials credentials, HttpMethod method)
          Provides the Authorization or Proxy-Authorization headers for authentication with the given Credentials.
static java.lang.String getDefaultCredentials()
           
 java.lang.String getParameter(java.lang.String name)
          This authentication scheme does not have parameters, thus we always return null.
 java.lang.String getRealm()
          There is no realm associated with NTLM authentication, thus we return null.
 java.lang.String getSchemeName()
          Returns textual designation of the given authentication scheme.
 boolean isComplete()
          NTLM2 is complete once we've delivered our authentication response (the Type3 message) or we've failed, whichever comes first.
 boolean isConnectionBased()
          NTLM2 provides authorization on a per-connection basis instead of the usual per-request basis.
static boolean isSupported()
           
 void processChallenge(java.lang.String challenge)
          Processes the given challenge token.
static boolean supportsCredentials(java.lang.Class<?> credentialClass)
           
 boolean supportsCredentials(Credentials credentials)
          Determines whether this auth scheme supports credentials of the given type.
 
Methods inherited from class com.microsoft.tfs.core.httpclient.auth.AuthorizationHeaderScheme
authenticateHost, authenticateProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.microsoft.tfs.core.httpclient.auth.AuthScheme
authenticateHost, authenticateProxy
 

Constructor Detail

NTLMScheme

public NTLMScheme()
Method Detail

getSchemeName

public java.lang.String getSchemeName()
Description copied from interface: AuthScheme
Returns textual designation of the given authentication scheme.

Specified by:
getSchemeName in interface AuthScheme
Returns:
the name of the given authentication scheme

isSupported

public static boolean isSupported()

supportsCredentials

public boolean supportsCredentials(Credentials credentials)
Description copied from interface: AuthScheme
Determines whether this auth scheme supports credentials of the given type. For example, NegotiateScheme only supports DefaultNTCredentials.

Specified by:
supportsCredentials in interface AuthScheme
Returns:
true if these credentials are supported, false otherwise

supportsCredentials

public static boolean supportsCredentials(java.lang.Class<?> credentialClass)

getDefaultCredentials

public static java.lang.String getDefaultCredentials()

getRealm

public java.lang.String getRealm()
There is no realm associated with NTLM authentication, thus we return null.

Returns:
null
See Also:
com.microsoft.tfs.core.httpclient.auth.AuthScheme#getRealm()

getParameter

public java.lang.String getParameter(java.lang.String name)
This authentication scheme does not have parameters, thus we always return null.

Specified by:
getParameter in interface AuthScheme
Parameters:
name - The name of the parameter to be returned
Returns:
null
See Also:
AuthScheme.getParameter(java.lang.String)

isComplete

public boolean isComplete()
NTLM2 is complete once we've delivered our authentication response (the Type3 message) or we've failed, whichever comes first.

Specified by:
isComplete in interface AuthScheme
Returns:
true if authentication is complete, false if there are more steps
See Also:
AuthScheme.isComplete()

isConnectionBased

public boolean isConnectionBased()
NTLM2 provides authorization on a per-connection basis instead of the usual per-request basis.

Specified by:
isConnectionBased in interface AuthScheme
Returns:
true
See Also:
AuthScheme.isConnectionBased()

processChallenge

public void processChallenge(java.lang.String challenge)
                      throws MalformedChallengeException
Description copied from interface: AuthScheme
Processes the given challenge token. Some authentication schemes may involve multiple challenge-response exchanges. Such schemes must be able to maintain the state information when dealing with sequential challenges

Specified by:
processChallenge in interface AuthScheme
Parameters:
challenge - the challenge string
Throws:
MalformedChallengeException

authenticate

public java.lang.String authenticate(AuthScope authscope,
                                     Credentials credentials,
                                     HttpMethod method)
                              throws AuthenticationException
Description copied from class: AuthorizationHeaderScheme
Provides the Authorization or Proxy-Authorization headers for authentication with the given Credentials.

Specified by:
authenticate in class AuthorizationHeaderScheme
credentials - The set of credentials to be used for authentication
method - The method being authenticated
Throws:
AuthenticationException - if authorization string cannot be generated due to an authentication failure


© 2015 Microsoft. All rights reserved.