Magento的REST API客户不重定向到认证页面 [英] Magento API REST customer not redirecting to Authentication Page
问题描述
我通过客户的账户试图接入产品。要做到这一点,我使用的样品code从 oauth_customer.php Magento的文档页。 一切都很好,而且做工精细;但我面对的事情是,每当我登录为客户成功后的登录页面重定向到客户仪表板,而不是重定向到验证URL。
手动再这样做,所以我要过去的URL链接,所以它重定向到认证页面,验证后它表明我想做的事情。
我也试图账户控制器从链接样本code扩展:
https://docs.google.com/file/d/0BzCDl5a0zmSVdWdFMG9jMTB1TXM/edit ?PLI = 1
但仍然没有运气。反正是有登录后再次进行回调URL就像我们在admin认证方呢?
I am trying to access products through Customer account. To achieve this I am using sample code from oauth_customer.php magento documentation page.
Everything is okay and working fine; but the thing I am facing is that whenever I login as customer after successful login page redirects to the Customer Dashboard instead of redirecting to the Authentication URL.
To do so I have to past the URL link again manually, so it redirects to the Authentication page and after authentication it shows whatever I want.
I have also tried to extend the account controller from a sample code from link:
https://docs.google.com/file/d/0BzCDl5a0zmSVdWdFMG9jMTB1TXM/edit?pli=1
But still there is no luck. Is there anyway to make a callback URL again after login like we do in admin authentication side?
推荐答案
在使用OAuth,OAuth用户端登录表单重定向到客户/帐号/ loginPost。
When using Oauth, the oauth consumer login form redirects to customer/account/loginPost.
该loginPost功能重定向到客户/帐号/登录因为参数formkey丢失。
The loginPost function redirects you to customer/account/login because the parameter formkey is missing.
就在应用程序/设计/前端/包/主题/模板添加此/ OAuth的/在授权表单标签的末尾/表格/ login.phtml:
Just add this in app/design/frontend/package/theme/template/oauth/authorize/form/login.phtml at the end of the form tag:
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
当您添加此重定向将正常工作。经测试,在Magento的CE 1.9.0.0,EE 1.14.1.x
Redirect will work fine when you add this. Tested in Magento CE 1.9.0.0, EE 1.14.1.x
这篇关于Magento的REST API客户不重定向到认证页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!