in reply to Authentication with WWW::Mechanize

From the FAQ:
=head2 How do I get Mech to handle authentication? my $agent = WWW::Mechanize->new(); my @args = ( Authorization => "Basic " . MIME::Base64::encode( USER . ':' . PASS ) ); $agent->credentials( ADDRESS, REALM, USER, PASS ); $agent->get( URL, @args );

xoxo,
Andy

Replies are listed 'Best First'.
Re^2: Authentication with WWW::Mechanize
by Kanji (Parson) on Sep 19, 2005 at 20:31 UTC

    That only works for sites using HTTP authentication.

    Unfortunately, the site the OP is trying to log into isn't one of them.

    Instead is uses forms-based authentication, for which use of form_name, set_field and submit (or some variation thereof) would be a more appropriate -- and less futile :-) -- way to proceed.

        --k.


    Update: s/OP/OP is trying to log into/;

Re^2: Authentication with WWW::Mechanize
by cdherold (Monk) on Sep 20, 2005 at 04:43 UTC
    Please forgive my ignorance, but I may need a little hand holding here if you have the time.

    What are ADDRESS and REALM in credentials?

    Why do I need to have the user and pass in both the authorization of the @args as well as in the credentials?

    Will this work for logging into https even though it is 'basic'?