Crates.io | pam-auth |
lib.rs | pam-auth |
version | 0.6.0 |
source | src |
created_at | 2015-03-25 14:55:11.462205 |
updated_at | 2019-02-07 21:48:20.556032 |
description | [MOVED TO `pam`] Safe Rust wrapper for PAM authentification |
homepage | |
repository | https://github.com/1wilkens/pam-auth/tree/deprecated/README.md |
max_upload_size | |
id | 1718 |
size | 20,924 |
pam
]pam-auth
is deprecated and was renamed to pam
.
Please use the new crate for any future projects and consider switching if you still use this crate.
Safe Rust bindings to Linux Pluggable Authentication Modules (PAM). Currently only supports basic username/password authentication.
Environment support through the env
module is probably broken and should not be used in the current state!
The library is only continuously built against Rust stable, beta and nightly but as it does not use a lot of new language features it should probably compile on older versions as well. If you encounter problems building on older versions and a small fix can be applied to make the build succeed, consider opening a pull request.
This crate follows semantic versioning. As such all versions below 1.0.0
should be
considered development versions. This means the API could change any time.
pam-auth
to your Cargo.toml:[dependencies]
pam-auth = "0.5.0"
Authenticator
struct to authenticate and open a sessionextern crate pam_auth;
pub fn main() {
let service = "<yourapp>";
let user = "<user>";
let password = "<pass>";
let mut auth = pam_auth::Authenticator::new(service).unwrap();
auth.set_credentials(user, password);
if auth.authenticate().is_ok() && auth.open_session().is_ok() {
println!("Successfully opened a session!");
}
else {
println!("Authentication failed =/");
}
}
Authenticator
structconv
does not leak memoryconv
functions to be passed (in pam-sys?)Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.