Not able to get OAuth token for Magento Rest Client on OS X

南笙酒味 提交于 2020-01-05 08:21:13

问题


I am using Magento version 1.9.1.0 and trying to use Magento Rest APIs using OAuth Integration. I have consumer key and consumer secret. Now want to get OAuth token for Rest APIs usage. I have followed http://www.magentocommerce.com/api/rest/authentication/oauth_authentication.html

In this , we needed oauth_signature and timestamp which we doesn't get when we create consumer on admin panel . Now how can we get OAuth token with only consumer key and consumer secret ?


回答1:


I think you should follow Inchoo blog http://inchoo.net/magento/consuming-magento-rest-zend_oauth_consumer/. Hope you will get some idea.




回答2:


The following parameters are required to oauth initiate process :

realm="",
 oauth_version="1.0",//oauth version
 oauth_signature_method="PLAINTEXT",
 oauth_nonce="oklThLFvQkxNUpf",//a random unique value
 oauth_timestamp="1426745444", //current time stamp
 oauth_consumer_key="37d05fa37aea5513d4cda24c0b1f3e00",//get from admin 'key'
 oauth_signature="a183969724b3068b7b0d70e7ce9d0f09%26",//a random unique string
oauth_callback="http%3A%2F%2Flocalhost%3A8888" // your call back method

The initiate url will be like => http://yourdomain/oauth/initiate

I also attached two snap for your help.




回答3:


please check that .htaccess file rewrite

RewriteRule ^api/rest api.php?type=rest [QSA,L]

takes effect.

Check you use Apache (not nginx or other Webserver that doesn't support .htaccess)



来源:https://stackoverflow.com/questions/29098688/not-able-to-get-oauth-token-for-magento-rest-client-on-os-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!