public Set<String> getParentUserGroupIdentifiers(ConnectedLDAPConfiguration config, Dn userDN)
            throws GuacamoleException {

        Collection<String> attributes = config.getGroupNameAttributes();
        List<Entry> userGroups = getParentUserGroupEntries(config, userDN);

        Set<String> identifiers = new HashSet<>(userGroups.size());
        userGroups.forEach(entry -> {

            // Determine unique identifier for user group
            try {
                String name = queryService.getIdentifier(entry, attributes);
                if (name != null)
                    identifiers.add(name);

                // Ignore user groups which lack a name attribute
                else
                    logger.debug("User group \"{}\" is missing a name attribute "
                            + "and will be ignored.", entry.getDn().toString());
            }
            catch (LdapInvalidAttributeValueException e) {
                logger.error("User group missing identifier: {}",
                        e.getMessage());
                logger.debug("LDAP exception while getting group identifier.", e);
            }

        });

        return identifiers;

    }
Returns the identifiers of all user groups that the given user is a
member of. Only identifiers of user groups which are readable by the
current user will be retrieved.

@param config
    The configuration of the LDAP server being queried.

@param userDN
    The DN of the user whose group membership should be retrieved.

@return
    The identifiers of all readable parent user groups of the user
    having the given DN.

@throws GuacamoleException
    If an error occurs preventing retrieval of user groups.
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java