Expand description
High-level http auth extractors for axum
🚨 This crate provides an alternative to TypedHeader<Authorization<..>>
which you should probably use instead. Take a look at the fantastic axum-login crate if your looking for more robust session management. I will continue to maintain this crate.
Usage
Take a look at the following structures:
- Basic auth: AuthBasic
- Bearer auth: AuthBearer
If you need to implement custom errors (i.e., status codes and messages), use these:
- Custom basic auth: AuthBasicCustom
- Custom bearer auth: AuthBearerCustom
That’s all there is to it! Check out the repository for contributing or some more documentation.
Structs
- Basic authentication extractor, containing an identifier as well as an optional password
- Bearer token extractor which contains the innards of a bearer header as a string
Traits
- Custom extractor trait for basic auth allowing you to implement custom responses
- Custom extractor trait for bearer allowing you to implement custom responses
Type Aliases
- Rejection error used in the AuthBasicCustom and AuthBearerCustom extractors