I am trying to access a website that uses Single Sign On and cannot seem to get past the login form
use WWW::Mechanize; $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get('http://mysite.com'); my @webforms = $mech->forms(); foreach my $form (@webforms) { my @inputfields = $form->param; foreach my $inputfield (@inputfields) { if ($inputfield =~ /userID/) { $mech->set_fields($inputfield => "login"); print "Setting userid\n"; } if ($inputfield =~ /pass/) { $mech->set_fields($inputfield => "password"); print "Setting password\n"; } print $inputfield . "\n"; } } $mech->click(); $statVal = $mech->status(); print $statVal . "\n";
Debug Info:
__VIEWSTATE - is a hidden field so assumed it is handled
__VIEWSTATEGENERATOR - is a hidden field so assumed it is handled
__EVENTVALIDATION - is a hidden field so assumed it is handled
ctl00$ContentPlaceHolder1$userID - login id set to this
ctl00$ContentPlaceHolder1$pass - password set to this
Received a 200 back but still stay on the login page
I know SSO uses headers as well as _VIEWSTATE but assuming that setting up the cookie jar would capture
Any pointers to further debugging or what I am missing?
In reply to Perl Mechanize and Single Sign On by rweiche
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |