Support the ongoing development of Laravel.io →
posted 9 years ago
Authentication
Last updated 2 years ago.
0

You need to make sure that you are implementing the retrieveById function on your LdapUserProvider as this is what Laravel uses to populate the user field on the Guard on each request.

/**
 * Retrieve a user by their unique identifier.
 *
 * @param  mixed  $identifier
 * @return \Illuminate\Contracts\Auth\Authenticatable|null
 */
public function retrieveById($identifier){
         
}

You might also want to create an extension of Illuminate\Auth\GenericUser and override the getAuthIdentifierName method to return the primary key field of your table/model

/**
 * Get the name of the unique identifier for the user.
 *
 * @return string
 */
public function getAuthIdentifierName()
{
    return 'id';
}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

whtchk whtchk Joined 1 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.