Authentication
The auth namespace provides user authentication, registration, and API key management capabilities for secure access to the Functor platform.
Basic Operations
Register a New User
Login a User
Create an API Key
List API Keys
Delete an API Key
Complete Parameter Reference
register() Parameters
login() Parameters
create_api_key() Parameters
list_api_keys() Parameters
delete_api_key() Parameters
Available Scopes
The following permission scopes are available for API keys:
- read - Read access to resources
- write - Write access to resources
- admin - Administrative privileges
- analytics - Access to analytics and usage data
- benchmarks - Permission to run benchmarks
Advanced Usage Patterns
User Registration Flow
API Key Management
Secure Authentication Flow
Async Authentication
Security Best Practices
- Never hardcode credentials: Use environment variables or secure vaults for API keys and tokens
- Use scoped API keys: Grant only the minimum necessary permissions
- Rotate keys regularly: Replace API keys periodically for security
- Store tokens securely: Use secure file permissions (0600) on token files
- Use HTTPS only: Never transmit credentials over unencrypted connections
- Implement logout: Clear tokens when users log out
Next Steps
- Client Reference - Configure authentication in FunctorClient
- Error Handling - Handle authentication errors properly
- Analytics Namespace - Track API usage per user/tenant