debug: temporäres LDAP-Logging für Fehlerdiagnose

This commit is contained in:
sysops
2026-04-01 00:05:35 +02:00
parent d7b01504aa
commit 5c3a9b55ff
+9
View File
@@ -89,8 +89,14 @@ func (m *Manager) Login(username, password string) (token string, user *userstor
if domain := extractDomain(username); domain != "" {
ctx := context.Background()
tenantID, lookupErr := m.tenantLookup.GetTenantIDByDomain(ctx, domain)
if lookupErr != nil {
fmt.Printf("[DEBUG] tenant domain lookup failed for %q: %v\n", domain, lookupErr)
}
if lookupErr == nil && tenantID != nil {
tcfg, tErr := m.tenantLdapStore.GetWithPassword(ctx, *tenantID)
if tErr != nil {
fmt.Printf("[DEBUG] tenant LDAP GetWithPassword failed: %v\n", tErr)
}
if tErr == nil && tcfg != nil && tcfg.Enabled && tcfg.URL != "" && tcfg.BindPassword != "" {
attrs, authErr := ldapauth.Authenticate(ldapauth.Config{
URL: tcfg.URL,
@@ -101,6 +107,9 @@ func (m *Manager) Login(username, password string) (token string, user *userstor
TLS: tcfg.TLS,
TLSSkipVerify: tcfg.TLSSkipVerify,
}, username, password)
if authErr != nil {
fmt.Printf("[DEBUG] tenant LDAP auth failed for %q: %v\n", username, authErr)
}
if authErr == nil {
role := tcfg.DefaultRole
if role == "" {