So I'm trying to make a SPA that uses Magento 1.9.2.2 as its back office. To do this, I would like to use its REST API. And of course, it forces you to OAuth with Magento first. I have tried multiple ways to OAuth with it on the client, my own way which works fine with any of the popular OAuth1.0a services like Twitter and LinkedIn, I've also tried using this https://github.com/ddo/oauth-1.0a which also works with things that don't constantly break, cough magento cough. The issue I have is that I get back a 401 status saying signature invalid. This is the gist of it using the module:
var oauth = OAuth({
consumer: {
public: 'a604a470aaff57d6063800aef713a12a',
secret: 'ecdbb5cb43c9299ab3372ad973792d47'
},
signature_method: 'HMAC-SHA1'
});
var reqData = {
url: '/oauth/initiate',
method: 'POST',
data: {
oauth_callback: 'https://172.22.22.24/oauth/authorize'
}
};
var authData = oauth.authorize(reqData);
$.ajax({
url: reqData.url,
type: reqData.method,
data: authData,
success: function(data){
console.log(data);
}
});
So if I were to reconfigure this for any other OAuth1.0a service, it works fine. Wh would it be that magento does not? Additionally, I have gone through all the Admin configuration for Authing with REST