Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor password handling #77

Merged
merged 21 commits into from Oct 19, 2015
Merged

refactor password handling #77

merged 21 commits into from Oct 19, 2015

Conversation

glensc
Copy link
Member

@glensc glensc commented Oct 16, 2015

uses password_hash family functions by default.
compatibility library for older php versions is included

new passwords are set using new algorithm, existing hashes will be verified using old methods.
auto migration of hash on successful login and hash upgrade can be added in later releases.

also added old password prompt when changing password and trivial check such as new and old passwords differ (auth backend said false anyway for such password change)

also includes sql patch to clear password for accounts where empty password was stored for whatever reason.

for older php versions, use ircmaxell/password-compat library
simple "passwords do not match" is ui logic.
also seems password mismatch error code was not even handled.
there's another method in Auth::updatePassword, which uses auth backends
use Auth::updatePassword to update password
more clearer this way that it is user password
this is to avoid writing empty passwords to database
http://php.net/manual/en/function.password-hash.php

PASSWORD_DEFAULT - Use the bcrypt algorithm (default as of PHP 5.5.0).

Note that this constant is designed to change over time as new and
stronger algorithms are added to PHP. For that reason, the length of the
result from using this identifier can change over time. Therefore, it is
recommended to store the result in a database column that can expand
beyond 60 characters (255 characters would be a good choice).
@glensc glensc added this to the 3.0.4 milestone Oct 16, 2015
@glensc
Copy link
Member Author

glensc commented Oct 16, 2015

this is ready for merge

glensc added a commit that referenced this pull request Oct 19, 2015
@glensc glensc merged commit 08c2113 into eventum:master Oct 19, 2015
@glensc glensc deleted the password_hash branch October 19, 2015 17:47
glensc added a commit that referenced this pull request Oct 19, 2015
glensc added a commit that referenced this pull request Oct 19, 2015
you should never index password column, i.e make select where password
(or even hash of it) is in WHERE statement. should always compare it
client side.
@glensc glensc mentioned this pull request Jan 16, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

1 participant