Skip to content

Commit 0b8170c

Browse files
authored
Merge pull request #521 from sigmacomputing/AI-Apps
AI Apps and security oauth revision
2 parents 1183777 + 20eb4e5 commit 0b8170c

File tree

3 files changed

+208
-16
lines changed

3 files changed

+208
-16
lines changed

site/app/images/aiapps.svg

Lines changed: 159 additions & 0 deletions
Loading

site/app/styles/_overrides.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $color-partners: #7a5144;
3838
$color-templates: #EC407A;
3939

4040
$icon-administration: 'administration.svg';
41-
$icon-aiapps: 'dataapps.svg';
41+
$icon-aiapps: 'aiapps.svg';
4242
$icon-dataapps: 'dataapps.svg';
4343
$icon-developers: 'developers.svg';
4444
$icon-embedding: 'embedding.svg';
@@ -61,7 +61,7 @@ $icon-templates: 'workbook-template.svg';
6161
@include codelab-card(['use-cases'], $color-use-cases, $icon-use-cases);
6262
@include codelab-card(['functions'], $color-functions, $icon-functions);
6363
@include codelab-card(['partners'], $color-partners, $icon-partners);
64-
@include codelab-card(['templates'], $color-templates, $icon-templates);
64+
@include codelab-card(['templates'], $color-templates, $icon-templates);
6565

6666
/** Categories in Use (so far):
6767
Administration

site/sigmaguides/src/security_oauth_pkce_secure_integration/security_oauth_pkce_secure_integration.md

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,30 @@ Here's how OAuth 2.0 works when a user accesses embedded Sigma content:
8585
<strong>KEY BENEFIT:</strong><br> OAuth 2.0 separates authentication from authorization, allowing fine-grained access control without sharing credentials.
8686
</aside>
8787

88+
### Connection-Level vs Organization-Level OAuth
89+
90+
When implementing OAuth with Sigma, you have two primary approaches for managing authentication:
91+
92+
**Connection-Level OAuth:**
93+
- Each user authenticates individually with the data platform (Databricks, Snowflake, etc.)
94+
- Tokens are scoped to specific connections
95+
- **Supports PKCE for enhanced security** (this is the key advantage)
96+
- Ideal for embedded scenarios where user identity and individual permissions matter
97+
- Each query runs with the authenticated user's credentials
98+
- Provides the strongest audit trail and access control
99+
100+
**Organization-Level OAuth:**
101+
- Uses a single service account or shared credentials for all users
102+
- All users query through the same organizational identity
103+
- Does not support PKCE
104+
- Simpler initial setup but less granular access control
105+
- Better for scenarios where all users have identical data permissions
106+
- Requires implementing Row-Level Security (RLS) separately if user-specific data access is needed
107+
108+
<aside class="positive">
109+
<strong>IMPORTANT:</strong><br> Sigma supports PKCE exclusively for connection-level OAuth. This is a key reason to choose connection-level authentication when implementing embedded analytics with user-specific data access requirements and enhanced security needs.
110+
</aside>
111+
88112
### Why OAuth 2.0 for Sigma Deployments?
89113

90114
**Security:**<br>
@@ -186,12 +210,14 @@ Consider an enterprise scenario where you want to embed Sigma dashboards into yo
186210
- Used for API requests
187211
- Included in request headers
188212
- Should never be logged or stored long-term
213+
- **Sigma Storage:** Access tokens are stored in buffer and encrypted using envelope encryption with AES256
189214

190215
**Refresh Tokens**
191-
- Longer-lived (days to months)
216+
- Longer-lived (up to 90 days)
192217
- Used to obtain new access tokens
193218
- Must be stored securely
194219
- Can be revoked by authorization server
220+
- **Sigma Storage:** Refresh tokens are stored in MySQL, encrypted using unique keys per customer. Encryption keys are housed in a separate key store for enhanced security
195221

196222
**Token Expiration Flow in Sigma**
197223
1. User views embedded Sigma dashboard, Sigma queries data with access token
@@ -256,29 +282,35 @@ OAuth 2.0 uses "scopes" to define what access a token grants. When Sigma integra
256282
## Integration Architecture Patterns
257283
Duration: 10
258284

259-
### Pattern 1: Direct User Authentication
285+
### Pattern 1: Connection-Level OAuth with PKCE (Direct User Authentication)
260286

261-
**Scenario:** Users authenticate directly with data platform before accessing Sigma
287+
**Scenario:** Users authenticate directly with data platform before accessing Sigma using connection-level OAuth with PKCE
262288

263289
**Flow:**
264290
1. User accesses embedded Sigma dashboard in your application
265-
2. Application redirects to Databricks OAuth login page
266-
3. User logs in with their Databricks credentials
267-
4. Databricks issues access token to your application
268-
5. Application passes token to Sigma via embed API
269-
6. Sigma queries Databricks using user's individual token and permissions
291+
2. Application generates PKCE code challenge and redirects to data platform OAuth login (e.g., Databricks)
292+
3. User logs in with their data platform credentials
293+
4. Data platform issues access token to your application after validating PKCE verifier
294+
5. Application passes encrypted token to Sigma via embed API
295+
6. Sigma queries data platform using user's individual token and permissions
270296

271297
**Pros:**
298+
- **Supports PKCE for enhanced security** - protects against authorization code interception
272299
- True user-level access control in Sigma - each user sees only their authorized data
273300
- Complete audit trail showing exactly which user ran which Sigma queries
274301
- No credential management in your application or Sigma connections
275-
- Leverages Databricks Unity Catalog row-level security automatically
302+
- Leverages platform-native security (e.g., Databricks Unity Catalog row-level security)
303+
- Strongest security posture for embedded analytics
276304

277305
**Cons:**
278-
- Requires all users to have individual Databricks accounts (licensing cost)
306+
- Requires all users to have individual data platform accounts (licensing cost)
279307
- Additional login step interrupts embedded Sigma user experience
280308
- More complex token management logic in your application
281309

310+
<aside class="positive">
311+
<strong>RECOMMENDED FOR:</strong><br> Connection-level OAuth with PKCE is the preferred approach when security, auditability, and user-specific data access are primary requirements. This is the only pattern that supports PKCE in Sigma.
312+
</aside>
313+
282314
### Pattern 2: Service Account with Row-Level Security
283315

284316
**Scenario:** Sigma connects using shared service account, data filtered by user attributes
@@ -326,12 +358,13 @@ Duration: 10
326358

327359
### Choosing the Right Pattern for Sigma
328360

329-
**Use Direct Authentication when:**
330-
- You need strongest security and auditability for Sigma usage
331-
- Users already have individual data platform accounts
361+
**Use Connection-Level OAuth with PKCE (Pattern 1) when:**
362+
- You need the strongest security posture with PKCE protection
332363
- Regulatory compliance requires tracking which user ran which Sigma query
364+
- Users already have individual data platform accounts
333365
- Data sensitivity is very high (healthcare, financial)
334366
- You want to leverage platform-native permissions in Sigma dashboards
367+
- Enhanced security against authorization code interception is required
335368

336369
**Use Service Account with RLS when:**
337370
- Embedding Sigma for external customers who don't have platform accounts
@@ -499,4 +532,4 @@ Be sure to check out all the latest developments at [Sigma's First Friday Featur
499532

500533
![Footer](assets/sigma_footer.png)
501534
<!-- END OF WHAT WE COVERED -->
502-
<!-- END OF QUICKSTART -->
535+
<!-- END OF QUICKSTART -->

0 commit comments

Comments
 (0)