0 Replies Latest reply on Jun 28, 2011 12:39 PM by dhsflex01

    Flex form based authentication

    dhsflex01

      Hi,

       

      I am trying to submit form  based authentication form Flex application using HTTPService to post the j_username & j_password below is my code.

       

              <mx:HTTPService id="loginService" resultFormat="e4x"
                              url="j_security_check" method="POST" result="processResult(event)"
                              fault="showFaultEvent(event)" />


                      var params:Object = new Object();
                      params.j_username = "abc";
                      params.j_password = "abc";
                      loginService.send(params);

       

      It is not working as expected, getting an error invalid credentials.

       

      Everything works when I submit from a simple HTML form below is my html code.

       

      <form method="POST" action="j_security_check">
        User Name: <input type="text" name="j_username" /><br />
        Password: <input type="password" name="j_password" /><br />
        <input type="submit" value="Login" />
      </form>

       

       

      Is there any issue with my flex code ?

      Any Idea why flex not able to do form based authentication ?