PHP Trait Adldap\Laravel\Traits\AuthenticatesUsers

Inheritance: use trait UsesAdldap
Show file Open project: Adldap2/Adldap2-Laravel

Public Methods

Method Description
getLoginUsernameFromUser ( User $user ) : string Retrieves the configured login username from the LDAP user.
retrieveByCredentials ( array $credentials = [] ) : Illuminate\Contracts\Auth\Authenticatable | null Retrieves an LDAP user by their credentials.

Protected Methods

Method Description
authenticate ( string $username, string $password ) : boolean Authenticates a user against our default LDAP connection.
getLoginAttribute ( ) : string Returns the configured login attribute for authenticating users.
getLoginFallback ( ) : boolean Retrieves the Adldap login fallback option for falling back to the local database if AD authentication fails.
getPasswordFromCredentials ( array $credentials = [] ) : string Returns the configured users password from the credentials array.
getPasswordKey ( ) : mixed Returns the password key to retrieve the password from the user input array.
getUsernameAttribute ( ) : array Returns the configured username attribute for discovering LDAP users.
getUsernameFromCredentials ( array $credentials = [] ) : string Returns the username from the specified credentials.
getUsernameKey ( ) : string Returns the configured username key.
getUsernameValue ( ) : string Returns the configured username value.
handleAuthenticatedModelTrashed ( User $user, Illuminate\Contracts\Auth\Authenticatable $model ) : void Handle an authenticated users model that has been soft deleted.
handleAuthenticatedWithCredentials ( User $user, Illuminate\Contracts\Auth\Authenticatable $model ) : void Handle an authenticated LDAP user with their model.
handleDiscoveredUserWithCredentials ( User $user ) : void Handle discovered LDAP users before they are authenticated.
isConnected ( ) : boolean Checks if we're currently connected to our configured LDAP server.

Method Details

authenticate() protected method

Authenticates a user against our default LDAP connection.
protected authenticate ( string $username, string $password ) : boolean
$username string
$password string
return boolean

getLoginAttribute() protected method

Returns the configured login attribute for authenticating users.
protected getLoginAttribute ( ) : string
return string

getLoginFallback() protected method

Retrieves the Adldap login fallback option for falling back to the local database if AD authentication fails.
protected getLoginFallback ( ) : boolean
return boolean

getLoginUsernameFromUser() public method

Retrieves the configured login username from the LDAP user.
public getLoginUsernameFromUser ( User $user ) : string
$user Adldap\Models\User
return string

getPasswordFromCredentials() protected method

Returns the configured users password from the credentials array.
protected getPasswordFromCredentials ( array $credentials = [] ) : string
$credentials array
return string

getPasswordKey() protected method

Returns the password key to retrieve the password from the user input array.
protected getPasswordKey ( ) : mixed
return mixed

getUsernameAttribute() protected method

Returns the configured username attribute for discovering LDAP users.
protected getUsernameAttribute ( ) : array
return array

getUsernameFromCredentials() protected method

Returns the username from the specified credentials.
protected getUsernameFromCredentials ( array $credentials = [] ) : string
$credentials array
return string

getUsernameKey() protected method

For example: 'email' or 'username'.
protected getUsernameKey ( ) : string
return string

getUsernameValue() protected method

For example: 'samaccountname' or 'mail'.
protected getUsernameValue ( ) : string
return string

handleAuthenticatedModelTrashed() protected method

Handle an authenticated users model that has been soft deleted.
protected handleAuthenticatedModelTrashed ( User $user, Illuminate\Contracts\Auth\Authenticatable $model ) : void
$user Adldap\Models\User
$model Illuminate\Contracts\Auth\Authenticatable
return void

handleAuthenticatedWithCredentials() protected method

Handle an authenticated LDAP user with their model.
protected handleAuthenticatedWithCredentials ( User $user, Illuminate\Contracts\Auth\Authenticatable $model ) : void
$user Adldap\Models\User
$model Illuminate\Contracts\Auth\Authenticatable
return void

handleDiscoveredUserWithCredentials() protected method

Handle discovered LDAP users before they are authenticated.
protected handleDiscoveredUserWithCredentials ( User $user ) : void
$user Adldap\Models\User
return void

isConnected() protected method

Checks if we're currently connected to our configured LDAP server.
protected isConnected ( ) : boolean
return boolean

retrieveByCredentials() public method

Retrieves an LDAP user by their credentials.
public retrieveByCredentials ( array $credentials = [] ) : Illuminate\Contracts\Auth\Authenticatable | null
$credentials array
return Illuminate\Contracts\Auth\Authenticatable | null