feat: try anonymous bind when bind credentials are empty (#979)

This commit is contained in:
nv6
2026-07-08 10:11:30 -04:00
committed by GitHub
parent 73cc4808bc
commit 364175adc0
+6
View File
@@ -246,6 +246,12 @@ func (ldap *LdapService) BindService(rebind bool) error {
if ldap.cert != nil {
return ldap.conn.ExternalBind()
}
// attempt unauthenticated/anonymous bind if both BindDN and bindpw are unset
if ldap.config.LDAP.BindDN == "" && ldap.bindPw == "" {
return ldap.conn.UnauthenticatedBind("")
}
return ldap.conn.Bind(ldap.config.LDAP.BindDN, ldap.bindPw)
}