- Authenticate users against your corporate directory
- Automatically import user information
- Keep user data synchronized
- Leverage existing directory groups
Prerequisites
Before configuring LDAP, ensure you have:
- LDAP/AD server hostname or IP address
- LDAP bind user credentials (service account)
- Base DN for your directory
- Network connectivity from Snipe-IT to your LDAP server
- PHP LDAP extension installed (
php-ldap)
Configuration
1. Enable LDAP
Navigate to Admin > Settings > LDAP in the Snipe-IT interface.2. Basic LDAP Settings
Server Configuration
Configure your LDAP server connection:
- LDAP Server: Hostname or IP (e.g.,
ldap.example.comor192.168.1.10) - LDAP Port: Usually
389for LDAP or636for LDAPS - LDAP Version: Typically
3 - Base DN: Your directory base (e.g.,
dc=example,dc=com)
Bind Credentials
Provide credentials for a service account with read access to your directory:
- LDAP Bind Username: Full DN (e.g.,
cn=snipeit,ou=service,dc=example,dc=com) - LDAP Bind Password: Password for the bind user
Environment Variables
You can also configure LDAP settings via environment variables in your.env file:
.env
Field Mapping
Map LDAP attributes to Snipe-IT user fields:| Snipe-IT Field | Common AD Attribute | Common LDAP Attribute |
|---|---|---|
| Username | samaccountname | uid |
| First Name | givenname | givenName |
| Last Name | sn | sn |
mail | mail | |
| Employee Number | employeenumber | employeeNumber |
| Phone | telephonenumber | telephoneNumber |
| Job Title | title | title |
| Department | department | ou |
| Manager | manager | manager |
| Country | c | c |
| Location | physicaldeliveryofficename | l |
The exact attribute names may vary depending on your LDAP schema. Consult your directory administrator for the correct attribute names.
Active Directory Examples
Standard Active Directory Configuration
.env
Active Directory with LDAPS (Secure)
.env
Active Directory - Specific OU Only
.env
OpenLDAP Examples
Standard OpenLDAP Configuration
.env
LDAP Authentication
When LDAP authentication is enabled, Snipe-IT will:- Check if the username exists in the local database
- If found and LDAP is enabled, authenticate against LDAP
- If authentication succeeds, update the user’s information from LDAP
- If the user doesn’t exist locally, they must be imported via LDAP sync first
Authentication Filter
You can specify an additional authentication filter to restrict which LDAP users can log in:.env
Importing Users
Manual Import via Web Interface
- Navigate to Admin > Users
- Click LDAP Sync button
- Optionally select a default location for imported users
- Click Synchronize
- Review the import summary
Command Line Import
You can import users via the command line:Scheduled LDAP Sync
To automatically sync users on a schedule, add a cron job:crontab
Troubleshooting
Test LDAP Connection
Test LDAP Connection
Use the built-in LDAP test tool:
- Navigate to Admin > Settings > LDAP
- Click Test LDAP Connection
- Review the test results
Common Connection Issues
Common Connection Issues
Cannot connect to LDAP server:
- Verify network connectivity:
telnet ldap.example.com 389 - Check firewall rules
- Ensure correct hostname/IP and port
- Verify LDAP service is running
- For testing, temporarily set
LDAP_SERVER_CERT_IGNORE=true - For production, install proper CA certificates
- Verify certificate CN matches server hostname
Authentication Issues
Authentication Issues
Users cannot log in:
- Verify users have been imported first (LDAP sync)
- Check the authentication filter is not too restrictive
- Verify bind user credentials are correct
- Check user’s account is enabled in AD/LDAP
- Review Snipe-IT logs:
storage/logs/laravel.log
- Verify field mappings match your LDAP schema
- Re-run LDAP sync to update user data
Import Issues
Import Issues
No users imported:
- Verify LDAP filter syntax
- Check base DN is correct
- Ensure bind user has read permissions
- Review error messages in web interface or command output
- Check if users exist with different usernames
- Verify username field mapping is correct
- Snipe-IT matches on username field
Security Best Practices
Use LDAPS
Always use LDAPS (port 636) in production to encrypt credentials in transit.
Dedicated Service Account
Create a dedicated LDAP service account with read-only permissions for Snipe-IT.
Restrict Base DN
Use the most specific base DN possible to limit the directory scope.
Filter Carefully
Use LDAP filters to import only necessary users and exclude disabled accounts.
Advanced Configuration
Client TLS Certificates
If your LDAP server requires client certificates:.env
Default Group for LDAP Users
Assign imported LDAP users to a specific Snipe-IT group:.env
Password Synchronization
Allow LDAP users to change their Snipe-IT password (not recommended if using LDAP auth):.env
Next Steps
SAML SSO
Configure enterprise single sign-on
User Management
Learn about user permissions and groups
