public class SecurityUtil extends Object
| Constructor and Description |
|---|
SecurityUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isSecurityEnabled(org.apache.hadoop.conf.Configuration config)
Initializes UserGroupInformation with the given Configuration and returns UserGroupInformation.isSecurityEnabled().
|
static org.apache.hadoop.security.UserGroupInformation |
loginKerberos(org.apache.hadoop.conf.Configuration config,
String principal,
String keyTab)
Initializes UserGroupInformation with the given Configuration and performs the login for the given principal
and keytab.
|
static org.apache.hadoop.security.UserGroupInformation |
loginSimple(org.apache.hadoop.conf.Configuration config)
Initializes UserGroupInformation with the given Configuration and returns UserGroupInformation.getLoginUser().
|
static KerberosTicketRenewer |
startTicketRenewalThread(String id,
org.apache.hadoop.security.UserGroupInformation ugi,
long renewalPeriod,
ComponentLog logger)
Start a thread that periodically attempts to renew the current Kerberos user's ticket.
|
public static org.apache.hadoop.security.UserGroupInformation loginKerberos(org.apache.hadoop.conf.Configuration config,
String principal,
String keyTab)
throws IOException
config - the configuration instanceprincipal - the principal to authenticate askeyTab - the keytab to authenticate withIOException - if login failedpublic static org.apache.hadoop.security.UserGroupInformation loginSimple(org.apache.hadoop.conf.Configuration config)
throws IOException
config - the configuration instanceIOException - if login failedpublic static boolean isSecurityEnabled(org.apache.hadoop.conf.Configuration config)
config - the given configurationpublic static KerberosTicketRenewer startTicketRenewalThread(String id, org.apache.hadoop.security.UserGroupInformation ugi, long renewalPeriod, ComponentLog logger)
id - The unique identifier to use for the thread, can be the class name that started the thread
(i.e. PutHDFS, etc)ugi - The current Kerberos user.renewalPeriod - The amount of time between attempting renewals.logger - The logger to use with in the renewerCopyright © 2016 Apache NiFi Project. All rights reserved.