private static boolean checkPrincipalMatch(Configuration conf, String loginUserName) {
    String configuredUserName = conf.get(HBASE_CLIENT_KERBEROS_PRINCIPAL);
    boolean match = configuredUserName.equals(loginUserName);
    if (!match) {
      LOG.warn("Trying to login with a different user: {}, existed user is {}.", configuredUserName,
        loginUserName);
    }
    return match;
  }
For kerberized cluster, return login user (from kinit or from keytab if specified). For
non-kerberized cluster, return system user.
@param conf configuartion file
@throws IOException login exception
hbase-common/src/main/java/org/apache/hadoop/hbase/AuthUtil.java