public static String getPrincipalWithoutRealm(final String principal) {
    int i = principal.indexOf("@");
    return (i > -1) ? principal.substring(0, i) : principal;
  }
Get the user name from a principal
hbase-server/src/main/java/org/apache/hadoop/hbase/security/SecurityUtil.java