Feneden has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I´ve tried now many different ways, to authenticate against a web-server, i found on the web. One of them is this:
use HTTP::Request::Common; use LWP::Debug qw(+); use strict; use warnings; my $url = "http://********.com/MBSDKService/MsgSDK.asmx?WSDL.RunQuery? +queryName=physical_windows_servers_itop_query"; my $ua = new LWP::UserAgent(keep_alive => 1); $ua->credentials('http://********.com/MBSDKService/MsgSDK.asmx?WSDL', +'', '**USERNAME***', '***PASSWORD*****'); my $req = GET $url; print "--Peforming request now...---------\n"; my $res = $ua->request($req); if ($res->is_success) { print $res->content; } else { print "Error: " . $res->status_line . "\n"; print $res->headers()->as_string(), "\n"; } exit 0;
Unfortunately i came only as far as to the reply
# --Peforming request now...--------- # Error: 401 Unauthorized # Date: Thu, 25 Jan 2018 09:59:42 GMT # Server: Microsoft-IIS/7.5 # WWW-Authenticate: Negotiate # WWW-Authenticate: NTLM # Content-Length: 58 # Content-Type: text/html # Client-Date: Thu, 25 Jan 2018 09:59:43 GMT # Client-Peer: ***.*.**.***:** # Client-Response-Num: 1 # Client-Warning: Unsupported authentication scheme 'ntlm' # X-Powered-By: ASP.NET
If it is still unclear what i want: I want to connect to the LandDesk Web Service. (This is the documentation for PowerShell: Documentation) Therefore i need to authenticate and do an Http Post / Get, that i can get a XML file back. Hopefully you understand, what i want. I will be so thankful, if you can help me :) Kind regards Jan

Replies are listed 'Best First'.
Re: Authorizing with NTLM
by Discipulus (Canon) on Jan 31, 2018 at 11:02 UTC
    Hello Feneden,

    reading the error you receive back Client-Warning: Unsupported authentication scheme 'ntlm' that is generated by the LWP client I'd try installing LWP::Authen::Ntlm first.

    See NTLM problems:"Unsupported authentication scheme ntlm" for details.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: Authorizing with NTLM
by soonix (Chancellor) on Jan 31, 2018 at 10:36 UTC
    From a similiar problem (proxy authentication with NTLM), I have kept reference to this thread: NTLM authentication with IIS 6. However, this was several years ago and I don't remember what I did in my case.