A Rust-based OAuth2 and webauthen compatible authentication system.
To self-host auth-rs, use the provided docker-compose.yml file located in the root of this repository.
Before starting the services, ensure the following environment variables are properly configured in the docker-compose.yml file:
The well-known page is located in the backend at /api/.well-known/openid-configuration
-
DATABASE_URL: The database connection string for MongoDB.- Default:
mongodb://mongodb:27017. - Note: Update if you modify the MongoDB host, port, or credentials.
- Default:
-
SYSTEM_EMAIL: The email address for the system administrator.- Example:
admin@example.com. - Note: Required for administrative tasks. Does not have to be an actual email, but has to look like one.
- Example:
-
SYSTEM_PASSWORD: A strong password for the system administrator.- Example:
P@ssw0rd123!. -> DO NOT USE THIS ONE! - Note: Ensure this is secure to protect the admin account.
- Example:
-
PUBLIC_BASE_URL: The base url to your public frontend.- Example:
https://auth.example.com. - Note: If you use a localhost domain for your frontend, passkeys will not be available.
- Example:
PUBLIC_API_URL: The base URL for the backend API that the frontend will communicate with.- Example:
https://auth.example.com/api. - Note: Ensure this matches the actual URL where your backend is hosted.
- Example:
Once the environment variables are configured, start the services using Docker Compose:
docker-compose up -dThe backend will be available at port 8000 and the frontend at port 3000. I suggest using nginx custom-paths to map the backend into the domains /api path or using a subdomain to host you backend like api.exmaple.com.
Icons: https://lucide.dev/license
MIT Licence