strathmore / ldap-auth
Reusable LDAP authentication package for Laravel projects
v1.0.0
2026-01-30 12:46 UTC
Requires
- php: ^8.1
This package is auto-updated.
Last update: 2026-03-01 00:49:01 UTC
README
A reusable Laravel package for LDAP authentication and auto-fetching user data via web services.
Supports staff and students trees, multiple LDAP connections, and optional auto-creation of local users.
Features
- LDAP authentication for staff and students
- Configurable LDAP connections and trees
- Optional web-service fetch for user data
- Laravel-ready: Service Provider + Facade
- Config-driven, works across Laravel 10 and 11
- Easy installation, Spatie-style DX
Installation
Require the package via Composer (local dev or Packagist):
composer require strathmore/ldap-auth
Publish the configuration file:
php artisan vendor:publish --tag=ldap-config
.env Example
Add these variables to your .env file and adjust as needed:
LDAP_HOSTS=ldap.example.com LDAP_BIND_DN=cn=admin,dc=example,dc=com LDAP_BIND_PASSWORD=secret LDAP_PORT=389 LDAP_BASE_DN=dc=example,dc=com LDAP_TIMEOUT=5 LDAP_SSL=false LDAP_TLS=false LDAP_STAFF_DOMAIN=staff.example.com LDAP_STAFF_TREE=ou=staff,dc=example,dc=com LDAP_STUDENT_DOMAIN=students.example.com LDAP_STUDENT_TREE=ou=students,dc=example,dc=com STUDENT_DATASERVICE_URL=https://api.example.com/students/ STAFF_DATASERVICE_URL=https://api.example.com/staff/
Author
Benedict Godhana
benedictgodhana7@gmail.com