title: Shiro redirecting to wrong place when using PrimeFaces with JSF
body: <p>This web application works with Shiro and JSF. I added PrimeFaces and I am having login redirect issues.</p>
  
  <p>Expected Behaviour:</p>
  
  <ol>
  <li>Navigate to url that needs authc</li>
  <li>Redirected to login page</li>
  <li>login redirected back to the original page</li>
  </ol>
  
  <p>Behaviour with primfaces</p>
  
  <ol>
  <li>Navigate to url that needs authc</li>
  <li>Redirected to login page</li>
  <li>after login redirected to javax.faces.resource/theme.css?ln=primefaces-aristo</li>
  </ol>
  
  <p>I login a user by catching the request params in my <code>shiro.ini</code> file</p>
  
  <pre><code># name of request parameter with username; if not present filter assumes 'username'
  authc.usernameParam = login:username
  # name of request parameter with password; if not present filter assumes 'password'
  authc.passwordParam = login:password
  # does the user wish to be remembered?; if not present filter assumes 'rememberMe'
  authc.rememberMeParam = login:remembered
  </code></pre>
  
  <p>I modified this to to instead use a <code>PassThruAuthenticationFilter</code> and the login request is processed by my <code>Bean</code> but this still produces the same error. Bean login method</p>
  
  <pre><code>AuthenticationToken token =  new UsernamePasswordToken(username, password);
  Subject currentUser = SecurityUtils.getSubject();
  currentUser.login(token);
  ServletRequest request = (ServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
  ServletResponse response = (ServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
  WebUtils.redirectToSavedRequest(request, response, "index.xhtml");
  </code></pre>
  
  <p>My login Bean is <code>@RequestScoped</code></p>