A production-ready authentication and authorization service built with FastAPI, providing secure identity management for the OmniBioAI ecosystem.
It supports JWT authentication, refresh tokens, and role-based access control (RBAC) across distributed bioinformatics workflows running on local machines, HPC clusters, and cloud infrastructure.
OmniBioAI Auth Service is the central identity layer for the OmniBioAI platform.
It enables:
- Secure user authentication (JWT-based)
- Refresh token management
- Role-Based Access Control (RBAC)
- Multi-service authentication (TES, Studio, LIMS, Control Center)
- Scalable microservice-ready architecture
This service acts as the single source of truth for identity and access control across:
- Studio (Electron UI)
- TES (workflow execution engine)
- LIMS (data management system)
- Control Center (system monitoring)
- SDK clients
- Email/password login
- JWT access tokens
- Refresh token support
- Secure password hashing (bcrypt)
- Role-Based Access Control (RBAC)
- Permission-based access control
- Middleware-based enforcement
- MySQL backend
- SQLAlchemy ORM
- Auto table creation support
- FastAPI async backend
- Modular service structure
- Clean separation of concerns
- Production-ready codebase
app/
├── main.py # FastAPI entrypoint
├── core/ # Security + config
├── db/ # Database models + session
├── api/ # API routes + dependencies
├── services/ # Business logic
├── schemas/ # Pydantic models
└── rbac.py # Permission system
- FastAPI
- MySQL
- SQLAlchemy
- JWT (python-jose)
- Passlib (bcrypt)
- Uvicorn
git clone git@github.com:man4ish/omnibioai-auth.git
cd omnibioai-authpython -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate .env file:
DB_USER=root
DB_PASSWORD=root
DB_HOST=localhost
DB_PORT=3306
DB_NAME=omnibioai
SECRET_KEY=super-secret-key
ACCESS_TOKEN_EXPIRE_MINUTES=15
REFRESH_TOKEN_EXPIRE_DAYS=7Ensure MySQL is running and database exists:
CREATE DATABASE IF NOT EXISTS omnibioai;uvicorn app.main:app --reload --port 8001POST /auth/login
Request
{
"email": "user@example.com",
"password": "password"
}Response
{
"access_token": "...",
"refresh_token": "...",
"token_type": "bearer"
}POST /auth/refresh
GET /users/me
- Passwords hashed using bcrypt
- JWT signed using HS256
- Short-lived access tokens (15 min)
- Refresh token rotation support (planned extension)
- RBAC-based permission enforcement
Roles:
- admin
- researcher
- hpc_user
- viewer
Permissions:
- workflow:run
- workflow:cancel
- dataset:read
- dataset:write
- hpc:submit
GET /health
Response:
{
"status": "ok"
}This service integrates with:
- Workflow execution engine (TES)
- Electron desktop client (Studio)
- Bioinformatics pipelines
- Cloud/HPC job schedulers
- OAuth2 (Google/GitHub login)
- Multi-tenant support (lab-level isolation)
- Redis session caching
- Audit logging
- Rate limiting
- Admin dashboard API
- Service-to-service authentication
This service is designed as:
A lightweight, scalable identity backbone for distributed scientific computing systems.
Built as part of the OmniBioAI ecosystem Focused on reproducible, scalable bioinformatics workflows.