I try to authenticate against a magento server (1.7.0.2) REST API using OAuth. I am using the java scribe api. But I got always a http error 401 'signature_invalid'. This is the complete debug information from scribe:
obtaining request token from http://myhost.local:11180/magento/index.php/oauth/initiate
setting oauth_callback to oob
generating signature...
using base64 encoder: DatatypeConverter
base string is: POST&http%3A%2F%2Fmyhost.local%3A11180%2Fmagento%2Findex.php%2Foauth%2Finitiate&oauth_callback%3Doob%26oauth_consumer_key%3D77gqhzp35ka9euqqczn5sgr5s5ayeylx%26oauth_nonce%3D2377064468%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1407597421%26oauth_version%3D1.0
signature is: fXGszEGFPnKYdLKTJLoQcrCZjps=
appended additional OAuth parameters: { oauth_callback -> oob , oauth_signature -> fXGszEGFPnKYdLKTJLoQcrCZjps= , oauth_version -> 1.0 , oauth_nonce -> 2377064468 , oauth_signature_method -> HMAC-SHA1 , oauth_consumer_key -> 77gqhzp35ka9euqqczn5sgr5s5ayeylx , oauth_timestamp -> 1407597421 }
using Http Header signature
sending request...
response status code: 401
response body: oauth_problem=signature_invalid&debug_sbs=tDohHQ22G9KAwR7Inn0CVSxpF2c=
The REST API in general works because I can receive stockitems from the URL /magento/api/rest/products
I am also able to run the same code against my local developer magento installation (1.9.0.1).
What could be the reason for this error message? On my test server I need to work with the port number 11180. Could this be the problem?