The problem is that the login form through which a post request is made to the server is placed inside an iframe. The url of the login form is actually a redirect link and the user is redirected to another url which then renders the after login page. When I make a post request to the url of this login form from java then instead of redirecting the page to the another url the post request returns an error page. Does anybody have any knowledge of how to login to a form inside an iframe which redirects to another link from Java?
Thanks for your reply. Problem is that my post request to the login form is rejected as the url that i post to is a redirect link to another url. It logs in my correctly when i do from browser. But from java some reason it is not.
I tried using htmlunit but since the redirect page is the same as the page containing the form inside an iframe hence it enters into an infinite loop. This is a general problem with html unit i think. When the url of the redirect page is the same as the page from which the request originates then it enters into an infinite loop. Problem is that in my page the form is inside an iframe. Below is a brief description of problem :
I am trying to login to a web page https://online.firstdata.de/esp/concardis/ using HTMLunit library in Java. The thing is that this page contains a form inside a couple of iframes. The source of the iframe containing the form is https://online.firstdata.de/login/postlogin/UserDispatcher . When a form is submitted then one of the redirect links before the next page is rendered is also the same link as mentioned above. So, this creates an infinite loop when I use it from Java. However, when the login happens from the browser because the main source of the originating page was the link ending with /concardis the redirect link is not the same as this link and hence there is no infinite loop. How can I simulate this same behaviour from Java? Here is my code :