A simple, standards-compliant authentication plugin for MLflow using Descope.
🔐 Descope Authentication - Secure token-based authentication with auto-refresh
🌐 Browser Login UI - Built-in login page with Descope Web Component
🍪 Cookie-Based Sessions - Secure, HttpOnly cookies with automatic refresh
This plugin integrates with MLflow via the mlflow.app entry point, providing server-side authentication with a browser-based login UI.
Browser → /auth/login → Descope Web Component → Cookie Set → MLflow UI
↑
before_request hook validates cookies
pip install mlflow-descope-authOr from source:
git clone https://github.com/descope/mlflow-descope-auth.git
cd mlflow-descope-auth
pip install -e .-
Set environment variables:
export DESCOPE_PROJECT_ID="P2XXXXX"
-
Start MLflow with Descope authentication:
mlflow server --app-name descope --host 0.0.0.0 --port 5000
-
Access MLflow UI: Open
http://localhost:5000in your browser. You'll be redirected to the login page. -
Logout: Visit
/auth/logoutto clear your session.
| Variable | Required | Default | Description |
|---|---|---|---|
DESCOPE_PROJECT_ID |
✅ Yes | - | Your Descope Project ID |
DESCOPE_FLOW_ID |
❌ No | sign-up-or-in |
Descope flow ID for login |
DESCOPE_ADMIN_ROLES |
❌ No | admin,mlflow-admin |
Comma-separated list of admin roles |
DESCOPE_DEFAULT_PERMISSION |
❌ No | READ |
Default permission level (READ/EDIT/MANAGE) |
DESCOPE_USERNAME_CLAIM |
❌ No | sub |
JWT claim to use as username (sub or email) |
DESCOPE_COOKIE_SECURE |
❌ No | false |
Enable secure cookies (set true for HTTPS) |
This plugin registers one MLflow entry point:
[project.entry-points."mlflow.app"]
descope = "mlflow_descope_auth.server:create_app"server.py- Flask app factory formlflow.appentry pointauth_routes.py- Login, logout, and user info endpointsclient.py- Descope SDK wrapper for token validationconfig.py- Configuration managementstore.py- User store adapter (optional, for advanced use cases)
- User visits MLflow UI
before_requesthook checks for valid session cookie (DS)- If no valid session → redirect to
/auth/login - User authenticates via Descope Web Component
- On success, session cookies (
DS,DSR) are set - User redirected back to MLflow UI
after_requesthook refreshes cookies if token was refreshed
# Clone and setup
git clone https://github.com/descope/mlflow-descope-auth.git
cd mlflow-descope-auth
# Install with uv
uv sync
# Run tests
uv run pytest tests/ -v
# Lint and format
uv run ruff check mlflow_descope_auth tests --fix
uv run ruff format mlflow_descope_auth testspython -c "from importlib.metadata import entry_points; print([ep.name for ep in entry_points(group='mlflow.app')])"# Verify plugin is installed
pip list | grep mlflow-descope-auth
# Check entry points
python -c "from importlib.metadata import entry_points; print([ep.name for ep in entry_points(group='mlflow.app')])"- Ensure
DESCOPE_COOKIE_SECURE=truewhen using HTTPS - Check browser dev tools for cookie presence (
DS,DSR) - Verify cookies are not being blocked by browser settings
Contributions welcome! Please read CONTRIBUTING.md for details.
Apache License 2.0 - see LICENSE file for details.
- Issues: GitHub Issues
- Descope Docs: docs.descope.com
- MLflow Docs: mlflow.org/docs
Made with ❤️ by the MLflow Descope Auth Contributors