Merge branch 'issue-2672-password-hash-list' into 'v2.0'
DBI password hash list See merge request lemonldap-ng/lemonldap-ng!245
This commit is contained in:
commit
23fe6d3481
|
@ -38,12 +38,8 @@ LL::NG can use two tables:
|
|||
|
||||
Authentication table and user table can be the same.
|
||||
|
||||
The password can be in plain text, or encoded with a standard SQL
|
||||
method:
|
||||
|
||||
- SHA
|
||||
- SHA1
|
||||
- MD5
|
||||
The password can be in plain text, or encoded with a SQL method (for example
|
||||
``SHA``, ``SHA1``, ``MD5`` or any method valid on database side).
|
||||
|
||||
Example 1: two tables
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -159,7 +155,8 @@ Password
|
|||
~~~~~~~~
|
||||
|
||||
- **Hash schema**: SQL method for hashing password. Can be left blank
|
||||
for plain text passwords.
|
||||
for plain text passwords. The method will be forced to uppercase in
|
||||
SQL statement.
|
||||
- **Dynamic hash activation**: Activate dynamic hashing. With dynamic
|
||||
hashing, the hash scheme is recovered from the user password in the
|
||||
database during authentication.
|
||||
|
|
|
@ -12,7 +12,7 @@ use Mouse;
|
|||
|
||||
extends 'Lemonldap::NG::Common::Module';
|
||||
|
||||
our $VERSION = '2.0.0';
|
||||
our $VERSION = '2.0.14';
|
||||
|
||||
# PROPERTIES
|
||||
|
||||
|
@ -91,16 +91,14 @@ sub init {
|
|||
# @return SQL statement string
|
||||
sub hash_password {
|
||||
my ( $self, $password, $hash ) = @_;
|
||||
if ( $hash =~ /^(md5|sha|sha1|encrypt)$/i ) {
|
||||
if ($hash) {
|
||||
$self->logger->debug( "Using " . uc($hash) . " to hash password" );
|
||||
return uc($hash) . "($password)";
|
||||
}
|
||||
else {
|
||||
$self->logger->notice(
|
||||
"No valid password hash, using clear text for password");
|
||||
$self->logger->debug("No password hash, using clear text for password");
|
||||
return $password;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Return hashed password for use in SQL SELECT statement
|
||||
|
|
Loading…
Reference in New Issue
Block a user