@InterfaceAudience.Private public final class ZKAuthentication extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
ZKAuthentication.JaasConfiguration
A JAAS configuration that defines the login modules that we want to use for ZooKeeper login.
|
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Modifier | Constructor and Description |
---|---|
private |
ZKAuthentication() |
Modifier and Type | Method and 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.
|
private static final org.slf4j.Logger LOG
private ZKAuthentication()
public static void loginServer(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) throws IOException
This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.
conf
- The configuration data to usekeytabFileKey
- Property key used to configure the path to the credential fileuserNameKey
- Property key used to configure the login principalhostname
- Current hostname to use in any credentialsIOException
- underlying exception from SecurityUtil.login() callpublic static void loginClient(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname) throws IOException
This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.
conf
- The configuration data to usekeytabFileKey
- Property key used to configure the path to the credential fileuserNameKey
- Property key used to configure the login principalhostname
- Current hostname to use in any credentialsIOException
- underlying exception from SecurityUtil.login() callprivate static void login(org.apache.hadoop.conf.Configuration conf, String keytabFileKey, String userNameKey, String hostname, String loginContextProperty, String loginContextName) throws IOException
This is only applicable when running on secure hbase On regular HBase (without security features), this will safely be ignored.
conf
- The configuration data to usekeytabFileKey
- Property key used to configure the path to the credential fileuserNameKey
- Property key used to configure the login principalhostname
- Current hostname to use in any credentialsloginContextProperty
- property name to expose the entry nameloginContextName
- jaas entry nameIOException
- underlying exception from SecurityUtil.login() callpublic static boolean isSecureZooKeeper(org.apache.hadoop.conf.Configuration conf)
true
when secure authentication is enabled (whether
hbase.security.authentication
is set to "kerberos
").Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.