Skip to content

Commit 192dfd4

Browse files
committed
docs: consolidate OAuth2/OIDC authentication documentation
- Move scattered implementation notes into structured RST documentation - Add comprehensive authentication guide covering all methods - Add quick reference cheatsheet with provider examples - Enhance installation guide with detailed setup and troubleshooting - Reorganize self-hosted setup guide with provider-specific instructions (Keycloak, Okta, Auth0, Azure AD, Cognito) - Update README.md with OAuth2 support summary and documentation links - Follow repository documentation standards (lowercase .rst in /docs/) Documentation now covers: - Preset workspace authentication (API tokens) - Self-hosted Superset with OAuth2/OIDC (recommended) - Username/password authentication - JWT token authentication - Security best practices and troubleshooting
1 parent 10aac25 commit 192dfd4

5 files changed

Lines changed: 1828 additions & 14 deletions

File tree

README.md

Lines changed: 68 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,74 @@ Efficient search across all entity types:
220220
extensively tested with Preset workspaces. All features work seamlessly with
221221
Preset's multi-workspace environment.
222222

223-
### Self-Hosted Superset
224-
**Does it work with my Superset instance?** Most functionality should work, but
225-
depending on your authentication setup, you may need to tweak the code. We
226-
welcome contributions from the broader Superset community to improve
227-
compatibility.
228-
229-
**Preset-free mode**: A future version could remove multi-workspace constructs
230-
for single-instance Superset deployments. If you're interested in this, please
231-
contribute or open an issue.
232-
233-
### Contributing for Broader Compatibility
234-
We're open to contributions that enable 'sup for the entire Superset community.
235-
Areas that likely need work for self-hosted instances:
236-
- Authentication methods beyond Preset API tokens
223+
### Self-Hosted Superset ✨ (NEW!)
224+
**Phase 1 Implementation Complete:** Full support for self-hosted Superset with OAuth2/OIDC authentication!
225+
226+
'sup now supports **self-hosted Superset instances** with multiple authentication methods:
227+
- **OAuth2/OIDC** - Works with Keycloak, Okta, Auth0, Dex, Azure AD, Cognito
228+
- **Username/Password** - Direct Superset authentication
229+
- **JWT Tokens** - Pre-generated JWT tokens
230+
231+
#### Quick Setup for Self-Hosted Superset
232+
233+
```bash
234+
# Configure self-hosted instance in ~/.sup/config.yml
235+
superset_instances:
236+
production:
237+
url: https://superset.example.com
238+
auth_method: oauth
239+
oauth_token_url: https://auth.example.com/oauth2/token
240+
oauth_client_id: superset-cli
241+
oauth_client_secret: ${ENV:SUPERSET_OAUTH_SECRET}
242+
oauth_username: superset-service
243+
oauth_password: ${ENV:SUPERSET_SERVICE_PASSWORD}
244+
245+
# Set environment variables
246+
export SUPERSET_OAUTH_SECRET="your-client-secret"
247+
export SUPERSET_SERVICE_PASSWORD="your-service-password"
248+
249+
# Use 'sup with your self-hosted instance
250+
sup dataset list
251+
sup chart pull --mine
252+
sup sql "SELECT * FROM your_table"
253+
```
254+
255+
#### Authentication Methods for Self-Hosted Superset
256+
257+
**OAuth2/OIDC (Recommended)** - For instances with external authentication:
258+
```yaml
259+
auth_method: oauth
260+
oauth_token_url: https://auth.example.com/oauth2/token
261+
oauth_client_id: your-client-id
262+
oauth_client_secret: ${ENV:OAUTH_SECRET}
263+
oauth_username: service-account
264+
oauth_password: ${ENV:SERVICE_PASSWORD}
265+
```
266+
267+
**Username/Password** - For direct Superset authentication:
268+
```yaml
269+
auth_method: username_password
270+
username: admin
271+
password: ${ENV:SUPERSET_PASSWORD}
272+
```
273+
274+
**JWT Token** - For pre-generated JWT tokens:
275+
```yaml
276+
auth_method: jwt
277+
jwt_token: eyJhbGc...
278+
```
279+
280+
#### Complete Self-Hosted Setup Guide
281+
See **[Self-Hosted Superset Setup Guide](docs/self_hosted_setup.rst)** for:
282+
- Step-by-step OAuth2 configuration
283+
- Provider-specific examples (Keycloak, Okta, Auth0, Azure AD)
284+
- Troubleshooting guide
285+
- Security best practices
286+
287+
#### Contributing for Broader Compatibility
288+
We're open to contributions that extend 'sup for the entire Superset community.
289+
Areas we're actively working on:
290+
- Additional authentication methods
237291
- Single-instance mode (removing workspace concepts)
238292
- Different API endpoint structures
239293

docs/authentication.rst

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
Authentication
2+
==============
3+
4+
sup supports multiple authentication methods for Preset and self-hosted Superset instances.
5+
6+
Preset Workspaces
7+
-----------------
8+
9+
API Token (Recommended)
10+
~~~~~~~~~~~~~~~~~~~~~~~
11+
12+
Use API token and secret from Preset workspace settings:
13+
14+
.. code-block:: bash
15+
16+
export SUP_PRESET_API_TOKEN="your-token"
17+
export SUP_PRESET_API_SECRET="your-secret"
18+
19+
Or configure in ``~/.sup/config.yml``:
20+
21+
.. code-block:: yaml
22+
23+
preset:
24+
api_token: ${ENV:PRESET_API_TOKEN}
25+
api_secret: ${ENV:PRESET_API_SECRET}
26+
27+
Self-Hosted Superset
28+
--------------------
29+
30+
Configure instances in ``~/.sup/config.yml`` under ``superset_instances``.
31+
32+
OAuth2/OIDC (Recommended)
33+
~~~~~~~~~~~~~~~~~~~~~~~~~
34+
35+
For instances with external identity providers (Keycloak, Okta, Auth0, Azure AD, Cognito, Dex):
36+
37+
.. code-block:: yaml
38+
39+
superset_instances:
40+
production:
41+
url: https://superset.example.com
42+
auth_method: oauth
43+
oauth_token_url: https://auth.example.com/oauth2/token
44+
oauth_client_id: superset-cli
45+
oauth_client_secret: ${ENV:SUPERSET_OAUTH_SECRET}
46+
oauth_username: superset-service
47+
oauth_password: ${ENV:SUPERSET_SERVICE_PASSWORD}
48+
oauth_scope: "openid profile email"
49+
50+
Set environment variables:
51+
52+
.. code-block:: bash
53+
54+
export SUPERSET_OAUTH_SECRET="your-client-secret"
55+
export SUPERSET_SERVICE_PASSWORD="your-service-password"
56+
57+
Benefits:
58+
59+
- Centralized identity management
60+
- Automatic token refresh with 5-minute safety buffer
61+
- No passwords in config files
62+
- Works with service accounts
63+
64+
Username/Password
65+
~~~~~~~~~~~~~~~~~
66+
67+
For instances with built-in Superset authentication:
68+
69+
.. code-block:: yaml
70+
71+
superset_instances:
72+
production:
73+
url: https://superset.example.com
74+
auth_method: username_password
75+
username: superset-service
76+
password: ${ENV:SUPERSET_PASSWORD}
77+
78+
JWT Token
79+
~~~~~~~~~
80+
81+
For pre-generated JWT tokens:
82+
83+
.. code-block:: yaml
84+
85+
superset_instances:
86+
production:
87+
url: https://superset.example.com
88+
auth_method: jwt
89+
jwt_token: ${ENV:SUPERSET_JWT_TOKEN}
90+
91+
Security Best Practices
92+
-----------------------
93+
94+
1. **Use environment variables for secrets**
95+
96+
.. code-block:: yaml
97+
98+
oauth_client_secret: ${ENV:SUPERSET_OAUTH_SECRET}
99+
password: ${ENV:SUPERSET_PASSWORD}
100+
101+
2. **Protect config files**
102+
103+
.. code-block:: bash
104+
105+
chmod 600 ~/.sup/config.yml
106+
107+
3. **Create dedicated service accounts** (not personal user accounts)
108+
109+
- Limit permissions to required scope
110+
- Use strong, unique passwords
111+
112+
4. **Never commit secrets to git**
113+
114+
- Add ``.env`` files to ``.gitignore``
115+
- Use secrets management in CI/CD
116+
117+
5. **Rotate credentials regularly**
118+
119+
- Change client secrets in OIDC provider
120+
- Update passwords periodically
121+
122+
Provider-Specific Setup
123+
-----------------------
124+
125+
See :doc:`self_hosted_setup` for step-by-step instructions for:
126+
127+
- Keycloak
128+
- Okta
129+
- Auth0
130+
- Azure AD
131+
- Amazon Cognito
132+
133+
Includes configuration examples, troubleshooting, and detailed security guidance.

0 commit comments

Comments
 (0)