improve logging of LDAP login process (#529)
Some checks failed
Docker / Build and Push (push) Has been cancelled
github-pages / deploy (push) Has been cancelled
Docker / release (push) Has been cancelled

This commit is contained in:
Christoph Haas
2025-09-17 22:33:54 +02:00
parent 7cd7d13dc7
commit afb38b685c

View File

@@ -364,6 +364,7 @@ func (a *Authenticator) passwordAuthentication(
} }
ldapUserInfo, err = ldapAuth.ParseUserInfo(rawUserInfo) ldapUserInfo, err = ldapAuth.ParseUserInfo(rawUserInfo)
if err != nil { if err != nil {
slog.Error("failed to parse ldap user info", "identifier", identifier, "error", err)
continue continue
} }
@@ -376,10 +377,13 @@ func (a *Authenticator) passwordAuthentication(
} }
if userSource == "" { if userSource == "" {
slog.Warn("no user source found for user", "identifier", identifier, "ldapProviderCount", a.ldapAuthenticators)
return nil, errors.New("user not found") return nil, errors.New("user not found")
} }
if userSource == domain.UserSourceLdap && ldapProvider == nil { if userSource == domain.UserSourceLdap && ldapProvider == nil {
slog.Warn("no ldap provider found for user",
"identifier", identifier, "ldapProviderCount", a.ldapAuthenticators)
return nil, errors.New("ldap provider not found") return nil, errors.New("ldap provider not found")
} }