public static String getUserNameFromCookieToken(String tokenStr) {
    Map<String, String> map = splitCookieToken(tokenStr);

    if (!map.keySet().equals(COOKIE_ATTRIBUTES)) {
      LOG.error("Invalid token with missing attributes " + tokenStr);
      return null;
    }
    return map.get(COOKIE_CLIENT_USER_NAME);
  }
Parses a cookie token to retrieve client user name.
@param tokenStr Token String.
@return A valid user name if input is of valid format, else returns null.
service/src/java/org/apache/hive/service/auth/HttpAuthUtils.java