3 Commits

Author SHA1 Message Date
bbcffe64b7 Fix LDAP authentication failures
All checks were successful
linter / quality (pull_request) Successful in 1m35s
security / Dependency Audit (pull_request) Successful in 1m19s
security / Static Analysis (pull_request) Successful in 1m32s
tests / ci (8.4) (pull_request) Successful in 2m36s
tests / ci (8.5) (pull_request) Successful in 1m37s
- Add missing LDAP env vars to .env.example (host, base DN, bind credentials)
- Use 'uid' instead of 'username' as the LDAP lookup attribute in Auth::attempt
- Override getLdapGuidColumn/getLdapDomainColumn in User model to match
  migration column names (ldap_guid/ldap_domain vs default guid/domain)
2026-03-06 02:34:46 +00:00
5f0b4218ae Merge pull request 'Add phpLDAPadmin for LDAP user management' (#5) from feature/phpldapadmin into master
All checks were successful
linter / quality (push) Successful in 1m20s
security / Dependency Audit (push) Successful in 1m30s
security / Static Analysis (push) Successful in 1m37s
tests / ci (8.4) (push) Successful in 1m27s
tests / ci (8.5) (push) Successful in 1m29s
Reviewed-on: #5
2026-03-06 09:43:41 +08:00
38b1dd0f4d Add phpLDAPadmin service for LDAP user management
All checks were successful
linter / quality (pull_request) Successful in 1m23s
security / Dependency Audit (pull_request) Successful in 1m20s
security / Static Analysis (pull_request) Successful in 1m26s
tests / ci (8.4) (pull_request) Successful in 1m37s
tests / ci (8.5) (pull_request) Successful in 1m30s
Accessible at localhost:8085 (configurable via FORWARD_PHPLDAPADMIN_PORT).
Login with cn=admin,dc=travel,dc=local and the LDAP admin password.
2026-03-06 01:42:03 +00:00
4 changed files with 29 additions and 1 deletions

View File

@@ -63,3 +63,10 @@ AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}" 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

View File

@@ -64,6 +64,16 @@ class User extends Authenticatable implements FilamentUser, LdapAuthenticatable
return $this->hasRole('administrator'); return $this->hasRole('administrator');
} }
public function getLdapGuidColumn(): string
{
return 'ldap_guid';
}
public function getLdapDomainColumn(): string
{
return 'ldap_domain';
}
public function emergencyContacts(): HasMany public function emergencyContacts(): HasMany
{ {
return $this->hasMany(EmergencyContact::class); return $this->hasMany(EmergencyContact::class);

View File

@@ -115,6 +115,17 @@ services:
- '${LDAP_ADMIN_PASSWORD:-adminpassword}' - '${LDAP_ADMIN_PASSWORD:-adminpassword}'
retries: 3 retries: 3
timeout: 5s timeout: 5s
phpldapadmin:
image: 'osixia/phpldapadmin:latest'
ports:
- '${FORWARD_PHPLDAPADMIN_PORT:-8085}:80'
environment:
PHPLDAPADMIN_LDAP_HOSTS: openldap
PHPLDAPADMIN_HTTPS: 'false'
networks:
- sail
depends_on:
- openldap
networks: networks:
sail: sail:
driver: bridge driver: bridge

View File

@@ -18,7 +18,7 @@ new #[Layout('components.layouts.guest')] class extends Component {
{ {
$this->validate(); $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(); session()->regenerate();
$this->redirectIntended(route('dashboard'), navigate: true); $this->redirectIntended(route('dashboard'), navigate: true);
return; return;