PDA

View Full Version : Authorisation Failure


sjmassey
23-11-09, 18:48
Hi

I am trying to use the productservice api v3, and failing at authorization.

I have tried two clients.

First I am using Java and soap with axis2. Form looking at the log output, the soap message has the correct soap-headers and the correct api key in the user-authentication section. But the the response from the server is authorisation failure.

Just to make sure I did not make an error in my code I tried the example php code. I changed the variable API_KEY, to the apikey, i.e. this line of the file constants.inc.php
define('API_KEY', '--apikey--');

But this results in the same error. A look at the soap trace also shows that the soap message is correct.

So it seems that everything codewise is correct. I have tried reseting the api-key through the affiliate window interface, but a new api-key also results in an authorisation failure.

I am trying figure out the cause of this

1. This is on a Test account. I registered sometime ago and did not use it for a while, so maybe it got inactive somehow, but still shows as active on the affiliate window screen. I did create a ticket for this, but was told that how to edit the constants.inc.php, even though the log showed that i had done so. So no help there.

2. Does the shopwindow server check the hostname to valid the request? I am testing the code from a development box locally.

Thanks for any help.

sjmassey
23-11-09, 22:09
Here's the trace (I have replaced the actual apikey with xxxxx... in this post)

<pre><?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://v3.core.com.productserve.com/" xmlns:ns2="http://api.productserve.com/">
<SOAP-ENV:Header>
<ns2:UserAuthentication SOAP-ENV:mustUnderstand="1" SOAP-ENV:actor="http://api.productserve.com/">
<sApiKey>xxxxxxxxxxxxxxxxxxxxxxxxxxx</sApiKey>
</ns2:UserAuthentication>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:getProduct>
<iProductId>25654634</iProductId>
<iProductId>4662114</iProductId>
<iProductId>7154706</iProductId>
</ns1:getProduct>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://v3.core.com.productserve.com/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>ns1:Client.AUTH_2</faultcode>
<faultstring>Authentication Failed</faultstring>
<faultactor>http://v3.core.com.productserve.com/</faultactor>
<detail>
<ns1:ApiException>
<message>Invalid API Key or account disabled</message>
</ns1:ApiException>

</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
SoapError Object
(
[sCode] => ns1:Client.AUTH_2
[sString] => Authentication Failed
[sDetails] => getProduct: Invalid API Key or account disabled
)
</pre>

sjmassey
24-11-09, 12:14
I am getting the same error with the shopwindow client software installed on the webserver. The api-key was preset in the php file when I downloaded, so there is no chance of a typo there. So I definitively do think there is a problem server side, since this is now shopwindow code being used.

GeorgeGaz
24-11-09, 13:08
Hello sjmassey,

We have isolated the problem that is occurring and we are going to double check with the ShopWindow team to see if they have had any intervention that has caused this error.

Have you spoken with the ShopWindow team at any point in the past?

Regards

sjmassey
24-11-09, 21:06
I have not spoken to the ShopWindow staff directly, but with support on Afilliate Window. I am not sure if they are same.

After intially replying that it was a code issue, I convinced them it was not, by installing the ShopWindow client on my webserver. After further investigation they found that the shopwindow account had indeed been shutdown.

So hopefully it will be resolved soon.

Cheers

sjmassey
25-11-09, 12:28
Resolved now.

Thx