Click here to get back home

WWW::Mechanize and NTLM authentication

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
WWW::Mechanize and NTLM authentication e r m 12-21-2004
Get Chitika Premium
Posted by e r m on December 21, 2004, 3:55 pm
Please log in for more thread options
I'm having problems with a script to verify if a web app is up and
running. I initially received http code 401, which I believe is due to
NTLM authentication. After searching through CPAN, I came across the
example in LWP::Authen::Ntlm.

I've modified my code by adding keep_alive, and calling credentials, as
follows:
# Set up the mech.
my $mech1 = WWW::Mechanize->new( autocheck=>1, keep_alive=>1 );
$mech1->agent_alias( 'Windows IE 6' );
print "Setting up credentialsn";
$mech1->credentials($web_addr, '', $domain1$userid1, $pswd1);

# Try to get the login page.
print "Getting the url - $web_addr n";
$mech1->get( $web_addr );

Here's the output with debug on:
Setting up credentials
Getting the url - http://app.group.com
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking app.group.com for cookies
HTTP::Cookies::add_cookie_header: Checking .group.com for cookies
HTTP::Cookies::add_cookie_header: Checking group.com for cookies
HTTP::Cookies::add_cookie_header: Checking .com for cookies
LWP::UserAgent::send_request: GET http://app.group.com
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 811 bytes
LWP::Protocol::collect: read 1896 bytes
LWP::Protocol::collect: read 1724 bytes
LWP::UserAgent::request: Simple response: Unauthorized
LWP::Authen::Ntlm::authenticate: authenticate() has been called
Use of uninitialized value in exists at
/mydir/usr/local/perl5/lib/site_perl/5.8.5/LWP/UserAgent.pm line 566.
LWP::Authen::Ntlm::authenticate: No username and password available
from get_basic_credentials(). Returning unmodified response object
Error GETing http://app.group.com: Access Denied at ping-share.pl line
139

Any help would be appreciated.



Posted by e r m on December 28, 2004, 4:39 am
Please log in for more thread options
fat side up.
Place uncovered in 500° oven for 20 minutes, reduce oven to 325°.
Bake till medium rare (150°) and let roast rest.
Pour stock over onions and drippings, carve the meat and
place the slices in the au jus.



Bisque à l?Enfant

Honor the memory of Grandma with this dish by utilizing her good
silver soup tureen and her great grandchildren (crawfish, crab or
lobster will work just as well, however this dish is classically
made with crawfish).

Stuffed infant heads, stuffed crawfish heads, stuffed crab or lobster shells;
make patties if shell or head is not available
(such as with packaged crawfish, crab, or headless baby).
Flour
oil
onions
bell peppers
garlic salt, pepper, etc.
3 cups chicken stock
2 sticks butter
3 tablespoons oil

First stuff the heads, or make the patties (see index)
then fry or bake.
Set aside to drain on paper towels.
Make a roux with butter, oil and flour,
brown vegetables in the roux, then add chicken stock and
allow to simmer for 20 minutes.
Add the patties or stuffed heads, and some loose crawfish,
lobster, long piglet, or what have you.
Cook on low for 15 minutes, then allow it to set for at least
15 minutes more.
Serve over steamed rice; this dish is very impressive!



Stuffed Cabbage Rolls

Babies really can be found under a cabbage leaf -
or one can arrange for ground beef to be found there instead.

8 large cabbage leaves
1 lb. lean ground newborn human filets, or ground chuck
Onions
peppers
celery
garlic
soy sauce
salt pepper, etc
Olive oil
breadcrumbs
Tomato Gravy (see index)

Boil the cabbage leaves for 2 minutes to soften.
In skillet, brown the meat in a little olive oil,
then add onions, peppers, and celery (all chopped finely)
and se




Similar ThreadsPosted
Newbie question about NTLM and web sites August 12, 2004, 9:17 am
authentication October 31, 2005, 3:32 am
LWP Problems (Authentication?) September 5, 2004, 7:12 am
lwp authentication on asp page March 23, 2005, 10:28 pm
SSL Authentication using Net::POP3 June 25, 2006, 4:40 pm
LWP and Digest authentication February 8, 2007, 1:50 pm
Net::SSH::Perl Trouble with publickey authentication May 30, 2005, 3:58 am
Apache+MySQL+htaccess - nxt steps after authentication May 26, 2005, 2:01 pm
Perl DBI/DBD MySQL User Authentication Error June 10, 2006, 2:12 pm
Help with Mechanize January 15, 2007, 3:14 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap