HTTP POST with MD5 Digest Authentication

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
jobsoftinc
Newbie
Posts: 3
Joined: Mon Feb 07, 2011 11:13 pm

HTTP POST with MD5 Digest Authentication

Post by jobsoftinc » Mon Feb 07, 2011 11:46 pm

Hello,

Am evaluating Macro Scheduler. Was wondering if there was a way to native make an HTTP POST that had to authenticate using MD5 Digest (much the same way Perl's LWP::UserAgent or C#'s System.Net.HttpWebRequest can)? I can't use Basic Authentication (at least not the way I understand it) with the web appl that I would be needing to posting a data stream to. Is this possible in VBScript? I suppose I could instantiate an IE object, but that seems too much. The POST is pushing some XML to a telecom device but SSL is not required. From Perl's LWP::UserAgent, the packet capture of a working POST is:

POST /push HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Authorization: Digest username="Polycom", realm="PUSH Authentication", algorithm="MD5", uri="/push", nonce="129694596", response="b842e0d362e666e872fdfebc5bc35aee", message-digest="d41d8cd98f00b204e9800998ecf8427e"
Host: 192.168.150.114
User-Agent: libwww-perl/5.837
Content-Length: 94
Content-Type: application/x-com-polycom-spipx

spipx.pl?dialstring=1115551212

Perl's UserAgent object has a method for creating the proper HTTP POST form once certain attributes are supplied.

We would like to use Macro Scheduler as the control session but need a way to "push" the command XML to the phone in the above method.

Thanks!!

jobsoftinc
Newbie
Posts: 3
Joined: Mon Feb 07, 2011 11:13 pm

FWIW, perl code (run from Linux)

Post by jobsoftinc » Mon Feb 07, 2011 11:57 pm

Need to duplicate this with some equivalent in Macroscheduler environment:

=================================================
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
#
# $ua->credentials( $netloc, $realm, $uname, $pass )
$ua->credentials('192.168.150.114:80','PUSH Authentication','Polycom' => 'XXXXXX');
#
my $content ='spipx.pl?dialstring=1115551212';
my $response = $ua->post('http://192.168.150.114/push', Content => $content, 'Content-Type' => 'application/x-com-polycom-spipx');
if ($response->is_success) {
print $response->decoded_content;
} else {
die $response->status_line;
}
=================================================

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Tue Feb 08, 2011 1:05 pm

Need to duplicate this with some equivalent in Macroscheduler environment:
Since you have it already coded and working in perl - why not simply execute your perl from within Macro Scheduler like so ?

There is an easy to install Windows port of perl available from Active State. They also have a free community version.
http://www.activestate.com/activeperl

Code: Select all

//Macro Scheduler code
Run>c:\path\to\perl\bin\perl myprogram.pl
//do more stuff like click buttons, etc...

jobsoftinc
Newbie
Posts: 3
Joined: Mon Feb 07, 2011 11:13 pm

Good thought

Post by jobsoftinc » Tue Feb 08, 2011 5:34 pm

I had not really thought about that, so thanks. I am a Linux person primarily. Was thinking of something native to Windows though, that might not require any additional installed components (other than Macroscheduler). But, along your line of thought, could also look at cURL for Windows too (as it can to HTTP/HTTPS/+ with BASIC/DIGEST/+ authentication straight from the command line (regardless of platform). I may still try and see if it is possible to access System.Net.HttpWebRequest perhaps from VBScript. I would think this might be possible as long as an adequate .Net framework was also installed on the PC. The more "core windows" it can be, I think, the less hassles down the road if this whole concoction will even work.

Thanks again for your input!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts