Authentication In Rust Web Frameworks

Hello awesome developers,

Something is really bothering me about web rust framework, I have use actix web to create a simple project in the past. I want to ask, what's the best approach in creating authentication and authorization using rust web framework especially actix-web ? I read about middlewares but it seems like a tough topic to me. In spring boot, I know of spring security that makes authentication and authorization easier. Is there similar crate in rust too ?

Thanks a lot

1 Like

What type of authentication do you need/want to implement?

Rust web frameworks are not "batteries included" like Spring Boot. If you need authentication, you would need to either develop it yourself or find a crate that does most of the boilerplate for you.

For example, here's a crate for Actix-web that enables authentication using JWTs:
https://crates.io/crates/actix-jwt-authc

1 Like

Just a basic authentication and session based and not stateless. Thanks, I will check through the crate. That means I still have a lot to study on rust web frameworks.