mirror of https://github.com/portainer/portainer
fix(settings/authentication): patch LDAP connectivity check (#3561)
parent
d3a625e22f
commit
1f7e5fec4f
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/portainer/portainer/api"
|
portainer "github.com/portainer/portainer/api"
|
||||||
"github.com/portainer/portainer/api/crypto"
|
"github.com/portainer/portainer/api/crypto"
|
||||||
|
|
||||||
"gopkg.in/ldap.v2"
|
"gopkg.in/ldap.v2"
|
||||||
|
@ -178,11 +178,9 @@ func (*Service) TestConnectivity(settings *portainer.LDAPSettings) error {
|
||||||
}
|
}
|
||||||
defer connection.Close()
|
defer connection.Close()
|
||||||
|
|
||||||
if !settings.AnonymousMode {
|
|
||||||
err = connection.Bind(settings.ReaderDN, settings.Password)
|
err = connection.Bind(settings.ReaderDN, settings.Password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue