public static String getProxyUserName() {
    SecurityContext securityContext = SecurityContextHolder.getContext();
    Authentication auth = securityContext.getAuthentication();
    return getProxyUserName(auth);
  }
Gets the name of the logged-in proxy user, if any.

@return the name of the logged-in proxy user
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AuthorizationHelper.java