Authentication Methods
The SDK supports three authentication strategies:- Private Key JWT - Most secure, recommended for production
- Client Credentials - Simple OAuth2 flow for server-to-server
- Personal Access Tokens (PAT) - Quick setup for development and testing
Quick Comparison
| Method | Security | Use Case | Token Management | Setup Complexity |
|---|---|---|---|---|
| Private Key JWT | Highest | Production environments | Automatic refresh | Medium |
| Client Credentials | High | Trusted server-to-server | Automatic refresh | Low |
| Personal Access Token | Medium | Development & testing | Manual (no refresh) | Very Low |
Private Key JWT
Best for: Production environments requiring maximum securityKey Features
- No client secret to manage
- JWT signed with your private key
- Automatic token acquisition and refresh
- Full control over token lifetime and scopes
- Supports key rotation
When to Use
- Production deployments
- Applications requiring highest security
- Environments where secret rotation is complex
- Services requiring custom token configurations
Client Credentials
Best for: Server-to-server communication in trusted environmentsKey Features
- Standard OAuth2 client credentials flow
- Automatic token acquisition and refresh
- Simple setup with ID and secret
- Built-in thread-safe token management
When to Use
- Server-to-server integrations
- Trusted backend services
- Environments where both client and server are controlled
- Simpler setup requirements than Private Key JWT
Personal Access Tokens
Best for: Development, testing, and quick prototypesKey Features
- Pre-generated static token
- No token exchange required
- Immediate usage - no setup needed
- Simple bearer token authentication
When to Use
- Local development and testing
- Debugging and troubleshooting
- Quick prototypes and proof of concepts
- Scripts and one-off tasks
Security Considerations
Production Environments
For production deployments, we strongly recommend:- Use Private Key JWT for maximum security
- Store private keys securely (never commit to version control)
- Implement key rotation policies
- Use environment variables for configuration
- Enable debug logging only in non-production environments
Token Storage
Best practices:- Use environment variables or secret management systems
- Restrict file permissions on credential files (e.g.,
chmod 600) - Rotate credentials regularly
- Use different credentials for different environments
Network Security
All authentication methods require HTTPS connections. The SDK enforces secure communication:Common Configuration
All authentication methods support optional configuration during initialization:Debug Logging
Enable debug mode to troubleshoot authentication issues:- HTTP request and response details
- Token acquisition and refresh events
- API call information
Only enable debug logging in development. It may expose sensitive information in logs.
Migration Between Methods
You can easily switch authentication methods by changing the initialization:Next Steps
Private Key JWT
Secure production authentication
Client Credentials
OAuth2 server-to-server
Personal Access Tokens
Quick development setup