5 releases (breaking)

0.5.0 Feb 19, 2025
0.4.0 Jan 26, 2025
0.3.0 Jan 25, 2025
0.2.0 Jan 2, 2025
0.1.1 Jul 28, 2023

#304 in Authentication

Download history 4/week @ 2024-11-05 1/week @ 2024-12-03 7/week @ 2024-12-10 164/week @ 2024-12-31 11/week @ 2025-01-07 1/week @ 2025-01-14 199/week @ 2025-01-21 36/week @ 2025-01-28 30/week @ 2025-02-04 7/week @ 2025-02-11

99 downloads per month

MIT license

170KB
388 lines

axum-jwt-auth

Rust Crates.io Version docs.rs

A Rust library providing JWT authentication middleware for Axum web applications. It supports both local and remote JWKS validation, handles token extraction and validation, and provides strongly-typed claims access in your request handlers. Built on top of jsonwebtoken, it offers a simple yet flexible API for securing your Axum routes with JWT authentication.

Installation

cargo add axum-jwt-auth

Usage

See examples for how to use the library. It includes a local and remote example.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Useful commands

cargo fmt
cargo clippy --all-features --all-targets
# if you have nextest installed, you can run tests with:
cargo nextest run --profile ci
# otherwise regular cargo test will work
cargo test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~11–23MB
~345K SLoC