'Return list of challenge preferences.
:param str domain: domain for which you are requesting preferences'

def _get_chall_pref(self, domain):

    chall_prefs = []
    plugin_pref = self.auth.get_chall_pref(domain)
    if self.pref_challs:
        plugin_pref_types = set((chall.typ for chall in plugin_pref))
        for typ in self.pref_challs:
            if (typ in plugin_pref_types):
                chall_prefs.append(challenges.Challenge.TYPES[typ])
        if chall_prefs:
            return chall_prefs
        raise errors.AuthorizationError('None    of    the    preferred    challenges    are    supported    by    the    selected    plugin')
    chall_prefs.extend(plugin_pref)
    return chall_prefs
