Safe Rust bindings to Linux Pluggable Authentication Modules (PAM). Currently only supports basic username/password authentication.
Currently builds against Rust 1.5.0 stable and above.
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:
toml
[dependencies]
pam-auth = "0.4.0"
Use the Authenticator
struct to authenticate and open a session
```rust
extern crate pam_auth;
pub fn main() {
let service = "
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.