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

java.lang.Object
  extended by com.microsoft.tfs.core.httpclient.auth.AuthorizationHeaderScheme
All Implemented Interfaces:
AuthScheme
Direct Known Subclasses:
NegotiateScheme, NTLMScheme, RFC2617Scheme, WRAPAuthScheme

public abstract class AuthorizationHeaderScheme
extends java.lang.Object
implements AuthScheme


Field Summary
static java.lang.String HOST_CHALLENGE_HEADER
          The WWW authenticate challenge header.
static java.lang.String HOST_RESPONSE_HEADER
          The WWW authenticate response header.
static java.lang.String PROXY_CHALLENGE_HEADER
          The proxy authenticate challenge header.
static java.lang.String PROXY_RESPONSE_HEADER
          The proxy authenticate response header.
 
Constructor Summary
AuthorizationHeaderScheme()
           
 
Method Summary
protected abstract  java.lang.String authenticate(AuthScope authScope, Credentials credentials, HttpMethod method)
          Provides the Authorization or Proxy-Authorization headers for authentication with the given Credentials.
 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.
 
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
getParameter, getSchemeName, isComplete, isConnectionBased, processChallenge, supportsCredentials
 

Field Detail

HOST_CHALLENGE_HEADER

public static final java.lang.String HOST_CHALLENGE_HEADER
The WWW authenticate challenge header.

Constant Field Value:
"WWW-Authenticate"
See Also:
Constant Field Values

HOST_RESPONSE_HEADER

public static final java.lang.String HOST_RESPONSE_HEADER
The WWW authenticate response header.

Constant Field Value:
"Authorization"
See Also:
Constant Field Values

PROXY_CHALLENGE_HEADER

public static final java.lang.String PROXY_CHALLENGE_HEADER
The proxy authenticate challenge header.

Constant Field Value:
"Proxy-Authenticate"
See Also:
Constant Field Values

PROXY_RESPONSE_HEADER

public static final java.lang.String PROXY_RESPONSE_HEADER
The proxy authenticate response header.

Constant Field Value:
"Proxy-Authorization"
See Also:
Constant Field Values
Constructor Detail

AuthorizationHeaderScheme

public AuthorizationHeaderScheme()
Method Detail

authenticateHost

public void authenticateHost(AuthScope authScope,
                             Credentials credentials,
                             HttpState state,
                             HttpMethod method)
                      throws AuthenticationException
Description copied from interface: AuthScheme
Configures the given HttpMethod for authentication to the host with the given Credentials.

Specified by:
authenticateHost in interface AuthScheme
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

authenticateProxy

public void authenticateProxy(AuthScope authScope,
                              Credentials credentials,
                              HttpState state,
                              HttpMethod method)
                       throws AuthenticationException
Description copied from interface: AuthScheme
Configures the given HttpMethod for authentication to the proxy with the given Credentials.

Specified by:
authenticateProxy in interface AuthScheme
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

authenticate

protected abstract java.lang.String authenticate(AuthScope authScope,
                                                 Credentials credentials,
                                                 HttpMethod method)
                                          throws AuthenticationException
Provides the Authorization or Proxy-Authorization headers for authentication with the given Credentials.

Parameters:
authscope - The authentication scope
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
Since:
3.0


© 2015 Microsoft. All rights reserved.