2016-03-26 20 views
0

我必須使用Magento Web API使用OAuth。我創建了一個使用Web面板的消費者,我擁有消費者密鑰和消費者密鑰。現在我必須找到Access令牌。所以我refered一些材料,來到運行下面的命令如何在Magento中找到oauth_verifier

oauth \ 
    --verbose \ 
    --query-string \ 
    --consumer-key c9c60d4aaf670c86acee7e93bb776e45 \ 
    --consumer-secret 0a0b845eb7507de84c63740b15561568 \ 
    --access-token-url http://localhost/magento/oauth/token \ 
    --authorize-url http://localhost/magento/oauth/authorize \ 
    --request-token-url http://localhost/magento/oauth/initiate \ 
    authorize 

響應來像

服務器似乎支持的OAuth 1.0A;支持。 請訪問這個網址授權: http://localhost/magento/oauth/authorize?oauth_token=6a57c2e2d3f9883a94bfd2087dd95a89 請輸入由SP(oauth_verifier)提供的驗證碼:

現在,我不知道在哪裏可以找到驗證碼,以及如何使用它。

幫助我通過這個,。感謝提前:)

回答

0

其返回的,當你做,因爲它要求「請訪問這個網址授權:」

你的情況 其
http://localhost/magento/oauth/authorize?oauth_token=6a57c2e2d3f9883a94bfd2087dd95a89
只是粘貼在你的瀏覽器,它應該帶您進入授權或拒絕頁面。 (現在將是無效的)

這是基於--authorize-URL

我需要管理員權限,所以我用
--authorize-URL http://www.myhost.com/ /管理/ oauth_authorize

+0

時我點擊http://www.myhost.com/admin/oauth_authorize即刻您的授權無效 –