com.microsoft.tfs.core.httpclient.auth
Interface AuthScheme

All Known Implementing Classes:
AuthorizationHeaderScheme, AuthSchemeBase, BasicScheme, CookieAuthScheme, DigestScheme, NegotiateScheme, NTLMScheme, PreemptiveBasicScheme, RFC2617Scheme, WRAPAuthScheme

public interface AuthScheme

This interface represents an abstract challenge-response oriented authentication scheme.

An authentication scheme should be able to support the following functions:

Authentication schemes may ignore method name and URI parameters if they are not relevant for the given authentication mechanism

Authentication schemes may be stateful involving a series of challenge-response exchanges

Since:
2.0beta1

Method Summary
 void authenticateHost(AuthScope authscope, Credentials credentials, HttpState state, HttpMethod method)
          Configures the given HttpMethod for authentication to the host with the given Credentials.
 void authenticateProxy(AuthScope authScope, Credentials credentials, HttpState state, HttpMethod method)
          Configures the given HttpMethod for authentication to the proxy with the given Credentials.
 java.lang.String getParameter(java.lang.String name)
          Returns authentication parameter with the given name, if available.
 java.lang.String getSchemeName()
          Returns textual designation of the given authentication scheme.
 boolean isComplete()
          Authentication process may involve a series of challenge-response exchanges.
 boolean isConnectionBased()
          Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis
 void processChallenge(java.lang.String challenge)
          Processes the given challenge token.
 boolean supportsCredentials(Credentials credentials)
          Determines whether this auth scheme supports credentials of the given type.
 

Method Detail

supportsCredentials

boolean supportsCredentials(Credentials credentials)
Determines whether this auth scheme supports credentials of the given type. For example, NegotiateScheme only supports DefaultNTCredentials.

Parameters:
credentialClass - The type of credentials to query
Returns:
true if these credentials are supported, false otherwise

processChallenge

void processChallenge(java.lang.String challenge)
                      throws MalformedChallengeException
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

Parameters:
challenge - the challenge string
Throws:
MalformedChallengeException
Since:
3.0

getSchemeName

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

Returns:
the name of the given authentication scheme

getParameter

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

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

isConnectionBased

boolean isConnectionBased()
Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis

Returns:
true if the scheme is connection based, false if the scheme is request based.
Since:
3.0

isComplete

boolean isComplete()
Authentication process may involve a series of challenge-response exchanges. This method tests if the authorization process has been completed, either successfully or unsuccessfully, that is, all the required authorization challenges have been processed in their entirety.

Returns:
true if the authentication process has been completed, false otherwise.
Since:
3.0

authenticateHost

void authenticateHost(AuthScope authscope,
                      Credentials credentials,
                      HttpState state,
                      HttpMethod method)
                      throws AuthenticationException
Configures the given HttpMethod for authentication to the host with the given Credentials.

Parameters:
authscope - The authentication scope
credentials - The set of credentials to be used for athentication
method - The method being authenticated
Throws:
AuthenticationException - if authorization string cannot be generated due to an authentication failure
Since:
3.0

authenticateProxy

void authenticateProxy(AuthScope authScope,
                       Credentials credentials,
                       HttpState state,
                       HttpMethod method)
                       throws AuthenticationException
Configures the given HttpMethod for authentication to the proxy with the given Credentials.

Parameters:
authscope - The authentication scope
credentials - The set of credentials to be used for athentication
method - The method being authenticated
Throws:
AuthenticationException - if authorization string cannot be generated due to an authentication failure
Since:
3.0


© 2015 Microsoft. All rights reserved.