This guide provides step-by-step instructions for deploying the Tapis OAuth2 integration in your WebODM environment.
This configuration disables all authentication methods except Tapis OAuth2. Ensure you have valid Tapis credentials and have registered your OAuth2 client with Tapis before proceeding.
- WebODM Installation: Either Docker-based or native installation
- Tapis Account: Valid account with the target Tapis tenant
- Tapis OAuth2 Client: Registered OAuth2 application in Tapis
- Network Access: WebODM server can reach Tapis API endpoints
- Admin Access: Ability to modify WebODM configuration and database
All necessary files have been created/modified in your WebODM installation:
New Files:
app/auth/tapis_oauth2.pyapp/models/oauth2.pyapp/api/tapis_oauth2.pyapp/admin/oauth2.pyapp/contexts/tapis.pyapp/views/tapis_auth.pyapp/migrations/0002_tapis_oauth2_models.pysetup_tapis_oauth2.py
Modified Files:
requirements.txtwebodm/settings.pywebodm/urls.pyapp/api/urls.pyapp/urls.pyapp/models/__init__.pyapp/admin.pyapp/templates/app/registration/login.html
Set the following environment variables:
All host users that build or run the WebODM/ClusterODM containers must belong to the shared storage group G-820466. This membership grants access to /corral/webodm/media and is now enforced by the automated setup script and Docker configuration. Verify membership before continuing:
id -nG "$USER" | tr ' ' '\n' | grep -Fx G-820466If no output is returned, request that an administrator adds your account (for example: sudo usermod -a -G G-820466 $USER) and re-login before running setup.sh.
The .env file must also contain the group metadata so Docker can pass it through to the containers:
WO_CORRAL_GROUP=G-820466
WO_CORRAL_GROUP_ID=<gid returned by getent group G-820466>The setup script now manages these values automatically; update your existing deployments accordingly.
Set WO_SHARED_VOLUME_ROOT to the absolute path that ClusterODM and NodeODM can read (for example /corral/webodm/media). When this variable is present WebODM will stage task data in that location and submit jobs using import_path rather than uploading files. Ensure the directory structure under WO_SHARED_VOLUME_ROOT matches the contents of /webodm/app/media inside the containers (the default WO_MEDIA_DIR bind mount already satisfies this when both point to /corral/webodm/media).
ClusterODM mapping: configure
node_shared_path_mappingsso the path reported by WebODM (for example/corral/webodm/media/...) is translated to the path visible on each NodeODM host (for example/corral/utexas/BCS26030/webodm/media/...). SeeClusterODM-Tapis/docs/PATH_MAPPING.mdfor details.
# Add to docker-compose.yml or .env file
WO_TAPIS_BASE_URL=https://tacc.tapis.io
WO_TAPIS_TENANT_ID=your-tenant-idexport WO_TAPIS_BASE_URL="https://tacc.tapis.io"
export WO_TAPIS_TENANT_ID="your-tenant-id"The dependencies will be installed automatically when the container rebuilds.
pip install requests-oauthlib==1.3.1 oauthlib==3.2.0python setup_tapis_oauth2.pypython manage.py migrateThe setup script will prompt you to create a client during setup.
- Start WebODM
- Access Django admin:
http://your-webodm-domain.com/admin/ - Navigate to "Tapis OAuth2 Clients"
- Add new client:
- Name: Descriptive name (e.g., "Production WebODM")
- Client ID: Your Tapis OAuth2 client ID
- Client Secret: Your Tapis OAuth2 client secret
- Tenant ID: Your Tapis tenant ID
- Base URL: Tapis API base URL (e.g.,
https://tacc.tapis.io) - Callback URL:
https://your-webodm-domain.com/api/oauth2/tapis/callback/
Register your WebODM callback URL with your Tapis OAuth2 client:
curl -X POST https://tacc.tapis.io/v3/oauth2/clients \
-H "Content-Type: application/json" \
-H "X-Tapis-Tenant: your-tenant-id" \
-H "Authorization: Bearer your-admin-token" \
-d '{
"client_id": "your-webodm-client-id",
"callback_url": "https://your-webodm-domain.com/api/oauth2/tapis/callback/",
"display_name": "WebODM Instance"
}'Navigate to your Tapis tenant dashboard and configure the OAuth2 client with the callback URL.
- Access your WebODM instance:
https://your-webodm-domain.com - You should be redirected to the login page showing "Login with Tapis"
- Click the login button
- Complete OAuth2 flow with Tapis
- Verify successful login to WebODM dashboard
-
Stop WebODM:
./webodm.sh stop
-
Set Environment Variables: Create or modify
.envfile in WebODM directory:WO_TAPIS_BASE_URL=https://tacc.tapis.io WO_TAPIS_TENANT_ID=your-tenant-id
-
Rebuild and Start:
./webodm.sh rebuild
./webodm.sh start --default-nodes 0 > startup_webodm.log 2>&1 & tail -f startup_webodm.log
4. **Run Setup**:
```bash
./webodm.sh run webapp python setup_tapis_oauth2.py
-
Modify docker-compose.yml:
services: webapp: environment: - WO_TAPIS_BASE_URL=https://tacc.tapis.io - WO_TAPIS_TENANT_ID=your-tenant-id
-
Rebuild and Start:
docker-compose build webapp docker-compose up -d
-
Run Migrations:
docker-compose exec webapp python manage.py migrate
# In Django shell
python manage.py shellfrom django.conf import settings
print(settings.AUTHENTICATION_BACKENDS)
# Should show only Tapis and Guardian backends# In Django shell
from app.models import TapisOAuth2Client
clients = TapisOAuth2Client.objects.all()
for client in clients:
print(f"Client: {client.name} (Active: {client.is_active})")curl -s https://your-webodm-domain.com/api/oauth2/tapis/status/ | jq-
Migration Errors:
# Reset migrations if necessary python manage.py migrate app zero python manage.py migrate -
Template Errors:
- Verify
default_tapis_client_idis available in template context - Check Django admin for active OAuth2 clients
- Verify
-
OAuth2 Flow Errors:
- Verify callback URL matches exactly in both Tapis and WebODM
- Check Tapis tenant ID configuration
- Verify network connectivity to Tapis endpoints
-
Authentication Loop:
- Clear browser cookies
- Check Django session configuration
- Verify OAuth2 client is active
Add to webodm/settings.py:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'loggers': {
'app.auth.tapis_oauth2': {
'handlers': ['console'],
'level': 'DEBUG',
},
'app.api.tapis_oauth2': {
'handlers': ['console'],
'level': 'DEBUG',
},
},
}If you need to revert to standard authentication:
-
Restore Authentication Backends:
# In webodm/settings.py AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'guardian.backends.ObjectPermissionBackend', )
-
Restore Django Auth URLs:
# In webodm/urls.py urlpatterns = [ url(r'^', include('app.urls')), url(r'^', include('django.contrib.auth.urls')), # Add this back url(r'^admin/', admin.site.urls), # ... rest of URLs ]
-
Restore Login Template:
- Restore original
app/templates/app/registration/login.html
- Restore original
-
Restart WebODM
- Client Secrets: Store securely and rotate regularly
- HTTPS: Always use HTTPS in production
- Callback URLs: Use exact matching, avoid wildcards
- Token Storage: Tokens are encrypted in database
- Session Management: Configure appropriate session timeouts
Monitor the following for production deployments:
- OAuth2 authentication success/failure rates
- Token expiry logout frequency
- Database growth (OAuth2 state cleanup)
- Tapis API response times
- WebODM authentication errors
For issues with this integration:
- Check Django application logs
- Review Tapis API documentation
- Verify OAuth2 client configuration
- Test network connectivity to Tapis endpoints
🚨 Final Warning: Once deployed, only users with valid Tapis accounts can access WebODM. Ensure you have tested the complete OAuth2 flow before deploying to production.