- 🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU
Please give more information about your Drupal installation, so I can investigate whether I want to do something about this vs. the other contrib/custom code that you have, should fix things.
Your SQL error shows a failing attempt to insert a recored in the
user_pass
table. Drupal Core has nouser_pass
table. So we need to know where that table comes from / what is using it. - 🇧🇪Belgium kriboogh
Hi, yes, indeed this is our simple_password_policy module doing that. We hook into user_insert and user_update and save the existing
password hash into a table for lookup later (can't re-use the last x passwords).pseudo code:
hook_user_insert($user) {
...
$pass = $user->getPassword(); => this returns empty value.
...
}I think the reason is that in in SamlAuth service, ExternalAuth::register is called with
$account_data = ['name' => '...'];
which only contains a name and not containing a password.
Maybe a random password can be generated when the user is created ?
$account_data = ['name' => '...', 'pass' => '???']; - Status changed to Closed: works as designed
over 1 year ago 9:53am 21 August 2023 - 🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU
Rather than make samlauth accommodate simple_password_policy, simple_password_policy should IMHO accommodate the fact that passwordless users are a thing that exists in Drupal and is legal.
- Make PasswordPolicy::store() issue a DELETE instead of an INSERT/UPDATE if $user->getPassword() is empty. (The DELETE would also accommodate cases where $old_password is nonempty - which is very unlikely but it's not hard to implement just in case.)
- Make PasswordPolicy::applyPolicy() always return FALSE if $user->getPassword() is empty. After all, you don't want people to be issued warnings of passwords they don't have... which generating a random password would do.