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 i
As bas_van_poppel said, by adding the form key to the appropiate phtml, you get rid of the redirect to the regular login page.
In order to avoid the redirection to the dashboard page and get redirected to your app, you need to remove the call to setAfterAuthUrl
in the _initForm
method on app/code/core/Mage/Oauth/controllers/AuthorizeController.php
:
/** @var $helper Mage_Core_Helper_Url */
$helper = Mage::helper('core/url');
$session // We don't want this: ->setAfterAuthUrl(Mage::getUrl('customer/account/login', array('_nosid' => true)))
->setBeforeAuthUrl($helper->getCurrentUrl());
After a successful login, Magento redirects the customer to the after_auth_url value in the customer session, if the value is not specified, it will redirect you to the value of before_auth_url.
This is just for illustrative purposes, you should follow best practices to override this core controller.