implement auth framework

This commit is contained in:
Dietmar Maurer
2020-04-08 11:57:14 +02:00
parent 579728c641
commit 7d817b0358
4 changed files with 178 additions and 12 deletions

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(