in reply to Re: How do I add headers using WWW::Mechanize?
in thread How do I add headers using WWW::Mechanize?

Ultimately what I am trying to do is to go to a particular website, say

1) https://www.example.com/main/index.html

But you cannot go to that site unless you are authenticated via

2) https://www.example.com/registration/login.html
3) https://www.example.com/registration/login_2.html
4) Siteminder https://www.example.com/login/login.fcc

If not authenticated when you get to 1) you are automatically redirected to 2). You fill out a form with username and password to get to 3) which consists of a form with hidden values of your username and password which automatically submit to 4), which does the authentication and then once authenticated your username is passed as a header value all the way back to 1).

  • Comment on Re^2: How do I add headers using WWW::Mechanize?

Replies are listed 'Best First'.
Re^3: How do I add headers using WWW::Mechanize?
by NetWallah (Canon) on Feb 20, 2008 at 17:12 UTC
    I have not attempted automated siteminder logon.

    Perhaps this article on logon auomation (obtained via Google search) will help.

         "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

      Thanks, however, the problem is now more serious.

      I have tried the following existing URLs to no avail:

      http://www.perlmonks.org
      http://www.google.com
      http://www.cnn.com

      Each time I get a "500 Internal Server Error" thrown by Mechanize and the resulting HTML page says "bad hostname (xxx.xxx.xxx)" (for each URL I use)

      What now?

        Either you are behind a proxy and hence you need to supply WWW::Mechanize (and LWP::UserAgent) with the appropriate data, or you are behind a transparent proxy which dislikes your new headers.

        If you are behind a normal proxy, you can read the proxy settings from your browser settings and set $ENV{HTTP_PROXY} to the appropriate value, either from the shell or in a BEGIN block of your script. You can check whether your browser is configured for a proxy by asking your network administrator or inspecting your browser's connection settings.

        If you are behind a transparent proxy, you're out of luck. You can check that by removing the headers and seeing whether you can reach the outside world then. You can check whether your machine is behind a transparent proxy by asking your network administrator otherwise.