in reply to Re: Authenticate HTTPS website with IE Automation
in thread Authenticate HTTPS website with IE Automation

I used LWP::UserAgent for authentication and IEAutomation for navigation and applying funtionality onto pages. But the the respopnse content after the authentication is not the one which could be passed to IEAutomation object. Thus after initialsing $ie object it is again asking for user id password. Please have a look over the code.
my $URL = 'https://myurl.com'; my $user = 'rapid_perl'; my $pass = 'secret'; my $ua = LWP::UserAgent->new(); $ua->agent("USER/AGENT/IDENTIFICATION"); my $request = HTTP::Request->new(GET => $URL); $request->authorization_basic($user, $pass); my $response = $ua->request($request); my $cont_res = $response->content(); if ($cont_res=~/\<title\>Windchill\<\/title\>/i) { print "Login Successful \n"; my $ie1 = Win32::IEAutomation->new( visible => 1, maximize + => 0); $ie1->gotoURL("$URL"); sleep 15; }

Replies are listed 'Best First'.
Re^3: Authenticate HTTPS website with IE Automation
by marto (Cardinal) on Aug 24, 2016 at 07:38 UTC

    Please think about what you're doing when posting, always post fake login details.

      To reinforce this sentiment, I found it a very good pattern to read passwords from the environment or pass them via the command line. In both approaches, the password is still discoverable to other users on the machine and maybe stored in the .history file of the account, but it is harder to accidentially leak the password to a wider audience.

        I have started using URI::db as a method of doing this in a single environment variable.

        --MidLifeXis

      Thanks alot man. I will make sure for this in future