For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > June 2004 > Authenticating to a web form that posts to a jsp.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Authenticating to a web form that posts to a jsp.
Jeremy

2004-06-30, 3:58 pm

Hi,

I am trying to write a perl script that will automatically
authenticate to a web site so that I can download files from the site.
However, the site posts username/password information to a jsp, not a
cgi. I have read the LWP::UserAgent and LWP::Simple documentation,
and had no problem writing a script to authenticate to another site,
but I haven't had any success here. Any suggestions? If you're
interested, the authentication page page in question is:

https://www.affymetrix.com/site/login/login.affx

Any help would be greatly appreciated.

Thanks,

Jeremy
Sherm Pendley

2004-06-30, 8:59 pm

Jeremy wrote:

> However, the site posts username/password information to a jsp, not a
> cgi.


That doesn't matter - a form is a form is a form. The client just formats
and sends the form data according to HTTP rules; it doesn't know or care
how the server deals with its end.

> I have read the LWP::UserAgent and LWP::Simple documentation,
> and had no problem writing a script to authenticate to another site,
> but I haven't had any success here. Any suggestions?


The site you point to isn't using HTTP Authentication. There is a form in
the page you point to; you need to mimic what that form does by assigning
the user name and password to form inputs and submitting a get or post
request to the action URL.

If the site maintains state using cookies, you'll need to handle that as
well.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com