Magento Rest API Oauth URL Return 404

From the wiki Magento:

http://www.magentocommerce.com/api/rest/authentication/oauth_authentication.html#OAuthAuthentication-OAuthProcess

When receiving an API token, you start by receiving an unauthorized request token at:

www.mystore.com/oauth/initiate

However, my code does not work, and when I look at the above URL in my browser, I get 404.

I am adding the store’s store code to the base URL (e.g. www.mystore.com/en/). I do not know if this is changing anything.

+4
source share
5 answers

Magento Wiki has a typo:

$adminAuthorizationUrl = 'http://yourhost/admin/oAuth_authorize'; 

Must be:

 $adminAuthorizationUrl = 'http://yourhost/admin/oAuth_authorize'; 
+12
source

I had the same problem. There are not many similar problems to find and not solve. This is strange because it seems to be the missing configuration option "global / request / direct_front_name" that is not installed in the Core / Oauth module. How can all tutorials work without this important setup ??

Without setting "oauth", each call to / oauth / [controller] results in a resolution of "noRouteAction" (Mage_Core_Controller_Request_Http :: setPathInfo () and Mage_Core_Controller_Request_Http :: isDirectAccessFrontendName ($ storeCode)) instead of the default indexAction index.

So, the solution is to set this parameter in local configuration or in your own extension as follows

 <?xml version="1.0"?> <config> [...] <global> [...] <request> [...] <direct_front_name> <oauth/> </direct_front_name> </request> </global> </config> 

Later you can finally get a marker. Now I check the further process.

+4
source

I struggled with this for most of the day, so here is a late contribution in case it helps anyone:

The authorization URL documented by Magento, admin / oauth_authorize, assumes that you are not using a custom URL for administrator access. "admin" is the standard URL for accessing the Magento panel, but many people change it for security. If you changed your admin address to something other than "admin", use this instead.

IOW, if you go to the Magento dashboard at https://yoursite.com/foo , your authorization URL will be foo / oauth_authorize.

+3
source

I also had a problem that the following request returned the status of http: 404:

 http://yourmagentostore.com/oauth/initiate 

The solution was quite simple: if you use several stores and / or save submissions in the same domain, be sure to add the URL that appears as a store. For instance.

 http://yourmagentostore.com/<my-store-view-path>/oauth/initiate 
+2
source

There is one subtlety, do not forget http: //, so your call in the store should be

http://yourmagentostore.com/oauth/initiate

There are also more settings for REST services, and then the link you posted is just an overview. There is a ton of configuration in the store before you really get a rest response, and when a user is not recognized, authorized or has proper ACL privileges, you will receive 404 or 500 responses. I suppose that holds back hackers, but it's a bear to handle the shoots. I have been along this path, and although I am using an automation tool, storage configuration and troubleshooting are the same.

Take a look at my blog. I am constantly updating my adventures with the Magento REST API. Hooray!
Rich borek
http://magento-simplified.blogspot.com

0
source

All Articles