Let live data sources query with each viewer's own sign-in

Open
#32,740 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start by reading the related credential policy issue SPK-2828 and the Salesforce issue SPK-2874. The proposal spans credential storage and refresh, query-time selection, user-scoped result caching, missing-sign-in prompts, scheduled deliveries, AI and MCP queries, and chart labels; inspect the existing per-user warehouse credential flow for entry points. Done means each opt-in live source uses the viewer's credential safely across these paths, with shared-sign-in sources retaining current behavior.

Written by the indexing model from the issue text.

Description

Feature

Why

Every live data source uses one shared sign-in, so everyone in the project sees what that one account can see. For integrations whose permissions differ by person, such as CRMs, project tools and ticketing, that is either too much (one admin token exposes every record) or too little (a narrow token hides data people are entitled to). Customers want the integration's own permissions to apply, without rebuilding them in Lightdash.

Salesforce is the reference case: with per-user OAuth, a rep sees only their own pipeline and a manager sees the team's, from the same dashboard, with Salesforce enforcing sharing rules and field-level security.

Today

viewer A ─┐
viewer B ─┼──▶ live data source ──▶ one shared sign-in ──▶ integration API
viewer C ─┘                         (same data for all)

Proposed

viewer A ──▶ live data source ──▶ A's sign-in ──▶ integration API  (A's records)
viewer B ──▶ live data source ──▶ B's sign-in ──▶ integration API  (B's records)
viewer C ──▶ live data source ──▶ no sign-in  ──▶ "Connect your <integration>"
  • Per source, opt-in. An admin chooses "shared sign-in" (today's behaviour, the default) or "each user signs in" when creating a live data source. Marketing integrations (GA4, Search Console, ads) keep a shared sign-in.
  • Shared definition, personal data. The source, its explores and fields stay project-wide. Only the credential used at query time is per user, so a chart looks the same but shows each viewer their own numbers.
  • Prior art. Warehouse connections already support per-user credentials (Snowflake, BigQuery, Databricks), with a sign-in prompt for users without them.

What has to change

  • Credentials: store one sign-in per user per live data source; look it up at query time; refresh and revoke per user.
  • Results cache: key live results by user for per-user sources, so one viewer's data is never served to another.
  • No sign-in: charts, Explore and dashboards show a "Connect your account" prompt instead of an error.
  • Field scans: discover the schema with the admin's sign-in at setup; field lists stay shared.
  • Scheduled deliveries and Slack previews: decide whose sign-in they use (creator, or refuse for per-user sources) and show it.
  • AI agent and MCP: queries run as the asking user.
  • Labelling: charts on per-user sources say "shown with your own access".

Out of scope

  • Private live data sources visible only to their owner.
  • Row or field restrictions defined in Lightdash (SPK-2975, SPK-2892).

Related

Dominant language
TypeScript
Stars
6.2k
Forks
809
Avg merge
12h 13m
Merged PRs (30d)
854

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lightdash/lightdash

All issues in lightdash/lightdash

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.