'Get valid tenants for token based on token used to authenticate.
Pulls the token from the context, validates it and gets the valid
tenants for the user in the token.
Doesn\'t care about token scopedness.'

@controller.v2_auth_deprecated
def get_projects_for_token(self, request, **kw):

    token_ref = authorization.get_token_ref(request.context_dict)
    tenant_refs = self.assignment_api.list_projects_for_user(token_ref.user_id)
    tenant_refs = [self.v3_to_v2_project(ref) for ref in tenant_refs if (ref['domain_id'] == CONF.identity.default_domain_id)]
    params = {'limit': request.params.get('limit'), 'marker': request.params.get('marker')}
    return self.format_project_list(tenant_refs, **params)
