Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Authentication with WWW::Mechanize

by petdance (Parson)
on Sep 19, 2005 at 20:01 UTC ( #493284=note: print w/replies, xml ) Need Help??


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'?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://493284]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2021-12-01 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (13 votes). Check out past polls.

    Notices?