tinhyeuphonui Posted March 17, 2018 Share Posted March 17, 2018 Hi all, I use webservice in react native i have a problem : Login customer via webservice with filter email and password,I do not know how to encrypt passwords. Example : + http://domain.com/api/customers?filter[email protected]&ws_key=xxxxx&output_format=JSON --> webservice return information customer + http://domain.com/api/customers?filter[email]=xxxx&filter[passwd]=xxx&ws_key=xxx&output_format=JSON --> webservice return empty. Thanks Link to comment Share on other sites More sharing options...
tinhyeuphonui Posted March 19, 2018 Author Share Posted March 19, 2018 2 minutes ago, ndiaga said: Hi, You need to encrypt passwords before sending them in URL . Here is an example: /** @var \PrestaShop\PrestaShop\Core\Crypto\Hashing $crypto */ $crypto = ServiceLocator::get('\\PrestaShop\\PrestaShop\\Core\\Crypto\\Hashing'); if ($this->id == 0 || $this->passwd != $passwd) { $this->passwd = $crypto->hash($passwd); } Thanks for your feedback. But i used this way. encrypt passwords is : $2y$10$mYmuptbrwNT3qBTucHbN3e3JhBel/jP3XAHq8eaWxxxxx then i used webservice --> reponse null. (sorry my english not good). Important, i using react native and customer information to login and register should encrypt the password as the above example is impossible. Link to comment Share on other sites More sharing options...
tinhyeuphonui Posted March 19, 2018 Author Share Posted March 19, 2018 1 hour ago, ndiaga said: You can use PrestaShop build in fonctions for Post and Get. The password should encrypted in all cases. I don't know rules in react but in PHP it works. Thanks you very much !! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now