mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-07-08 19:20:19 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 364175adc0 |
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user