implement auth framework

This commit is contained in:
Dietmar Maurer committed 2020-04-08 14:06:15 +02:00
1 parent 579728c641
commit 7d817b0358
4 files changed
+178 -12

No files matched your search

+1 -8
View File
@@ -25,14 +25,7 @@ fn authenticate_user(username: &str, password: &str) -> Result<(), Error> {
}
}
if username == "root@pam" {
let mut auth = pam::Authenticator::with_password("proxmox-backup-auth").unwrap();
auth.get_handler().set_credentials("root", password);
auth.authenticate()?;
return Ok(());
}
bail!("inavlid credentials");
crate::auth::authenticate_user(username, password)
}
#[api(