LDAP Authentication
This guide explains how to configure Palpo to authenticate users against an LDAP directory service.
Overview
LDAP (Lightweight Directory Access Protocol) authentication allows users to log in to Palpo using their existing enterprise directory credentials. This is useful for organizations that already have user accounts managed in services like Active Directory, OpenLDAP, or similar directory services.
Prerequisites
- A working LDAP server (e.g., OpenLDAP, Active Directory, FreeIPA)
- Network connectivity between Palpo and the LDAP server
- Appropriate LDAP bind credentials (if anonymous access is not enabled)
Configuration
Add the following section to your palpo.toml configuration file:
Configuration Options
Basic Options
Bind Options
Search Options
Admin Options
Bind Modes
Palpo supports two LDAP binding modes:
1. Service Account Binding (Recommended)
Use a dedicated service account to search for users:
This mode:
- First binds with the service account to search for the user
- Then verifies the user's password by binding as the found user
- Supports automatic admin role detection via
admin_filter
2. Direct Binding
Bind directly as the user without a search:
This mode:
- Uses the provided username directly in the bind DN
- Does not support automatic admin detection (admin_filter is ignored)
- Simpler but less flexible
Examples
OpenLDAP Configuration
Active Directory Configuration
Admin Role Detection
To automatically grant admin privileges to specific LDAP users:
Security Considerations
- Use LDAPS: When possible, use
ldaps://(LDAP over TLS) to encrypt connections - Protect Credentials: Store the bind password file with restrictive permissions (e.g.,
chmod 600) - Limit Bind Account Permissions: The bind account should only have read access to necessary attributes
- Network Security: Consider using a VPN or private network between Palpo and the LDAP server
Troubleshooting
Connection Issues
- Verify the LDAP server is reachable:
ldapsearch -H ldap://server:389 -x -b "dc=example,dc=org" - Check firewall rules for ports 389 (LDAP) or 636 (LDAPS)
- Ensure the bind DN and password are correct
Authentication Failures
- Test the search filter manually with
ldapsearch - Verify the
uid_attributematches your directory schema - Check that the password file is readable by Palpo
- Enable debug logging to see detailed LDAP operations