org.apache.flume.auth
Class FlumeAuthenticationUtil

java.lang.Object
  extended by org.apache.flume.auth.FlumeAuthenticationUtil

public class FlumeAuthenticationUtil
extends Object

FlumeAuthentication utility class that provides methods to get an Authenticator. If proper credentials are provided KerberosAuthenticator is returned which can be used to execute as the authenticated principal , or else a SimpleAuthenticator which executes without any authentication


Method Summary
static FlumeAuthenticator getAuthenticator(String principal, String keytab)
          If principal and keytab are null, this method returns a SimpleAuthenticator which executes without authentication.
static CallbackHandler getSaslGssCallbackHandler()
          Returns the standard SaslGssCallbackHandler from the hadoop common module
static String[] splitKerberosName(String principal)
          Resolves the principal using Hadoop common's SecurityUtil and splits the kerberos principal into three parts user name, host and kerberos realm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAuthenticator

public static FlumeAuthenticator getAuthenticator(String principal,
                                                  String keytab)
                                           throws SecurityException
If principal and keytab are null, this method returns a SimpleAuthenticator which executes without authentication. If valid credentials are provided KerberosAuthenitcator is returned which can be used to execute as the authenticated principal. Invalid credentials result in IllegalArgumentException and Failure to authenticate results in SecurityException

Parameters:
principal -
keytab -
Returns:
FlumeAuthenticator
Throws:
SecurityException

getSaslGssCallbackHandler

public static CallbackHandler getSaslGssCallbackHandler()
Returns the standard SaslGssCallbackHandler from the hadoop common module

Returns:
CallbackHandler

splitKerberosName

public static String[] splitKerberosName(String principal)
                                  throws IOException
Resolves the principal using Hadoop common's SecurityUtil and splits the kerberos principal into three parts user name, host and kerberos realm

Parameters:
principal -
Returns:
String[] of username, hostname and kerberos realm
Throws:
IOException


Copyright © 2009-2015 Apache Software Foundation. All Rights Reserved.