2

Basically I have a Magento installation that an external company is filling with customers as they sign up for their external customer portal using an API.

When a user is logged into this companies portal they want them to be able to click a link and be sent to this magento installation and automatically logged in.

I am not very experienced with API's etc and have read about OAuth but can't find instructions on what to do!

I just would like to know how I can get magento to automatically log them in when they click the link on the exernal site.

1 Answer 1

1

There are multiple ways of achieving something like this, but I don't think OAuth is a necessary component.

Here's one idea. It assumes that the external system can be customized to some degree. It also assumes that there is some sort of mapping between Magento's customer IDs and the external system's customer IDs.

When the customer clicks on "Log into Magento" from the external system, they're taken to another page on the external system. This page generates a unique, one-time-use token, and redirects the customer to a page on Magento, passing along the customer's ID and the token. The Magento page then makes a server-side call (using cURL, etc.) back to the external system, passing back the customer's ID and the token. The external system then validates the customer ID and the token, and if they match, returns a positive response. If Magento receives a positive response from the external system, it proceeds to log in the customer (using something like Mage_Customer_Model_Session::setCustomerAsLoggedIn(), for example).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.