use anyhow::Result;

use crate::pam_session::{ PresetPassword, Transaction };

pub fn authenticate( service: &str, username: &str, password: &str ) -> Result<()>
{
	let mut tx = Transaction::start(
		service,
		username,
		Box::new( PresetPassword( password.to_string() ) ),
	)?;
	tx.authenticate()
}
