public static boolean shouldLoginFromKeytab(Configuration conf) {
    Optional<String> keytab = Optional.ofNullable(conf.get(AuthUtil.HBASE_CLIENT_KEYTAB_FILE));
    Optional<String> principal =
      Optional.ofNullable(conf.get(AuthUtil.HBASE_CLIENT_KERBEROS_PRINCIPAL));
    return keytab.isPresent() && principal.isPresent();
  }
In secure environment, if a user specified his keytab and principal, a hbase client will try to
login with them. Otherwise, hbase client will try to obtain ticket(through kinit) from system.
@param conf configuration file
@return true if keytab and principal are configured
hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java