Class ZKAuthentication

java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKAuthentication

@Private public final class ZKAuthentication extends Object
Provides ZooKeeper authentication services for both client and server processes.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
    A JAAS configuration that defines the login modules that we want to use for ZooKeeper login.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isSecureZooKeeper(org.apache.hadoop.conf.Configuration conf)
    Returns true when secure authentication is enabled (whether hbase.security.authentication is set to "kerberos").
    private static void
    login(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname, String loginContextProperty, String loginContextName)
    Log in the current process using the given configuration keys for the credential file and login principal.
    static void
    loginClient(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname)
    Log in the current zookeeper client using the given configuration keys for the credential file and login principal.
    static void
    loginServer(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname)
    Log in the current zookeeper server process using the given configuration keys for the credential file and login principal.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
  • Constructor Details

  • Method Details

    • loginServer

      public static void loginServer(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) throws IOException
      Log in the current zookeeper server process using the given configuration keys for the credential file and login principal.

      This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.

      Parameters:
      conf - The configuration data to use
      keytabFileKey - Property key used to configure the path to the credential file
      userNameKey - Property key used to configure the login principal
      hostname - Current hostname to use in any credentials
      Throws:
      IOException - underlying exception from SecurityUtil.login() call
    • loginClient

      public static void loginClient(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) throws IOException
      Log in the current zookeeper client using the given configuration keys for the credential file and login principal.

      This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.

      Parameters:
      conf - The configuration data to use
      keytabFileKey - Property key used to configure the path to the credential file
      userNameKey - Property key used to configure the login principal
      hostname - Current hostname to use in any credentials
      Throws:
      IOException - underlying exception from SecurityUtil.login() call
    • login

      private static void login(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname, String loginContextProperty, String loginContextName) throws IOException
      Log in the current process using the given configuration keys for the credential file and login principal.

      This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.

      Parameters:
      conf - The configuration data to use
      keytabFileKey - Property key used to configure the path to the credential file
      userNameKey - Property key used to configure the login principal
      hostname - Current hostname to use in any credentials
      loginContextProperty - property name to expose the entry name
      loginContextName - jaas entry name
      Throws:
      IOException - underlying exception from SecurityUtil.login() call
    • isSecureZooKeeper

      public static boolean isSecureZooKeeper(org.apache.hadoop.conf.Configuration conf)
      Returns true when secure authentication is enabled (whether hbase.security.authentication is set to "kerberos").