public static String resolveLoginAliasToUserName(String loginAlias) {
    ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
    if (attr != null && attr.getAttribute(loginAlias, RequestAttributes.SCOPE_SESSION) != null) {
      return (String)attr.getAttribute(loginAlias, RequestAttributes.SCOPE_SESSION);
    }

    return loginAlias;
  }
Looks up the provided loginAlias in the current http session and return the ambari
user name that the alias is defined for.
@param loginAlias the login alias to resolve to ambari user name
@return the ambari user name if the alias is found otherwise returns the passed in loginAlias
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AuthorizationHelper.java