pam-auth 0.2.1

Safe Rust wrapper for PAM authentification
docs.rs failed to build pam-auth-0.2.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: pam-auth-0.5.5

pam-auth Version Build Status

Safe Rust bindings to Linux Pluggable Authentication Modules (PAM). Currently only supports basic username/password authentication.

Documentation @ gh-pages

Usage

  1. Add pam-auth to your Cargo.toml:
[dependencies]
pam-auth = "0.2.0"
  1. Use the Authenticator struct to authenticate and open a session
extern crate pam_auth;
pub fn main() {
        let service: "<yourapp>";
        let user: "<user>";
        let password: "<pass>";

        let mut auth = pam_auth::Authenticator::new(service);
        auth.set_credentials(user, password);
        if auth.authenticate().is_ok() && auth.open_session().is_ok() {
            println!("Successfully opened a session!");
        }
        else {
            println!("Authentication failed =/");
        }
}

TODO:

  • Implement basic user/password authentication
  • Add Authenticator struct
  • Add documentation
  • Verify current conv does not leak memory
  • Allow custom conv functions to be passed (in pam-sys?)
  • Code cleanup