0

I tried to authorize Magento web api using OAuth. Its successfully completed in local machine. I have used OAuth extenstion.

I implemented magento2 and code-igniter on different hosts. So I want to call magento 2 rest api from codeigniter. In my localhost I implemented magento2 integration authorization successfully. And I got access token also. Below the post data in oauth/token/request

[2018-04-28 05:20:43] main.DEBUG: oauth request url {"data":"http://localhost/WC/M2_CI/store/index.php/oauth/token/request","is_exception":false} []

[2018-04-28 05:20:43] main.DEBUG: oauth request {"outh request":{"oauth_consumer_key":"pfnoibfya93hh9i0vwe4m5ciknl2vxjv","oauth_signature_method":"HMAC-SHA1","oauth_nonce":"1901491915ae404ab194899.22211097","oauth_timestamp":"1524892843","oauth_version":"1.0","oauth_signature":"nHwNX8WGHdNuMSkY7/3B0G7dl2o="},"is_exception":false} []

Then I same procedure followed in server host. I got the error that says

Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)

So That's why I debug the post data then got the following result

[2018-04-28 07:27:31] main.DEBUG: oauth rquest url {"data":[],"is_exception":false} []

[2018-04-28 07:27:31] main.DEBUG: oauth rquest {"data":[],"is_exception":false} []

Here on the getRequestToken() function call the post data not getting on the magento side. How can i solve this issue?. Thanks in advance Please share your valuable information.

  • In your local environment are you using Code Igniter as well? – quickshiftin Apr 28 '18 at 13:43
  • Yes of-course and its worked – Midlaj Apr 28 '18 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.