I am trying to customer login programatically for REST API with below script, but it always shows "Invalid login or password" but actually those are working from controller or login through website

$session = Mage::getSingleton('customer/session')->setCustomerAsLoggedIn($customer);
     $status = $session->login($data['email'],$data['pwd']);

Is there any way to customer login check


I use loginById() in my code for this purpose:

 $customer = Mage::getModel('customer/customer');

Hope it helps.

| improve this answer | |
  • I am getting email and password through REST API , we cant provide directly login. i should verify the user name & password – Ramesh Jan 11 '17 at 5:44

I got the solution for that,

$status = Mage::getModel('customer/customer')->setWebsiteId('1')->authenticate($email, $password);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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