title: Is it possible to forward to Siteminder login.fcc from a JSF action?
body: <p>I have a "custom" (JSF) login page for my application. My company uses Siteminder for authentication. So, in order to login to Siteminder with a "custom" page, I have to have a form that posts to /login.fcc with the appropriate form fields (username/password and a couple of Siteminder specific hidden fields).</p>
  
  <p>What I am trying to do is to continue to leverage the form validations and such of JSF and still post to login.fcc.</p>
  
  <p>Here is a stripped down version of my custom form:</p>
  
  <pre><code>&lt;rich:messages /&gt;
      &lt;h:form id="adminLogin" prependId="false"&gt;
      &lt;h:panelGrid columns="2" styleClass="center"&gt;
         &lt;h:outputLabel value="HUB USERNAME:" /&gt;
         &lt;h:inputText id="USER" label="Username" size="12" required="true" /&gt;
         &lt;h:outputLabel value="HUB PASSWORD:" /&gt;
         &lt;h:inputSecret id="PASSWORD" label="Password" size="12" required="true" /&gt;
         &lt;input type="hidden" name="target" value="#{loginController.smTarget}" /&gt;
         &lt;input type="hidden" name="smagentname" value="#{loginController.smAgentName}" /&gt;
       &lt;/h:panelGrid&gt;
     &lt;h:panelGroup layout="block" styleClass="max-width button-panel"&gt;
       &lt;a4j:commandButton id="adminLoginBtn" value="LOGIN"
         styleClass="login-btn" 
         action="#{loginController.managerLogin}" /&gt;
     &lt;/h:panelGroup&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>Note that I have used standard hidden inputs for the target and smagentname fields. This is because I have no need to have both setters and getters in my controller for these fields. I simply want the controller to provide the values when the page renders.</p>
  
  <p>My controller method looks like this: </p>
  
  <pre><code>public void managerLogin()
  {
      LoginController.LOG.debug("manager is logging in...");
      LoginController.LOG.debug("user: " + getRequestParameterValue("USER"));
      LoginController.LOG.debug("smagent: " + getRequestParameterValue("smagentname"));
      LoginController.LOG.debug("target: " + getRequestParameterValue("target"));
  
      forwardTo(LoginController.SM_LOGIN_FCC);
  }
  </code></pre>
  
  <p>You can see that I am logging the values from all fields except the password field and they all print correctly in my log...so I know I am getting the values.  My "forwardTo()" method simply gets the ExternalContext and calls dispatch() on it...passing in the path to the login.fcc page (which is "/forms/login.fcc").</p>
  
  <p>When I input values in the form and click the login button, I see my values in the console but I get a 404 message in my browser.</p>
  
  <p>I can manually put the "/forms/login.fcc" page in the address line and I have no problems with the GET rendering the login.fcc page. But I, of course, don't want to render the login.fcc (GET) I want to peform the Siteminder login (via POST).</p>
  
  <p>It is my understanding that all request parameters are made available through a forward process I was expecting this to work.</p>
  
  <p>I can take this same form and un-JSF-ize it...and make the login button simply submit the form (whose action would be the /forms/login.fcc via POST and it works fine too, but then I loose the benefits of the form/field validations that JSF provides.</p>
  
  <p>Any ideas?</p>