Crate axum_auth

Source
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:

If you need to implement custom errors (i.e., status codes and messages), use these:

That’s all there is to it! Check out the repository for contributing or some more documentation.

Structs§

AuthBasic
Basic authentication extractor, containing an identifier as well as an optional password
AuthBearer
Bearer token extractor which contains the innards of a bearer header as a string

Traits§

AuthBasicCustom
Custom extractor trait for basic auth allowing you to implement custom responses
AuthBearerCustom
Custom extractor trait for bearer allowing you to implement custom responses

Type Aliases§

Rejection
Rejection error used in the AuthBasicCustom and AuthBearerCustom extractors