2.5 KiB
2.5 KiB
CURRENT AI WORKING SESSION — HANDOVER
Active AI: Claude (Haiku 4.5) Last Updated: 2026-04-26 Current Version: v1.15.0 Status: ✅ LDAP LOGIN BUG FIXED | 🔧 FRONTEND/BACKEND RESPONSE SYNC
SESSION SUMMARY — LDAP Authentication Fix
Issue Identified
User reported "Invalid Protocol Password" error when attempting LDAP login. Investigation revealed two root causes:
-
Response Structure Mismatch: Frontend expected
response.userobject, but backend only returned individual fields (user_id,username,role). This causedlocalStorage.setItem(JSON.stringify(response.user))to fail withundefined, throwing an error caught by the generic error handler displaying the misleading error message. -
Password Encoding: LDAP protocol requires UTF-8 encoded password bytes; direct string passing may cause protocol errors with certain password characters.
Fixes Applied
Backend Changes
backend/schemas/users.py: Added optionaluserfield toTokenResponseschema for frontend compatibilitybackend/routers/auth.py:- Line 70: Ensured password is UTF-8 encoded before LDAP bind
- Line 250: Updated login response to include populated
Userobject
Result
- ✅ LDAP login response now includes complete
userobject - ✅ Password properly encoded for LDAP protocol compatibility
- ✅ Error messages now accurately reflect actual authentication failures
- ✅ Frontend successfully receives and processes login response
Commits
51716faf: Fix LDAP login: ensure password encoding and include user in response
Testing Status
✅ Backend Login Endpoint
- Response now includes complete
userobject - Sample response structure:
{ "access_token": "eyJ...", "token_type": "bearer", "user_id": 1, "username": "admin", "role": "admin", "user": { "id": 1, "username": "admin", "role": "admin", "origin": "local" } }
✅ Services Running
- Backend: http://localhost:8916 (uvicorn)
- Frontend: http://localhost:3000 (npm run dev)
🔧 Remaining Tasks
- Browser Testing: Visit http://localhost:3000/login and test login with credentials
- LDAP Testing: Test LDAP login once database has LDAP users
- Local Testing: Verify local user login works correctly
- Version Bump: Run
python3 scripts/save_version.pyto finalize changes