• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

Magento的REST API客户不重定向到认证页面

用户头像
it1352
帮助1

问题说明

我通过客户的账户试图接入产品。要做到这一点,我使用的样品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?

正确答案

#1

在使用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
系列文章
更多 icon
同类精品
更多 icon
继续加载