3 Replies Latest reply on Jul 12, 2012 9:38 AM by atdavie

    Seam 3 Security and getRemoteUser

    atdavie

      I am trying to pick up the remote user from a security filter called spnego (as per the sourceforge project). This works fine with Seam 2. However with Seam 3.0 I always receive a null value. This is despite the JSP test page displaying the expected value. So it seems everything is working such that JSP can pick the value up and something thereafter is resetting the remoteuser.

       

      e.g. code inside Seam 2 custom Authenticate method:

      HttpServletRequest request = ServletContexts.getInstance().getRequest(); username = request.getRemoteUser(); 
      

      In the Seam 3 I use a custom authenticator and try the same method, and variations on it. e.g.

      @Inject HttpServletRequest httpRequest; 
      @Inject FacesContext fc ;  
      ...
      user = httpRequest.getRemoteUser(); 
      String alt=FacesContext.getCurrentInstance().getExternalContext().getRemoteUser(); 
      String alt2=fc.getExternalContext().getRemoteUser(); 
      String alt3=fc.getCurrentInstance().getExternalContext().getRemoteUser();
      

      I know the request is coming in ok as I get sensible values for other parts of the request, e.g. request.getContextPath();