private Collection<String> getAuthorized(String authzid) {
        // Un-escape Node
        authzid = JID.unescapeNode(authzid);

        Collection<String> authorized = new ArrayList<>();
        DirContext ctx = null;
        try {
            Rdn[] userRDN = manager.findUserRDN(authzid);
            // Load record.
            String[] attributes = new String[]{
                    usernameField,
                    authorizeField
            };
            ctx = manager.getContext();
            Attributes attrs = ctx.getAttributes(LdapManager.escapeForJNDI(userRDN), attributes);
            Attribute authorizeField_a = attrs.get(authorizeField);
            if (authorizeField_a != null) {
                for (Enumeration<?> e = authorizeField_a.getAll(); e.hasMoreElements();) {
                    authorized.add((String)e.nextElement());
                }
            }

            return authorized;
        }
        catch (Exception ex) {
            Log.debug("An exception occurred while trying to retrieve authorized principals for user {}.", authzid, ex);
        }
        finally {
            try {
                if (ctx != null) {
                    ctx.close();
                }
            }
            catch (Exception ex) {
                Log.debug("An exception occurred while trying to close a LDAP context after trying to retrieve authorized principals for user {}.", authzid, ex);
            }
        }
        return authorized;
    }
Returns a collection of XMPP authentication identities (or 'principals') that are authorized to use the XMPP
authorization identity (identity to act as) as provided in the argument of this method.

@param authzid XMPP authorization identity (identity to act as).
@return A collection of XMPP authentication identities (or 'principals') that are authorized to use the authzid
xmppserver/src/main/java/org/jivesoftware/openfire/ldap/LdapAuthorizationPolicy.java