Skip to content

Commit 364175a

Browse files
authored
feat: try anonymous bind when bind credentials are empty (#979)
1 parent 73cc480 commit 364175a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

internal/service/ldap_service.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ func (ldap *LdapService) BindService(rebind bool) error {
246246
if ldap.cert != nil {
247247
return ldap.conn.ExternalBind()
248248
}
249+
250+
// attempt unauthenticated/anonymous bind if both BindDN and bindpw are unset
251+
if ldap.config.LDAP.BindDN == "" && ldap.bindPw == "" {
252+
return ldap.conn.UnauthenticatedBind("")
253+
}
254+
249255
return ldap.conn.Bind(ldap.config.LDAP.BindDN, ldap.bindPw)
250256
}
251257

0 commit comments

Comments
 (0)