def get_user_info(auth_version, auth_url, access_key, user_domain_name,
                  secret_key, tenant_name, project_domain_name):
    """Returns an Swift User with .display_name and .id, or None
    """
    if not (auth_version and auth_url and access_key and secret_key and tenant_name):
        return None

    if auth_version == '2':
        return {'display_name': '{}@{} on {}'.format(access_key, tenant_name, auth_url),
                'id': '{}-{}-{}'.format(auth_url, tenant_name, access_key)}
    elif auth_version == '3':
        if not (user_domain_name and project_domain_name):
            return None
        return {'display_name': '{}@{} {}@{} on {}'.format(access_key,
                                                           user_domain_name,
                                                           tenant_name,
                                                           project_domain_name,
                                                           auth_url),
                'id': '{}-{}-{}-{}-{}'.format(auth_url, tenant_name,
                                              project_domain_name,
                                              access_key, user_domain_name)}
    else:
        return None