Hi there, dear Igniters friends!.
I’m trying to set up the DX_Auth library but so far, I have not been able to login using the predefined users and roles. I followed all the instructions on its documentation to get this thing up and running, but without success. I tracked the issue through the code using some var_dump()‘s, specifically at the DX_Auth.php library class file itself, lines 859-863, and I found that the default password never matches the hashed password stored at the db. There I made this changes:
...
else
{
$password = $this->_encode($password);
$stored_hash = $row->password;
var_dump($stored_hash);
var_dump($password);
var_dump(crypt($password, $stored_hash));
// Is password matched with hash in database ?
if (crypt($password, $stored_hash) === $stored_hash)
{
// Log in user
$this->_set_session($row);
...
And when loggin in with user admin and password “hello” I got this output:
string '$1$i75.Do4.$ROPRZjZzDx/JjqeVtaJLW.' (length=34)
string 'a6e6f7a51185525833312fecb6cb00f7' (length=32)
string '$1kqZEbsJDpqM' (length=13)
I guess this got something to do with the default random password salt, which in my dx_auth.php config file looks as this (the default):
/*
|—————————————————————————————————————
| Password salt
|—————————————————————————————————————
| | You can add major salt to be hashed with password.
| For example, you can get salt from here: https://www.grc.com/passwords.htm
| | Note:
| | Keep in mind that if you change the salt value after user registered,
| user that previously registered cannot login anymore.
| */$config[‘DX_salt’] = ‘’;
I didn’t picked up any random password salt, but I was afraid of doing so because of the text inside the note in the config file:
Note:
| | Keep in mind that if you change the salt value after user registered,
| user that previously registered cannot login anymore.
Does anybody know what should I do in order to get this library running?. I have spent many hours looking for Auth libraries for CI, but I only was able to find quite few, and between them, this looks like the most complete and the one that aproximates the most to a kind of simple ACL implementation which is what I need. But this problem looks really dissapointing to me and makes me think this library is rather quite buggy. There is no other alternative?
