Skip to content
forked from 1wilkens/pam

Safe Rust bindings to Linux Pluggable Authentication Modules (PAM)

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

klemens/pam-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pam-auth Version License Build Status

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

Documentation @ docs.rs

Supported Rust versions

Currently builds against Rust 1.5.0 stable and above.

Note about stability

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.

Usage

  1. Add pam-auth to your Cargo.toml:
[dependencies]
pam-auth = "0.5.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).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 =/");
        }
}

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

License

Licensed under either of

at your option.

Contribution

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.

About

Safe Rust bindings to Linux Pluggable Authentication Modules (PAM)

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%