Magento的REST API客户不重定向到认证页面
问题说明
我通过客户的账户试图接入产品。要做到这一点,我使用的样品code从 oauth_customer.php Magento的文档页。 一切都很好,而且做工精细;但我面对的事情是,每当我登录为客户成功后的登录页面重定向到客户仪表板,而不是重定向到验证URL。
手动再这样做,所以我要过去的URL链接,所以它重定向到认证页面,验证后它表明我想做的事情。
我也试图账户控制器从链接样本code扩展:
https://docs.谷歌.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.谷歌.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
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfgiic
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20