A simple authentication service for user registration, login, and role-based access control.
Warning
The program is still under development and may contain bugs or security vulnerabilities. DO NOT USE IT IN PRODUCTION. Use it at your own risk.
- Basic Authentication
- Role-Based Access Control
- OIDC Authentication
- Multi-Factor Authentication
- Passcode & Other Authentication Methods
- User Management
You'll need latest Rust, PostgreSQL and Redis to run this locally.
Note
Older version maybe usable, but we DO NOT provide any support for it.
git clone <repository-url>
cd auth
just setup
just devThe service starts on http://localhost:7817.
On first run, it creates a config.toml file. Update the database and Redis settings as needed.
When you first start the service, it creates a super admin account. Check the startup logs for the username and password.
Use these commands for development:
just dev # Run in development mode
just dev-watch # Auto-reload on file changes
just test # Run tests
just fmt # Format code
just clippy # Check code qualityThe easiest way to run this is with Docker:
# Build the image
docker build -t auth-service .
# Run with default settings
docker run -p 7817:7817 auth-service
# Or use the justfile commands
just docker-build
just docker-runFor production, you'll want to mount your config file and connect to external databases:
docker run -d \
-p 7817:7817 \
-v /path/to/your/config.toml:/app/config.toml \
-e LOG_LEVEL=INFO \
auth-serviceYou can also use docker-compose. Here's a basic setup:
version: '3.8'
services:
auth:
build: .
ports:
- "7817:7817"
volumes:
- ./config.toml:/app/config.toml
depends_on:
- postgres
- redis
postgres:
image: postgres:15
environment:
POSTGRES_DB: auth_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
redis:
image: redis:7Fork the repo, make your changes, run just quality to make sure everything looks good, then submit a pull request.
MIT License