LDAP for Laravel · v4

LdapRecord Laravel

Let users sign in with their LDAP credentials. Keep your database users in sync and query your directory using the Laravel conventions you already know.

Built on LdapRecord Core, with directory models and queries included.
use Illuminate\Support\Facades\Auth;

$credentials = [
    'mail' => '[email protected]',
    'password' => $password,
];

if (Auth::attempt($credentials)) {
    request()->session()->regenerate();

    return redirect()->intended('/dashboard');
}
After configuring your LDAP authentication provider, use Laravel’s Auth facade to sign in.

Bring your directory into Laravel

Set up your application

  1. 1

    Install the package

    Add the integration to your Laravel application.

  2. 2

    Configure your connection

    Tell Laravel how to reach your LDAP directory.

  3. 3

    Choose how users sign in

    Use LDAP directly or sync users to your database.

Need a hand getting started?