Password matching problem when accessing DB from an App

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
User avatar
pilandros
Veteran Member
Posts: 93
Joined: 2014-02-13 18:19

Password matching problem when accessing DB from an App

Post by pilandros » 2020-11-03 16:33

I need to access the DataBase from an App and prior to ver 5.90 I use to do the query:
" ... WHERE memberID='$user' AND passMD5='".md5($password)."' AND isApproved=1 AND isBanned=0 " and it always worked.

I can see that the new version 5.90 is using password_hash($password,PASSWORD_DEFAULT) so I am using this instead but I can not get it to run because the results are different.
The hashed password with the function does not match the one saved in the table (which was created/updated with the 5.90 version).
What am I missing?

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1167
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Password matching problem when accessing DB from an App

Post by onoehring » 2020-11-13 07:14

Hi pilandros,

can you please elaborate a little more? If the new method is indeed (and I believe you) the method AG uses, it should work (otherwise we all would probably be locked out of our applications ;-) ).
If I am correct, once a user has logged into the application his password is not MD5 anymore but sha256 - maybe that is the reason? If so, your original query might need a change.

Olaf

Post Reply