Added a way to create the admin account linked to the PAM backend password authentication. ref #65

This commit is contained in:
emeric
2020-07-07 10:54:40 +02:00
parent 0623df3dae
commit 100d0f55a5
10 changed files with 160 additions and 31 deletions
+1
View File
@@ -81,6 +81,7 @@ checkUserPassword(Database::Session& session, const std::string& loginName, cons
{
case Database::User::AuthMode::Internal:
{
LMS_LOG(AUTH, DEBUG) << "Checking internal password for user '" << loginName << "'";
const Wt::Auth::BCryptHashFunction hashFunc {6}; // TODO parametrize this
return hashFunc.verify(password, passwordHash.salt, passwordHash.hash);
}
+1
View File
@@ -164,6 +164,7 @@ checkUserPassword(const std::string& loginName, const std::string& password)
{
try
{
LMS_LOG(AUTH, DEBUG) << "Checking PAM password for user '" << loginName << "'";
PAMContext pamContext {loginName};
pamContext.authenticate(password);