'Returns the a mapping from authentication flags to their status,
showing only those authentication flags that are supported on
the current server (i.e. if EmailAuthBackend is not configured
on the server, this will not return an entry for "Email").'

def authentication_methods_dict(self):

    from zproject.backends import AUTH_BACKEND_NAME_MAP
    ret = {}
    supported_backends = {backend.__class__ for backend in django.contrib.auth.get_backends()}
    for (k, v) in self.authentication_methods.iteritems():
        backend = AUTH_BACKEND_NAME_MAP[k]
        if (backend in supported_backends):
            ret[k] = v
    return ret
