Add support for LDAP cn=...+totptoken=.. support

This commit is contained in:
Johannes Zellner
2022-08-02 14:02:35 +02:00
parent afc70ac332
commit a2a60ff426
4 changed files with 53 additions and 7 deletions

View File

@@ -356,7 +356,9 @@ async function verify(userId, password, identifier) {
}
if (user.source === 'ldap') {
await externalLdap.verifyPassword(user, password);
const ldapUser = await externalLdap.verifyPassword(user, password);
// currently we store twoFactorAuthenticationEnabled in the db as local so amend it to user object
user.twoFactorAuthenticationEnabled = !!ldapUser.twoFactorAuthenticationEnabled;
} else {
const saltBinary = Buffer.from(user.salt, 'hex');
const [error, derivedKey] = await safe(pbkdf2Async(password, saltBinary, CRYPTO_ITERATIONS, CRYPTO_KEY_LENGTH, CRYPTO_DIGEST));