LDAP_USER_BASEDN

This commit is contained in:
mr
2026-02-02 10:36:31 +01:00
parent 0e86777fd3
commit f56b947e1f

View File

@@ -374,10 +374,10 @@ func (cli *Client) findRoles(cn conn, attrs ...string) (map[string]LDAPRoles, er
// findBasicUserDetails finds user's LDAP attributes that were specified. It returns nil if no such user.
func (cli *Client) findBasicUserDetails(cn conn, username string, attrs []string) (map[string][]string, error) {
fmt.Println("Second woth : ", cli.BindDN, cli.BindPass)
if cli.BindDN != "" {
fmt.Println("Second woth : ", cli.UserBaseDN, cli.BindPass)
if cli.UserBaseDN != "" {
// We need to login to a LDAP server with a service account for retrieving user data.
if err := cn.Bind(cli.BindDN, cli.BindPass); err != nil {
if err := cn.Bind(cli.UserBaseDN, cli.BindPass); err != nil {
return nil, errors.New(err.Error() + " : failed to login to a LDAP woth a service account")
}
}