Crate humphrey_auth[−][src]
Expand description
Authentication support for Humphrey.
Web applications commonly need a way of authenticating users. This crate provides an easy and secure way to do this, integrating with Humphrey using the AuthApp
trait and allowing complete control over the database users are stored in. Humphrey Auth does not come with a database, but the AuthDatabase
trait is implemented for Vec<User>
to get started. For a production use, you should use a proper database and implement the AuthDatabase
trait for it.
Note: unlike the other crates in the Humphrey ecosystem, Humphrey Auth does require some dependencies, since fully-secure implementations of several complex cryptographic algorithms are required.
Features
- Configurable and secure authentication using the Argon2 algorithm, provided by the
argon2
crate. - Flexible user storage, allowing the use of any database by simply implementing a trait.
- Session and token management with a simple API.
Installation
The Humphrey Auth crate can be installed by adding humphrey_auth
to your dependencies in your Cargo.toml
file.
Documentation
The Humphrey Auth documentation can be found at docs.rs.
Example
A basic example of username/password authentication can be found here.
Modules
Structs
Represents an authentication provider. Contains a database of users and provides methods for managing authentication.