Skip to content

AdminListGroupsForUser incorrectly returns empty list when UsernameAttribute is set #405

@kadyrleev

Description

@kadyrleev

I might be wrong but looks like when UsernameAttribute is set to "email" then AdminListGroupsForUser incorrectly returns an empty list for users that do have groups assigned.

This happens because users are added to groups as their sub:

groupMembers.add(user.Username);

And the underlying AdminListGroupsForUser target function is matching member by the request Username which is expected to be user's email rather than sub:

const usersGroups = groups.filter((x) => x.members?.includes(req.Username));

We're currently patching the AdminListGroupsForUser target to use user.Username and this hasn't been tested when UsernameAttribute is not set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions