code: public PrincipalUser getRemoteUser(HttpServletRequest req) {
          requireArgument(req != null, "Request cannot be null.");
          
          if(req.getHeader(HttpHeaders.AUTHORIZATION) != null) {	
  	        PrincipalUser result = null;
  	        Object username = req.getAttribute(AuthFilter.USER_ATTRIBUTE_NAME);
  	        
  	        if (username != null) {
  	            result = userService.findUserByUsername(String.class.cast(username));
  	        }
  	        return result;
          }
          
          return null;
      }
docs: Returns the logged in user object.
  
  @param   req  The HTTP request.
  
  @return  The logged in user object.