Re: HTTPS POST Authentication Error

From: Michael Masin (mmasin@m2gc.com)
Date: Sat Apr 24 2004 - 11:01:59 EDT


I use PHP so I don't know if this applies but I include a Content-Length
header:

Content-Length: [length of the XML]

here's a working XML snippet:

<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
<header>
<version>0.9</version>
</header>
<body>
<data_block><dt_assoc>
<item key="protocol">XCP</item>
<item key="action">SET</item>
<item key="object">COOKIE</item>
<item key="registrant_ip">[the IP address]</item>
<item key="attributes"><dt_assoc>
<item key="domain">[domain.com]</item>
<item key="reg_username">[user]</item>
<item key="reg_password">[password]</item>
</dt_assoc>
</item>
</dt_assoc></data_block>
</body>
</OPS_envelope>

regards,
m2

----- Original Message -----
From: "Fagyal, Csongor" <concept@conceptonline.hu>
To: <dev-list@opensrs.org>
Sent: Saturday, April 24, 2004 9:49 AM
Subject: HTTPS POST Authentication Error

> Hi,
>
> I am trying to deploy the "new" HTTPS POST API via Perl. However, I am
> getting "Authentication Error" messages (401).
>
> This is what I have:
> [...]
> my $ua = LWP::UserAgent->new;
> my $signature = md5_hex(md5_hex($xml, $private_key) ,
$private_key);
> my $request = POST (
> "https://rr-n1-tor.opensrs.net:55443",
> 'Content-Type' => 'text/xml',
> 'X-Username' => $rspusername,
> 'X-Signature' => $signature,
> 'Content' => $xml
> );
> my $response = $ua->request($request);
> print $response->{'_content'};
> [...]
>
>
> This is what I get:
>
> <?xml version='1.0' encoding="UTF-8" standalone="no" ?>
> <!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
> <OPS_envelope>
> <header>
> <version>0.9</version>
> </header>
> <body>
> <data_block>
> <dt_assoc>
> <item key="response_text">Authentication Failed</item>
> <item key="is_success">0</item>
> <item key="response_code">401</item>
> <item key="protocol">XCP</item>
> </dt_assoc>
> </data_block>
> </body>
> </OPS_envelope>
>
>
> And this is what I send:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
> <!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
> <OPS_envelope>
> <header>
> <version>0.9</version>
> </header>
> <body>
> <data_block>
> <dt_assoc>
> <item key="attribute">
> <dt_assoc>
> <item key="reg_password">mypassword</item>
> <item key="domain">mydomain.com</item>
> <item key="reg_username">myusername</item>
> </dt_assoc>
> </item>
> <item key="object">cookie</item>
> <item key="action">set</item>
> <item key="protocol">XCP</item>
> </dt_assoc>
> </data_block>
> </body>
> </OPS_envelope>
>
>
> $rspusername, $private_key are OK, double-checked. So is the IP I am
> connecting from. I have also tried the md5_hex implementation according
> to the docs - it gave me the correct results. Also tried to send the
> data to our own webserver, and checked the content length (to see if
> POST is not appending something wrong, again according to the docs), but
> it is OK also.
>
> Any ideas? I really don't know how to go any further... :-(
>
> Thanks,
> - Csongor Fagyal
>
>



This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:37:55 EDT