com.cloudera.alfredo.client
Class KerberosAuthenticator

java.lang.Object
  extended by com.cloudera.alfredo.client.KerberosAuthenticator
All Implemented Interfaces:
Authenticator

public class KerberosAuthenticator
extends Object
implements Authenticator

The KerberosAuthenticator implements the Kerberos SPNEGO authentication sequence.

It uses the default principal for the Kerberos cache (normally set via kinit).

It falls back to the PseudoAuthenticator if the HTTP endpoint does not trigger an SPNEGO authentication sequence.


Field Summary
static String AUTHORIZATION
          HTTP header used by the SPNEGO client endpoint during an authentication sequence.
static String NEGOTIATE
          HTTP header prefix used by the SPNEGO client/server endpoints during an authentication sequence.
static String WWW_AUTHENTICATE
          HTTP header used by the SPNEGO server endpoint during an authentication sequence.
 
Constructor Summary
KerberosAuthenticator()
           
 
Method Summary
 void authenticate(URL url, AuthenticatedURL.Token token)
          Performs SPNEGO authentication against the specified URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WWW_AUTHENTICATE

public static String WWW_AUTHENTICATE
HTTP header used by the SPNEGO server endpoint during an authentication sequence.


AUTHORIZATION

public static String AUTHORIZATION
HTTP header used by the SPNEGO client endpoint during an authentication sequence.


NEGOTIATE

public static String NEGOTIATE
HTTP header prefix used by the SPNEGO client/server endpoints during an authentication sequence.

Constructor Detail

KerberosAuthenticator

public KerberosAuthenticator()
Method Detail

authenticate

public void authenticate(URL url,
                         AuthenticatedURL.Token token)
                  throws IOException,
                         AuthenticationException
Performs SPNEGO authentication against the specified URL.

If a token is given if does a NOP and returns the given token.

If no token is given, it will perform the SPNEGO authentication sequency using a HTTP OPTIONS request.

Specified by:
authenticate in interface Authenticator
Parameters:
url - the URl to authenticate against.
token - the authencation token being used for the user.
Throws:
IOException - if an IO error occurred.
AuthenticationException - if an authentication error occurred.


Copyright © 2011 Cloudera Inc.. All Rights Reserved.