LDAP_USER_BASEDN
This commit is contained in:
@@ -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.
|
// 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) {
|
func (cli *Client) findBasicUserDetails(cn conn, username string, attrs []string) (map[string][]string, error) {
|
||||||
fmt.Println("Second woth : ", cli.BindDN, cli.BindPass)
|
fmt.Println("Second woth : ", cli.UserBaseDN, cli.BindPass)
|
||||||
if cli.BindDN != "" {
|
if cli.UserBaseDN != "" {
|
||||||
// We need to login to a LDAP server with a service account for retrieving user data.
|
// 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")
|
return nil, errors.New(err.Error() + " : failed to login to a LDAP woth a service account")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user