This is an example of an authentication service built using Rust, leveraging the axum
web framework and sqlx
for database interactions. The service uses RS256 (RSA Signature with SHA-256) for signing and verifying JSON Web Tokens (JWT).
Follow these steps to set up and run the web application:
Ensure you have the following installed on your machine:
-
Start Docker Daemon
Make sure the Docker daemon is running on your machine. You can typically start it from your system tray or by running the following command:
sudo systemctl start docker
Alternatively, on macOS and Windows, you might need to open the Docker Desktop application.
-
Initialize the Database
Run the initialization script to start the necessary containers for Postgres and Redis:
./scripts/init_db.sh
- User registration, login, logout, refresh token
- JWT generation and verification
- SQLx for asynchronous database operations
- Axum for routing and middleware support