Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: htaccess type authorization with WWW::Mechanize

by bart (Canon)
on Dec 13, 2004 at 10:00 UTC ( [id://414340]=note: print w/replies, xml ) Need Help??


in reply to htaccess type authorization with WWW::Mechanize

$agent->credentials( 'www.routerlogin.com', 'WGR614v4', 'user', 'password' );

That's a weird realm (the second parameter).

The "realm" is the info text that appears in the dialog box when you try to log in with a browser. I don't know how exact a fit the text you enter must be. I sincerely doubt that the text would ever be "WGR614v4".

update: Even with the proper values filled in, it doesn't work for me. And yes, judging by the looks of examining the $agent with Data::Dumper, setting the credentials must have worked.

update: Got it! You need a port number for the $netloc. Append a ":80" to the domain name, the first parameter, and authentication works. You still appear to need an exact realm, though. Leaving it blank, or otherwise filling in a partly matching string, just doesn't work.

$agent->credentials( 'www.routerlogin.com:80', 'WGR614v4', 'user', 'password' );

Replies are listed 'Best First'.
Re^2: htaccess type authorization with WWW::Mechanize
by davis (Vicar) on Dec 13, 2004 at 10:59 UTC

    I sincerely doubt that the text would ever be "WGR614v4".
    It probably is if you're logging in to a particular Netgear router.


    davis
    It wasn't easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.
Re^2: htaccess type authorization with WWW::Mechanize
by davido (Cardinal) on Dec 13, 2004 at 16:31 UTC

    bart,
    You got it right in your final update. It appears that, as you suggested, I needed the port number. When I added that to the URL it began working just fine. I knew it had to be something simple that I just wasn't seeing. Little did I know how simple it would turn out to be.

    Thanks!


    Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-23 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found