/** * Obtain credentials for the current process using the configured * Kerberos keytab file and principal. * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String) * * @param conf the Configuration to use * @param fileConfKey Configuration property key used to store the path * to the keytab file * @param principalConfKey Configuration property key used to store the * principal name to login as * @param localhost the local hostname */ public static void login(Configuration conf, String fileConfKey, String principalConfKey, String localhost) throws IOException { if (isSecurityEnabled()) { SecurityUtil.login(conf, fileConfKey, principalConfKey, localhost); } }
/** * Obtain credentials for the current process using the configured * Kerberos keytab file and principal. * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String) * * @param conf the Configuration to use * @param fileConfKey Configuration property key used to store the path * to the keytab file * @param principalConfKey Configuration property key used to store the * principal name to login as * @param localhost the local hostname */ public static void login(Configuration conf, String fileConfKey, String principalConfKey, String localhost) throws IOException { if (isSecurityEnabled()) { SecurityUtil.login(conf, fileConfKey, principalConfKey, localhost); } }
/** * Obtain credentials for the current process using the configured * Kerberos keytab file and principal. * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String) * * @param conf the Configuration to use * @param fileConfKey Configuration property key used to store the path * to the keytab file * @param principalConfKey Configuration property key used to store the * principal name to login as * @param localhost the local hostname */ public static void login(Configuration conf, String fileConfKey, String principalConfKey, String localhost) throws IOException { if (isSecurityEnabled()) { SecurityUtil.login(conf, fileConfKey, principalConfKey, localhost); } }
/** * Returns whether or not Kerberos authentication is configured for Hadoop. * For non-secure Hadoop, this always returns <code>false</code>. * For secure Hadoop, it will return the value from * {@code UserGroupInformation.isSecurityEnabled()}. */ public static boolean isSecurityEnabled() { return SecureHadoopUser.isSecurityEnabled(); }
/** * Returns whether or not Kerberos authentication is configured for Hadoop. * For non-secure Hadoop, this always returns <code>false</code>. * For secure Hadoop, it will return the value from * {@code UserGroupInformation.isSecurityEnabled()}. */ public static boolean isSecurityEnabled() { if (IS_SECURE_HADOOP) { return SecureHadoopUser.isSecurityEnabled(); } else { return HadoopUser.isSecurityEnabled(); } }
/** * Returns whether or not Kerberos authentication is configured for Hadoop. * For non-secure Hadoop, this always returns <code>false</code>. * For secure Hadoop, it will return the value from * {@code UserGroupInformation.isSecurityEnabled()}. */ public static boolean isSecurityEnabled() { return SecureHadoopUser.isSecurityEnabled(); }
/** * Returns whether or not Kerberos authentication is configured for Hadoop. * For non-secure Hadoop, this always returns <code>false</code>. * For secure Hadoop, it will return the value from * {@code UserGroupInformation.isSecurityEnabled()}. */ public static boolean isSecurityEnabled() { return SecureHadoopUser.isSecurityEnabled(); }
/** * Obtain credentials for the current process using the configured * Kerberos keytab file and principal. * @see User#login(org.apache.hadoop.conf.Configuration, String, String, String) * * @param conf the Configuration to use * @param fileConfKey Configuration property key used to store the path * to the keytab file * @param principalConfKey Configuration property key used to store the * principal name to login as * @param localhost the local hostname */ public static void login(Configuration conf, String fileConfKey, String principalConfKey, String localhost) throws IOException { if (isSecurityEnabled()) { SecurityUtil.login(conf, fileConfKey, principalConfKey, localhost); } }
/** * Returns whether or not Kerberos authentication is configured for Hadoop. * For non-secure Hadoop, this always returns <code>false</code>. * For secure Hadoop, it will return the value from * {@code UserGroupInformation.isSecurityEnabled()}. */ public static boolean isSecurityEnabled() { return SecureHadoopUser.isSecurityEnabled(); }
/** * Login through configured keytab and pricipal. * @param keytabLocation location of keytab * @param principalName principal in keytab * @throws IOException exception from UserGroupInformation.loginUserFromKeytab */ public static void login(String keytabLocation, String principalName) throws IOException { if (isSecurityEnabled()) { UserGroupInformation.loginUserFromKeytab(principalName, keytabLocation); } }