[arin-tech-discuss] 403 Errors when trying to create a customer

Ramage, David david.ramage at chartercom.com
Wed Nov 30 13:37:45 EST 2011


I gave that a go, but unfortunately I'm still getting a 403:

VAR1 = bless( {
  '_protocol' => 'HTTP/1.1',
  '_content' => '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don\'t have permission to access /rest/net/[net handle]/customer
on this server.</p>
<hr>
<address>Apache/2.2.3 (CentOS) Server at rest-beta.arin.net Port 443</address>
</body></html>
',
  '_rc' => '403',
  '_headers' => bless( {
    'connection' => 'close',
    ...
      'content-type' => 'application/xml',
      'accept' => 'text/xml',
      'content-length' => 497,
      'authorization' => 'Basic cmVzdC1iZXRhLmFyaW4ubmV0L3Jlc3Q6cmVzdC1iZXRhLmFyaW4ubmV0L3Jlc3Q='
    }, 'HTTP::Headers' ),
    '_method' => 'POST',
    '_uri_canonical' => $VAR1->{'_request'}{'_uri'}
  }, 'HTTP::Request' )
}, 'HTTP::Response' );



-----Original Message-----
From: arin-tech-discuss-bounces at arin.net [mailto:arin-tech-discuss-bounces at arin.net] On Behalf Of Thomas St.Pierre
Sent: Wednesday, November 30, 2011 10:30 AM
To: arin-tech-discuss at arin.net
Subject: Re: [arin-tech-discuss] 403 Errors when trying to create a customer

Try using Content-Type: application/xml in your request

in PHP:
      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: 
application/xml'));

Thanks,

Thomas



On 11-11-30 1:27 PM, Ramage, David wrote:
> Hey folks,
> I'm running across some 403 errors when I try to hit rest-beta.arin.net.  I'm probably missing something obvious here, but I'm not seeing it.
>
> In this particular case I'm trying to POST to https://rest-beta.arin.net/rest/net/[my net handle]/customer?apikey=[my api key].  It looks like the XML is being sent, but I'm getting the 403 back.
>
> Here's a sanitized Data::Dumper of my packet:
>
> $VAR1 = bless( {
>    '_protocol' =>  'HTTP/1.1',
>    '_content' =>  '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>403 Forbidden</title>
> </head><body>
> <h1>Forbidden</h1>
> <p>You don\'t have permission to access /rest/net/[net handle]/customer
> on this server.</p>
> <hr>
> <address>Apache/2.2.3 (CentOS) Server at rest-beta.arin.net Port 443</address>
> </body></html>
> ',
>    '_rc' =>  '403',
>    '_headers' =>  bless( {
>      'connection' =>  'close',
>      'client-response-num' =>  1,
>      'date' =>  'Wed, 30 Nov 2011 18:13:44 GMT',
>      'client-ssl-cert-issuer' =>  '/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure Certification Authority/serialNumber=07969287',
>      'client-ssl-cipher' =>  'DHE-RSA-AES256-SHA',
>      'client-peer' =>  '192.149.252.16:443',
>      'content-length' =>  '318',
>      'client-date' =>  'Wed, 30 Nov 2011 18:12:45 GMT',
>      'client-ssl-warning' =>  'Peer certificate not verified',
>      'content-type' =>  'text/html; charset=iso-8859-1',
>      'client-ssl-cert-subject' =>  '/O=*.arin.net/OU=Domain Control Validated/CN=*.arin.net',
>      'title' =>  '403 Forbidden'
>    }, 'HTTP::Headers' ),
>    '_msg' =>  'Forbidden',
>    '_request' =>  bless( {
>      '_content' =>  '<customer xmlns="http://www.arin.net/regrws/core/v1"><customerName>Test Customer</customerName><iso3166-1><name>UNITED STATES</name><code2>US</code2><code3>USA</code3><e164>1</e164></iso3166-1><streetAddress><line number = "1">123 Test Ave</line></streetAddress><city>Testville</city><iso3166-2>Mo</iso3166-2><postalCode>12345</postalCode><comment><line number = "1">This is a test customer</line></comment><parentOrgHandle>CC04</parentOrgHandle><privateCustomer>false</privateCustomer></customer>',
>      '_uri' =>  bless( do{\(my $o = 'https://rest-beta.arin.net/rest/net/[network id]/customer?apikey=[api key]')}, 'URI::https' ),
>      '_headers' =>  bless( {
>        'user-agent' =>  [in house middleware system],
>        'content-type' =>  'text/xml',
>        'accept' =>  'text/xml',
>        'content-length' =>  497,
>        'authorization' =>  'Basic cmVzdC1iZXRhLmFyaW4ubmV0L3Jlc3Q6cmVzdC1iZXRhLmFyaW4ubmV0L3Jlc3Q='
>      }, 'HTTP::Headers' ),
>      '_method' =>  'POST',
>      '_uri_canonical' =>  $VAR1->{'_request'}{'_uri'}
>    }, 'HTTP::Request' )
> }, 'HTTP::Response' );
> 403Force to success: 0 is success:
> this is a rest request
> $VAR1 = '<status>failure</status>';
> Results
> $VAR1 = 'failure';
>
>
> Thanks,
> David
> _______________________________________________
> arin-tech-discuss mailing list
> arin-tech-discuss at arin.net
> http://lists.arin.net/mailman/listinfo/arin-tech-discuss
_______________________________________________
arin-tech-discuss mailing list
arin-tech-discuss at arin.net
http://lists.arin.net/mailman/listinfo/arin-tech-discuss



More information about the arin-tech-discuss mailing list