Plain Authentication Overview

If you have an application that doesn't require any user data to be synchronized to your database, then you can utilize plain LDAP authentication.

When a user is successfully authenticated, the Laravel Auth::user() method will return an instance of your configured LdapRecord model:

use Illuminate\Support\Facades\Auth;

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

if (Auth::attempt($credentials)) {
    $user = Auth::user();

    // Returns true:
    $user instanceof \LdapRecord\Models\Model;
}