Encryptpassword() not working

Encryptpassword() not working

  

Hi,

I do not know why I am not able to login my user credential, I am using Encryptpassword() function and I am using the built-in User table in my application, it says that the password that was saved on the database and the one I inputted didn't match, though the application is under independent module 

Hi Raphael,

Is this only happening with your user? Can you try create a new user and see if same the problem happens?

Hi João,

Yes I created another user, but when i tried to use the same login credentials on the http://<server>/users/ I had successfully logged in but in my application password don't match. Though the original version is 9.0 and we've upgraded it to 10 don't know if they have different responses and I also tried that condition in a different application in the same environment, but i got the same error.

Thanks in advance. 

Solution

Hi Raphael,


To properly validate a password of an user, use ValidatePassword action instead.

You can find it in PlatformPasswordUtils extension.


First, ensure you are consuming PlatformPaswordUtils:


Then, use it as depicted in this image:


The first parameter is the password in plain text of the user you're authenticating. The second parameter is the securely hashed password it will be authenticated against. 


I hope this helps. Let me know if you still have questions.


Regards.

Solution

Miguel Pires wrote: 

Hi Raphael,


To properly validate a password of an user, use ValidatePassword action instead.

You can find it in PlatformPasswordUtils extension.


First, ensure you are consuming PlatformPaswordUtils:


Then, use it as depicted in this image:


The first parameter is the password in plain text of the user you're authenticating. The second parameter is the securely hashed password it will be authenticated against. 


I hope this helps. Let me know if you still have questions.


Regards.

Thanks Miguel This solves my problem