Authentication Migration Guide v2.7.0 → v2.8.0
Current Documentation: This guide is for v2.8.0 (latest release, 2025-10-22).
Summary of Changes
What Changed?
Before (v2.7.0 and earlier):Why This Change?
The previous implementation had a critical security vulnerability:- Tools accepted bare
user_idwithout verifying credentials AuthMiddleware.authenticate()granted access without password validation- Any actor who guessed a username could impersonate that user
Migration Steps
For HTTP/StreamableHTTP Clients
Step 1: Add Login Flow
Step 2: Update Tool Call Requests
Before:Step 3: Handle Token Expiration
For stdio Clients
stdio clients cannot use HTTP endpoints, so tokens must be obtained out-of-band:Option 1: Use HTTP endpoint separately
Option 2: Create token programmatically (dev/test only)
Updated Tool Schemas
agent_chat
conversation_get
conversation_search
Default Credentials (Development Only)
For development and testing, the InMemoryUserProvider has these default users:
⚠️ WARNING: These credentials use plaintext password storage and are INSECURE. They are only for development/testing.
For Production:
- Use
KeycloakUserProviderwith proper SSO/OIDC - Or implement password hashing in
InMemoryUserProvider
Production Deployment
Using Keycloak (Recommended)
- Configure Keycloak:
- Obtain Tokens from Keycloak:
- No code changes needed - the auth factory automatically uses KeycloakUserProvider
Custom Authentication Provider
Implement theUserProvider interface:
auth/factory.py:
Testing Migration
Update Unit Tests
Integration Tests
Troubleshooting
Error: “Authentication token required”
Cause: Tool call missingtoken field
Fix: Add token parameter to tool call arguments
Error: “Invalid authentication token”
Causes:- Token expired
- Token signed with wrong secret
- Malformed token
- Re-login to get fresh token
- Ensure
JWT_SECRET_KEYmatches between token creation and verification - Check token format (should be
eyJ...)
Error: “Invalid token: missing user identifier”
Cause: Token payload missingsub claim
Fix: Ensure token was created correctly:
Error: “Password required for InMemoryUserProvider”
Cause: Trying to authenticate without password Fix: InMemoryUserProvider now requires passwords:Rollback Plan
If you need to temporarily rollback to the old behavior (NOT RECOMMENDED):- Checkout previous version:
- Or apply this patch (INSECURE - development only):
Support
Need help with migration?- GitHub Issues: Report migration issues
- GitHub Discussions: Ask migration questions
- Security Issues: Email security issues to maintainers (see SECURITY.md)
Changelog
v2.8.0 (Current)
Breaking Changes:- ✅ JWT token required for all tool calls
- ✅
/auth/loginendpoint added for token generation - ✅ InMemoryUserProvider requires passwords
- ✅ Auth factory respects
settings.auth_providerconfiguration
- 🔒 Closed authentication bypass vulnerability
- 🔒 Password validation in InMemoryUserProvider
- 🔒 Token verification enforced for all operations
- 🔒 Observability initialization in streamable server
- 📖 All clients must update to include
tokenin tool calls - 📖 See examples in
/examplesdirectory - 📖 See this migration guide for complete details
v2.7.0 (Previous)
- ❌ VULNERABLE: Bare
user_idauthentication without credentials - ❌ INSECURE: InMemoryUserProvider grants access without password
- ❌ Hard-coded auth provider (always InMemory)
- ❌ Missing observability initialization in streamable server