Implementing JWT Authentication in Rust using Axum
dev.to·7h·
Discuss: DEV
Flag this post

This is part 4 of this series, where I implement JWT authentication using the Axum framework in Rust.

The previous part is here.

Source Code

The repository is here

Quick Recap

In the previous chapter we added database and JWT configurations. We created an application context, which is initialised once and shared throughout the application.

Introduction

In this chapter we will see how to create middlewares in Axum using Tower. The middlewares here will be used for authentication purposes. We will use the argon2 crate added in the previous section to hash passwords; the jsonwebtoken crate will provide methods to sign and verify tokens.

##…

Similar Posts

Loading similar posts...