diff --git a/.env.example b/.env.example index c0660ea..5151ad2 100644 --- a/.env.example +++ b/.env.example @@ -63,3 +63,10 @@ AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false VITE_APP_NAME="${APP_NAME}" + +LDAP_HOST=openldap +LDAP_USERNAME="cn=admin,dc=travel,dc=local" +LDAP_PASSWORD=adminpassword +LDAP_PORT=389 +LDAP_BASE_DN="dc=travel,dc=local" +LDAP_LOGGING=true diff --git a/app/Models/User.php b/app/Models/User.php index 495b9cd..bd228d8 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -64,6 +64,16 @@ class User extends Authenticatable implements FilamentUser, LdapAuthenticatable return $this->hasRole('administrator'); } + public function getLdapGuidColumn(): string + { + return 'ldap_guid'; + } + + public function getLdapDomainColumn(): string + { + return 'ldap_domain'; + } + public function emergencyContacts(): HasMany { return $this->hasMany(EmergencyContact::class); diff --git a/resources/views/livewire/auth/login.blade.php b/resources/views/livewire/auth/login.blade.php index 859e7bf..7c9a3de 100644 --- a/resources/views/livewire/auth/login.blade.php +++ b/resources/views/livewire/auth/login.blade.php @@ -18,7 +18,7 @@ new #[Layout('components.layouts.guest')] class extends Component { { $this->validate(); - if (Auth::attempt(['username' => $this->username, 'password' => $this->password], $this->rememberMe)) { + if (Auth::attempt(['uid' => $this->username, 'password' => $this->password], $this->rememberMe)) { session()->regenerate(); $this->redirectIntended(route('dashboard'), navigate: true); return;