public static String getUserFromRequest ( HttpServletRequest httpRequest ) { String user = httpRequest . getRemoteUser ( ) ; if ( ! StringUtils . isEmpty ( user ) ) { return user ; } user = httpRequest . getParameter ( "user.name" ) ; // available in query-param if ( ! StringUtils . isEmpty ( user ) ) { return user ; } user = httpRequest . getHeader ( "Remote-User" ) ; // backwards-compatibility if ( ! StringUtils . isEmpty ( user ) ) { return user ; } user = getDoAsUser ( httpRequest ) ; if ( ! StringUtils . isEmpty ( user ) ) { return user ; } return null ; }
Returns the user of the given request .