Thank you for the link, that is a great referance for some things I will be doing later on in this project!
Although I am still not quite there. I have been attempting the following code thus far:
-
#!/usr/bin/perl -w
-
-
use LWP::UserAgent;
-
$ua = LWP::UserAgent->new;
-
-
use HTTP::Request::Common qw(POST);
-
-
my $req = (POST 'http://USERNAME:PASSWORD@URL');
-
-
$request = $ua->request($req);
-
$content = $request->content;
-
-
print $ua->request($req)->as_string;
-
-
exit;
-
and also
-
#!/usr/bin/perl -w
-
-
use LWP::UserAgent;
-
$ua = LWP::UserAgent->new;
-
-
use HTTP::Request::Common qw(POST);
-
-
$req = HTTP::Request->new(GET => 'URL');
-
-
# $req->authorization_basic('USERNAME', 'PASSWORD');
-
# print $ua->request($req)->as_string;
-
exit;
-
However both return the following error both ways(blanked out some fields for security):
HTTP/1.1 401 (Unauthorized) Authorization Required
Connection: close
Date: DATE HERE
Server: SERVER TYPE
WWW-Authenticate: NTLM
Content-Length: 498
Content-Type: text/html; charset=iso-8859-1
Client-Date: DATE HERE
Client-Peer: IP HERE
Client-Response-Num: 1
Client-Warning: Unsupported authentication scheme 'ntlm'
Title: 401 Authorization Required
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<hr>
<address>Address server and port information goes here</address>
</body></html>
The end result of this is to authenticate to active directory, then I must authenticate to a php login, then fill out and submit a php form.