Skip to main content

Authentication Migration Guide v2.7.0 → v2.8.0

Current Documentation: This guide is for v2.8.0 (latest release, 2025-10-22).
Breaking Change: Token-based authentication will be required for all tool calls in v2.8.0.

Summary of Changes

What Changed?

Before (v2.7.0 and earlier):
After (v2.8.0+):

Why This Change?

The previous implementation had a critical security vulnerability:
  • Tools accepted bare user_id without verifying credentials
  • AuthMiddleware.authenticate() granted access without password validation
  • Any actor who guessed a username could impersonate that user
Security Impact: High - Complete authentication bypass

Migration Steps

For HTTP/StreamableHTTP Clients

Step 1: Add Login Flow
Step 2: Update Tool Call Requests
Before:
After:
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


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 KeycloakUserProvider with proper SSO/OIDC
  • Or implement password hashing in InMemoryUserProvider

Production Deployment

  1. Configure Keycloak:
  2. Obtain Tokens from Keycloak:
  3. No code changes needed - the auth factory automatically uses KeycloakUserProvider

Custom Authentication Provider

Implement the UserProvider interface:
Register your provider in auth/factory.py:

Testing Migration

Update Unit Tests

Integration Tests


Troubleshooting

Error: “Authentication token required”

Cause: Tool call missing token field Fix: Add token parameter to tool call arguments

Error: “Invalid authentication token”

Causes:
  1. Token expired
  2. Token signed with wrong secret
  3. Malformed token
Fix:
  1. Re-login to get fresh token
  2. Ensure JWT_SECRET_KEY matches between token creation and verification
  3. Check token format (should be eyJ...)

Error: “Invalid token: missing user identifier”

Cause: Token payload missing sub 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):
  1. Checkout previous version:
  2. Or apply this patch (INSECURE - development only):
⚠️ This rollback is INSECURE and should only be used temporarily during migration.

Support

Need help with migration?

Changelog

v2.8.0 (Current)

Breaking Changes:
  • ✅ JWT token required for all tool calls
  • /auth/login endpoint added for token generation
  • ✅ InMemoryUserProvider requires passwords
  • ✅ Auth factory respects settings.auth_provider configuration
Security Fixes:
  • 🔒 Closed authentication bypass vulnerability
  • 🔒 Password validation in InMemoryUserProvider
  • 🔒 Token verification enforced for all operations
  • 🔒 Observability initialization in streamable server
Migration:
  • 📖 All clients must update to include token in tool calls
  • 📖 See examples in /examples directory
  • 📖 See this migration guide for complete details

v2.7.0 (Previous)

  • VULNERABLE: Bare user_id authentication without credentials
  • INSECURE: InMemoryUserProvider grants access without password
  • ❌ Hard-coded auth provider (always InMemory)
  • ❌ Missing observability initialization in streamable server