Search code examples
prestashopprestashop-1.7

Prestashop 1.7 webservice login customer


How to can I login customer via webservice in Prestashop 1.7

In Prestashop 1.6(In 1.7 not working):

    define('_COOKIE_KEY_', 'OXFQDX3YYM8MJH1RYGAQHH2LX79ZNRX');
    $md5_password = md5(_COOKIE_KEY_+password);

http://yourdomainname.com/api/customers/ ?filter[email]=user@yourdomainname.com &filter[passwd]=$md5_password


Solution

  • My solution:

    check password with PHP:

    1) Get customer by email:

    http://domain.com/api/customers?filter[email]=customer@domain.com

    2) verify "passwd":

    password_verify(the_input_password, passwd);

    PASSWORD_VERIFY DOCS:

    http://php.net/manual/es/function.password-verify.php