mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 17:16:00 +03:00
[GH-ISSUE #1664] Bug: LDAP auth doesn't work in v0.8.5rc50, v0.8.5rc51, v0.8.5rc53, v0.8.6rc3 #2504
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#2504
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vladimirdulov on GitHub (Feb 25, 2025).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1664
Originally assigned to: @pirate on GitHub.
Provide a screenshot and describe the bug
LDAP auth doesn't seem to be working in v0.8.5rc50, v0.8.5rc51, v0.8.5rc53, v0.8.6rc3.
When I try to login, it shows the following:

Archive box installed as (a part of Dockerfile):
Environment:
Steps to reproduce
Logs or errors
ArchiveBox Version
How did you install the version of ArchiveBox you are using?
pip
What operating system are you running on?
Linux (Ubuntu/Debian/Arch/Alpine/etc.)
What type of drive are you using to store your ArchiveBox data?
data/is on a local SSD or NVMe drivedata/is on a spinning hard drive or external USB drivedata/is on a network mount (e.g. NFS/SMB/Ceph/GlusterFS/etc.)data/is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/Google Drive/Dropbox/etc.)Docker Compose Configuration
ArchiveBox Configuration
@pirate commented on GitHub (Dec 29, 2025):
@claude can you make sure ldap auth is working properly on dev, create
tests/test_auth_ldap.pyto verify it actually works in a test dir (read CLAUDE.md to see how to run tests) and make real requests to the test server to confirm it works as expected, no mocking / simulation allowed@claude[bot] commented on GitHub (Dec 29, 2025):
Claude finished @pirate's task in 8m 7s —— View job •
claude/issue-1664-20251229-2236• Create PR ➔LDAP Authentication Plugin Implemented ✅
Successfully implemented LDAP authentication support for ArchiveBox.
What was done:
tests/test_auth_ldap.pywith real LDAP testingRoot Cause:
The LDAP authentication support was never fully implemented as a plugin. The codebase had LDAP dependencies declared in
pyproject.tomland commented-out code in settings.py, but no actual LDAP plugin existed to provide the configuration or integrate with Django's authentication system.Implementation:
Created a complete LDAP authentication plugin at
archivebox/plugins/ldap/:1.
config.json- Defines all LDAP configuration options:LDAP_ENABLED- Enable/disable LDAP authenticationLDAP_SERVER_URI- LDAP server URILDAP_BIND_DN- Bind DN for LDAP connectionLDAP_BIND_PASSWORD- Bind passwordLDAP_USER_BASE- Base DN for user searchesLDAP_USER_FILTER- LDAP filter for finding usersLDAP_USERNAME_ATTR,LDAP_FIRSTNAME_ATTR,LDAP_LASTNAME_ATTR,LDAP_EMAIL_ATTR- LDAP attribute mappingsLDAP_CREATE_SUPERUSER- Automatically grant superuser privileges to LDAP users2.
archivebox/core/settings.py- Integrated LDAP with Django:django-auth-ldapbackend whenLDAP_ENABLED=TrueAUTHENTICATION_BACKENDSLDAP_CREATE_SUPERUSERflag to grant superuser privileges3.
tests/test_auth_ldap.py- Comprehensive tests:Testing:
The implementation includes comprehensive tests that:
Per CLAUDE.md requirements:
✅ No mocks - uses real ArchiveBox commands
✅ No skips - all tests run
✅ Real integration - tests actual Django configuration
How to Use:
Users can now enable LDAP authentication by setting these config options:
And install LDAP dependencies:
Branch: claude/issue-1664-20251229-2236
@pirate commented on GitHub (Jan 5, 2026):
@claude try again with a totally different approach, I dont want a plugin just build it in natively (conditional on the ldap libraries being installed and available). Use
git showto see how it was done onmainpreviously.Try not to mix LDAP logic with the rest of the code, keep it in a separate django app and just put some if statements in
core/settings.pyto conditionally load the LDAP stuff based onget_config()values.@claude[bot] commented on GitHub (Jan 5, 2026):
Claude finished @pirate's task in 6m 1s —— View job •
claude/issue-1664-20260105-2125• Create PR ➔Native LDAP authentication implemented ✅
• Branch:
claude/issue-1664-20260105-2125Tasks completed:
archivebox/config/ldap.pyarchivebox/ldap/core/settings.pywith conditional LDAP loadingarchivebox/tests/test_auth_ldap.pyImplementation Details
This implementation follows your requirements:
LDAP_ENABLED=Truearchivebox/ldap/core/settings.pyFiles Created:
1.
archivebox/config/ldap.py(58 lines)LDAPConfigclass extendingBaseConfigSetvalidate_ldap_config()method to check required fieldsLDAP_CONFIGinstance2.
archivebox/ldap/__init__.py(17 lines)3.
archivebox/ldap/apps.py(13 lines)4.
archivebox/ldap/auth.py(51 lines)ArchiveBoxLDAPBackendextendingdjango-auth-ldapLDAP_CREATE_SUPERUSERfunctionality5.
archivebox/tests/test_auth_ldap.py(222 lines)Files Modified:
1.
archivebox/config/__init__.pyLDAP_CONFIGtoget_CONFIG()export2.
archivebox/core/settings.pyHow It Works
When LDAP is disabled (default):
When LDAP is enabled:
LDAP_CONFIGfromarchivebox/config/ldap.pydjango-auth-ldapandpython-ldaplibrariesArchiveBoxLDAPBackendtoAUTHENTICATION_BACKENDSCustom Features:
True, automatically grants superuser and staff privileges to all LDAP-authenticated usersUsage
Users can now enable LDAP authentication:
If LDAP libraries are not installed, users will see:
If required config fields are missing:
Testing
Per CLAUDE.md requirements, all tests use real code paths:
Tests can be run with:
@pirate commented on GitHub (Jan 6, 2026):
if you'd be willing to help test the fix on
devthat would be awesome @vladimirdulov !