Note that there are some explanatory texts on larger screens.

plurals
  1. POCakePHP 2 Hashing Changing Over Time?
    primarykey
    data
    text
    <p>I am making a CakePHP 2.2.3 application that needs to depend on another existing application for its login information. The username/password combinations exist on another database/server, and I've set up my CakePHP app to create new users upon them logging into my interface for the first time. Here's the process:</p> <ol> <li>User Logs in for the first time, supplies username &amp; password. CakePHP user record does not exist yet</li> <li>System checks to see if a user with the same (sanitized) username exists on the other side</li> <li>If a user does exist, then we fetch the password and compare the passwords to see if they match.</li> <li>If the passwords match, hash what's been provided and save the user record</li> <li>Log in the newly created user</li> </ol> <p>This solves a few problems for us, chiefly having multiple places for the user to log in to do certain things.</p> <p>My problem appears to be that the value CakePHP gets when it hashes the passwords seems to change over time. So instead of logging the user in with their password, it creates a new user record every next day they log in. I experienced an issue where I couldn't log in with a particular user yesterday... so I checked to see what the login() action saw as the hashed value of the password was. </p> <p>The particular user's password is 'roads'</p> <p>Yesterday, the hash was: <strong>988042d7f4e62760238d895472ecaf1844094f9f</strong></p> <p>Today, when I hash roads I get: <strong>a8318e7bbe8ee5efc59f53b4ede4d80dc0495c6d</strong></p> <p>I really have no idea where to start looking to see why this would occur. For purposes of getting my development moving forward all I can do is change the hashed value of the password for the user record I want to log in as. This is the second day I'll have done this. Is there anything I could have done wrong with the Security hash or salt value in the config/core.php?</p> <p>I would love to either:</p> <ol> <li>Figure out why the hashes are changing</li> <li>Change the Auth component to use the other database to log users in</li> </ol> <p>But I'm not sure where to start on either of those</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload