Authentication Guide
Overview
Quilt supports two authentication methods for accessing your data:
Interactive Login: Web-based OAuth/SSO authentication (best for notebooks, local development)
API Keys: Token-based authentication (best for automation, CI/CD, scripts)
Interactive Authentication
Interactive authentication uses OAuth or SSO to authenticate through your web browser. This is the recommended method for personal use, Jupyter notebooks, and local development.
Login
import quilt3
# Opens your browser for authentication
quilt3.login()This command will:
Open your default web browser
Redirect you to your Quilt catalog's login page
After successful authentication, save credentials locally
Return you to your Python session
Check Authentication Status
Logout
API Key Authentication
NOTE: This feature requires Quilt Platform version 1.67 or higher
API keys provide programmatic access to Quilt without requiring browser-based authentication. Keys are created through the Python API and can be used for automated workflows.
When to Use API Keys
Use API Keys For
Automated scripts and data pipelines
Server-side applications and microservices
Containerized applications (Docker, Kubernetes)
Cloud functions and serverless workloads
CI/CD pipelines and automated workflows
Scheduled jobs and batch processing
Creating Your First API Key
Step 1: Authenticate Interactively
First, log in using the interactive method:
Step 2: Create an API Key
⚠️ Security Warning: The secret is only shown once during creation. Save it immediately in a secure location. If you lose it, you'll need to create a new key.
Step 3: Store the Secret Securely
Choose a secure storage method based on your environment:
Local Development
Create a .env file in your project directory:
Use the registryUrl value from your catalog's /config.json, not the catalog homepage URL. These URLs can differ.
Load it in your Python code:
IMPORTANT: Add .env to your .gitignore to prevent committing secrets.
For production deployments, embed it in environment variables or AWS secrets manager.
Step 4: Use the API Key
NOTE: quilt3 will not automatically detect and use the QUILT_API_KEY. You must explicitly login with it.
Managing Your API Keys
List All Your Keys
Filter Keys
Get a Specific Key
Revoke a Key
Best Practices
Security Guidelines
🔐 Never commit API keys to version control
Add
.envfiles to.gitignoreUse secret scanning tools (GitGuardian, GitHub Advanced Security)
🔐 Use environment variables or secret managers
Never hardcode keys in source code
Prefer managed secret services in production
🔐 Rotate keys regularly
Set up rotation before expiration (60-90 days)
Plan rotation during low-traffic periods
🔐 Use descriptive names
Include purpose, environment, and date:
ci-github-prod-2026q1Makes key management and auditing easier
🔐 Revoke unused keys immediately
Delete keys when pipelines are retired
Conduct regular key audits
🔐 Use separate keys per environment
Different keys for dev, staging, production
Limits blast radius if a key is compromised
Administrator Guide
Administrators have additional capabilities to manage API keys across all users.
Prerequisites
You must be an admin user to access these functions:
List All API Keys
Get Key Details
Revoke a User's Key
Audit Key Usage
Generate Usage Reports
Athena Query for Audit Trail
For detailed audit trail queries, see the GxP documentation.
Example query to find all API key usage in the last 30 days:
Troubleshooting
Authentication Failed
Error: Authentication failed. Check your credentials or API key.
Solutions
Verify the Key Format
Check if Key is Expired
Clear Old Sessions
API Key Prefix Error
Error: API key must start with 'qk_' prefix
Solutions
Verify you copied the complete secret
Check for whitespace:
api_key = api_key.strip()Regenerate the key if needed
Key Expired
Error: Key shows status: EXPIRED
Solution
Create a new key:
Environment Variable Not Set
Error: QUILT_API_KEY environment variable not set
Solutions
Check if Variable is Set
Set in Current Session
Add to Shell Profile
For ~/.bashrc or ~/.zshrc:
Use .env File (Recommended)
Then load it in Python:
Migration from Interactive to API Key
If you have existing scripts using quilt3.login(), here's how to migrate:
Before (Interactive Login)
After (API Key)
Migration Checklist
API Reference
For detailed API documentation, see:
quilt3.api_keys - User API
quilt3.admin.api_keys - Admin API
Audit Trail Events - Security & Compliance
Additional Resources
Last updated
Was this helpful?

