Closed SelfDevTV closed 3 years ago
Would you like to send a Pull Request to address this issue? Remember to add unit tests.
I am interested to know if this issue may affect me too, so I want to look into it. Are you willing to send me more logging? I mean in fact the whole log (except the first couple of lines where the authentication happens). The snippet of 3 selected lines, where names are censored, does not give any clue at all. You can send it to me in private message if you want.
Thank you very much @jurjendijkstra I will have a deeper look in a couple of days. Im on holiday right now and have no access to the company code right now.
Alrighty @jurjendijkstra
I have now enabled logging and I will send you detailed informations via pn. Thx in advance!
Spoiler: It is a huuuuge list of all the users in the group. But only the end of the log is interesting:
Scenario:
1 group (X) with 2 sub groups (Y and Z ) and no direct users
group x has 2 sub groups: group y and group z
group y and z both have only direct members.
Here is the screenshot (I want to receive all members from group X):
The code from the route:
app.post("/api/getGroupMembers", (req, res) => {
const group = req.body.group;
console.log("called /api/getGroupMembers with group " + group);
ad.getUsersForGroup(group, (err, users) => {
if (err) {
console.log("error in getUsers", err);
}
console.log("this are the results", users);
res.send(users);
});
});
The problem:
So at the end of the log it shows that 1 users is in group X but it should be users from group Y + group Z combined. 640 in total. But somehow it's just pulling out one random users it seems and returns this. Here is the bug somewhere, but I have no idea where to look for. Maybe you have more insights into this package and are more familiar with it.
Edit: How can I send you a pn on github? Can't find anything to send you a pn
@jurjendijkstra Any chance to solve this problem? Any ideas where I should start to look for? I'm so close to finish my webapp, just this one nasty bug ist left (which isn't in the previous version of the package) :D
Please see the notice at the top of this module's README.
I recommend creating the smallest reproduction case possible and stepping through with the debugger to see where the problem occurs.
This has been solved. Attribute dn
is required in the config
. For example:
var config = {
url: "your url",
//....,
attributes: {
user: [
// attributes you want and plus,
"dn"
],
group: [
//attributes you want plus:
"dn"
]
}
}
Hiho,
Today I stumbled over a bug:
I have a group with 2 sub groups. Both have combined ~a bit over 1000 Users~ 640 Users:
The result I get ist just one random user from one of those sub groups. It's always this user.
When I turn on logging I can see this:
The last line where it says "1 user belong.." this is the user I receive back when I res.send those results.
If I use a group with 3000+ direct users it will work just fine.
I tried it with several groups that have subgroups. The result is always the same.
Here is the code:
EDIT: it seems to work with "activedirectory" package, the one I use and it isn't working is this: "activedirectory2". Edit2: I have added this group that does not work to my test group with 5 users in it. The result is this, when I query the testgroup:
I get the 5 users in the group and again this one random user from this big group with sub groups. So 6 in total.