Part of the EllisLab Network
   
 
Help with the DX_Auth Library
Posted: 01 June 2009 06:00 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  35
Joined  10-16-2008

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?

Profile
 
 
Posted: 01 June 2009 10:28 PM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  77
Joined  04-11-2009

Daniel, I managed to get it up and running myself pretty much out of the box. In fact, I didnt mess with any password code or salt. I’m probably not going to be much help b/c I’m still a newbie myself, but I would try a fresh load of your database with the default user/pass table. And put the code you modified back to the original and go from there. If that doesnt work, I would suspect it’s something outside dx_Auth.

You may have gone down that road already, but thought I’d try to give a little guidance back since everyone else has helped me throughout the CI community.

Profile
 
 
Posted: 28 July 2009 06:05 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  185
Joined  04-11-2008

one question…
Which is the default DX Auth admin password?

 Signature 

Itexa

Profile
 
 
Posted: 11 August 2009 07:01 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  12
Joined  07-18-2009
CARP - 28 July 2009 06:05 PM

one question…
Which is the default DX Auth admin password?

this post may be a little old but…

if you get stuck with a password, just create a new user and enter the password you would like. Go to your database, copy the hashed/salted password from your “new” user into your admin row. Now the admin has the same password. Done.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120587 Total Logged-in Users: 45
Total Topics: 126624 Total Anonymous Users: 2
Total Replies: 665662 Total Guests: 406
Total Posts: 792286    
Members ( View Memberlist )