magento access denied
Asked Answered
A

5

8

I have installed Magento 1.7.0.2 on Ubuntu 12.0.4 server and everything works.

Testing REST API with an admin role (http://1.2.3.4/magento/api/rest/products) I get this result:

<magento_api>
  <messages>
    <error>
      <data_item>
      <code>403</code>
        <message>Access denied</message>
      </data_item>
    </error>
  </messages>
</magento_api>

I have created an admin role grant all access on all and the token authentication procedure was ok.

I've tried with magento go service, Bitnami VM and Windows installer but seems that web services are not present (I can see only user/role under Web Services).

Did you know of a magento setup with REST API working?

How can I debug this kind of error? I have tried with different REST client.

Thanks!

Accusatory answered 24/9, 2012 at 15:13 Comment(2)
hi, did you resolved this one? I'm having the same problem. I was checking and Magento is calculating the wrong signature for POST. If you check /app/code/core/mage/oauth/model/server.php line 535. $this->_params that are put in signing function include signature sent by client what is - by my understanding a bug?Bases
I had the same issue but I was trying to access Admin functionalities with the example of Customer login. So it failed of course. Here is the good way to do it if you want to access with the admin permission magentocommerce.com/api/rest/authentication/…Submultiple
C
3

Did you set permissions for roles and attributes? If not check do it first magentocommerce.com/api/rest/permission_settings/

Carbine answered 11/4, 2013 at 11:27 Comment(1)
Good link at magentocommerce.com/api/rest/permission_settings/…Submultiple
M
1

I have once tested REST API for magento..

I following blogs helped me to setup the REST Api

1.first

2.second

3.third

I used RESTClient addon for firefox for testing and be sure that Oauth is enabled at server.

Mottle answered 17/11, 2012 at 9:29 Comment(0)
D
0

Check the below post.This may be helpful to you.

Oauth rest api

and also

Get product using admin user.

Disjoined answered 2/3, 2013 at 6:33 Comment(1)
Can you help me regard rest api customer getting error : snag.gy/MVINwS.jpg @BharatSupervisory
T
0

Thanks to chanz up there, I found the solution to my own issue.

It doesn’t seem to accept the OAuth parameters as query string parameters. I tried sending them as HTTP headers instead and it’s going through.

source: http://www.aschroder.com/2012/04/introduction-to-the-magento-rest-apis-with-oauth-in-version-1-7/comment-page-1/#comment-5090

Surely, make sure you have the right settings at System > Web Services > Web Roles and System > Web Services > Web Attributes.

It is also helpful to use the Ruby oAuth library because "it’s clean, simple and works well". See post there.

Tega answered 26/5, 2014 at 2:4 Comment(0)
U
-2

You should try these for this problem in api:-

1)change the value in the file /app/code/core/Mage/Api2/Model/Auth.php, change the value of: DEFAULT_USER_TYPE = 'guest' to DEFAULT_USER_TYPE = 'admin'.

2)change the value in the file /app/code/core/Mage/Api2/Model/Auth/Adapter.php, change this line from return (object) array('type' => Mage_Api2_Model_Auth::DEFAULT_USER_TYPE, 'id' => null); to this: return (object) array('type' => Mage_Api2_Model_Auth::DEFAULT_USER_TYPE, 'id' => '1'); (note:only change null to '1').

3)restart your server(for apache run this command: sudo service apache2 restart). i hope these steps will solve your 403 access denied problem.

Unusual answered 30/4, 2016 at 8:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.