mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
fix(settings/authentication): patch LDAP connectivity check (#3561)
This commit is contained in:
parent
d3a625e22f
commit
1f7e5fec4f
1 changed files with 4 additions and 6 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue