Fix outdated AdLdap2 configuration files

This commit is contained in:
bpatath 2020-05-21 17:01:54 +02:00
parent 782ecca6a9
commit 1eda806c17
3 changed files with 31 additions and 37 deletions

View File

@ -82,14 +82,8 @@ class LoginController extends Controller
Log::channel('audit')->info(sprintf('User is trying to login using "%s"', $request->get('email')));
Log::info(sprintf('User is trying to login.'));
if ('ldap' === config('auth.providers.users.driver')) {
/**
* Temporary bug fix for something that doesn't seem to work in
* AdLdap.
*/
$schema = config('ldap.connections.default.schema');
/** @var Adldap\Connections\Provider $provider */
Adldap::getProvider('default')->setSchema(new $schema);
Adldap::getProvider('default');
}
$this->validateLogin($request);

View File

@ -87,29 +87,6 @@ return [
'connection' => Adldap\Connections\Ldap::class,
/*
|--------------------------------------------------------------------------
| Schema
|--------------------------------------------------------------------------
|
| The schema class to use for retrieving attributes and generating models.
|
| You can also set this option to `null` to use the default schema class.
|
| For OpenLDAP, you must use the schema:
|
| Adldap\Schemas\OpenLDAP::class
|
| For FreeIPA, you must use the schema:
|
| Adldap\Schemas\FreeIPA::class
|
| Custom schema classes must implement Adldap\Schemas\SchemaInterface
|
*/
'schema' => $schema,
/*
|--------------------------------------------------------------------------
| Connection Settings
@ -123,6 +100,29 @@ return [
'settings' => [
/*
|--------------------------------------------------------------------------
| Schema
|--------------------------------------------------------------------------
|
| The schema class to use for retrieving attributes and generating models.
|
| You can also set this option to `null` to use the default schema class.
|
| For OpenLDAP, you must use the schema:
|
| Adldap\Schemas\OpenLDAP::class
|
| For FreeIPA, you must use the schema:
|
| Adldap\Schemas\FreeIPA::class
|
| Custom schema classes must implement Adldap\Schemas\SchemaInterface
|
*/
'schema' => $schema,
/*
|--------------------------------------------------------------------------
| Account Prefix

View File

@ -217,10 +217,10 @@ return [
| Windows Authentication Middleware (SSO)
|--------------------------------------------------------------------------
|
| Discover:
| Locate Users By:
|
| The 'discover' value is the users attribute you would
| like to locate LDAP users by in your directory.
| This value is the users attribute you would like to locate LDAP
| users by in your directory.
|
| For example, if 'samaccountname' is the value, then your LDAP server is
| queried for a user with the 'samaccountname' equal to the value of
@ -229,9 +229,9 @@ return [
| If a user is found, they are imported (if using the DatabaseUserProvider)
| into your local database, then logged in.
|
| Key:
| Server Key:
|
| The 'key' value represents the 'key' of the $_SERVER
| This value represents the 'key' of the $_SERVER
| array to pull the users account name from.
|
| For example, $_SERVER['AUTH_USER'].
@ -239,8 +239,8 @@ return [
*/
'windows' => [
'discover' => envNonEmpty('WINDOWS_SSO_DISCOVER', 'samaccountname'),
'key' => envNonEmpty('WINDOWS_SSO_KEY', 'AUTH_USER'),
'locate_users_by' => envNonEmpty('WINDOWS_SSO_DISCOVER', 'samaccountname'),
'server_key' => envNonEmpty('WINDOWS_SSO_KEY', 'AUTH_USER'),
],
],