Repository navigation
feat(semantic-layer): support per-user OAuth2 authentication - #45894
Open
betodealmeida wants to merge 12 commits into
Open
betodealmeida wants to merge 12 commits into
betodealmeida wants to merge 12 commits into
Conversation
betodealmeida
requested review from
geido,
michael-s-molina,
msyavuz,
rusackas,
sadpandajoe and
villebro
as code owners
October 30, 2026 17:17
betodealmeida
force-pushed
the
sl-oauth2
branch
from
October 30, 2026 17:48
9a5af7e to
76ee7e9
Compare
sadpandajoe
reviewed
Oct 30, 2026
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #45894 +/- ##
===========================================
- Coverage 84.73% 65.61% -19.12%
===========================================
Files 3069 3072 +3
Lines 205767 206332 +565
Branches 48388 48508 +120
===========================================
- Hits 174350 135381 -38969
- Misses 28123 67872 +39749
+ Partials 3294 3079 -215
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Adds support for per-user OAuth2 authentication in Semantic Layer extensions.
With this PR, extensions can now store access and refresh tokens in encrypted, user-scoped storage that is unavailable through browser-facing extension storage APIs. Tokens remain scoped to the user who authorized access.
Semantic Layer extensions reuse Superset’s existing OAuth2 error handling and authorization UI. Authorization can be triggered from configuration dialogs, Explore, and dashboard queries. Completing authorization retries the interrupted operation. Semantic view metadata loading can require authentication before Explore renders, so that path displays the authorization prompt before loading the editor.
The change also preserves user identity in asynchronous query execution and partitions authenticated semantic-view caches by user.
A database migration adds the storage access classification. Downgrading permanently deletes backend-only secrets to prevent them from becoming browser-accessible; this behavior is documented in
UPDATING.md.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: opening a semantic-view chart without credentials could show a permission error and “Missing datasource,” with no way to authorize access.
After: Superset displays an OAuth2 authorization link and reloads the chart after authorization completes.
Note that the behavior in Explore is slightly different with semantic views compared to datasets: with a dataset that needs OAuth2, Explore will render with metrics/columns/controls, but the dataset component will ask for auth. For semantic views, Explore doesn't know what metrics and columns exist until the user authenticates, since that information lives in the semantic layer, not in Superset. Because of this, the whole Explore UI is replaced by the authentication prompt.
TESTING INSTRUCTIONS
I wrote the specification for a generic RESTful semantic layer API at https://github.com/betodealmeida/sl-rest-api. The API is a 1:1 mapping of the Superset semantic layer Python API to JSON requests. In addition to the spec itself, the repo has:
I'm also in the process of implementing the API in DataJunction, so that Superset can be used with it: DataJunction/dj#2661
A simple way of testing this PR:
demo-clientdemo-secretADDITIONAL INFORMATION