Back to Case Studies
ANALYTICS & BI[VERIFIED_ENGINEERING_SPEC]

Apache Superset Customization & Keycloak SSO

Customized Apache Superset with Keycloak OAuth2 SSO and secure multi-tenant embedded analytics.

Apache SupersetPythonFlask-AppBuilder (FAB)Keycloak (OIDC/OAuth2)PostgreSQL (Metastore)Redis (Celery & Cache)Docker & HelmSuperset Embedded SDK
Apache Superset Customization & Keycloak SSO
REFERENCE ARCHITECTURE
The Business Problem

Operational & Architectural Constraints

A B2B SaaS platform wanted to provide interactive analytical reporting to enterprise clients without building charts and filters from scratch. However, the default Apache Superset distribution lacked native integration with their central Keycloak identity provider, and standard embedding risked exposing one tenant's raw datasets to another without strict row-level isolation.

Our Engineering Approach

System Design & Implementation

We engineered a custom Apache Superset deployment. We extended Flask-AppBuilder's security manager with a custom Python authentication module that validates Keycloak OIDC tokens and automatically maps Keycloak realm roles to granular Superset permissions. For customer-facing embedding, we implemented a backend endpoint issuing scoped guest tokens containing dynamic Row-Level Security (RLS) rules, enabling secure iframe embedding within the SaaS React application.

SYSTEM ARCHITECTURE SPECIFICATIONVERIFIED WORKFLOW
[SYS_SPEC] Engineered for enterprise throughput, continuous observability, and isolated multi-tenant data boundaries.
Visual Architecture Specification

End-to-End System Data Flow

ARCHITECTURE_SPEC // SSO

System Data Flow: Apache Superset Customization & Keycloak SSO

Internal staff authenticate via Keycloak SSO; external SaaS users receive cryptographically signed guest tokens with RLS constraints directly restricting query results.

STEP 01 ACTIVE TELEMETRY // Client SaaS Application[TRANSACTION_COMMITTED]

Requests an ephemeral dashboard session from the application backend for an authenticated tenant user.

Engineered via: React & Next.js App
Data Integrity & Isolation

Strict tenant isolation and atomic data boundaries enforced at both gateway validation and persistence/table tiers.

Telemetry & Observability

Every stage emits structured trace contexts (OpenTelemetry / correlation IDs) for distributed debugging and latency profiling.

Technical Tradeoffs

Key Engineering Decisions

DECISION_01

Ephemeral guest tokens with RLS over separate Superset user accounts

Technical Rationale:

Eliminated the overhead of synchronizing thousands of external SaaS end-users into the Superset database.

Acknowledged Tradeoff:

Requires backend server-to-server call to generate tokens before dashboard render.

DECISION_02

Redis caching for analytical dashboard queries

Technical Rationale:

Cached identical dashboard slices across concurrent tenant users, drastically reducing direct warehouse load.

Acknowledged Tradeoff:

Requires fine-tuned cache invalidation policies (TTL configured to 1 hour).

Verified Technical Outcomes

Measured System Results & Stability Guarantees

In accordance with our engineering verification policy, we document verified technical benchmarks and architectural milestones rather than unverifiable marketing claims.

Zero cross-tenant data visibility breaches verified via automated security penetration tests.
Single sign-on achieved for all internal engineering and BI analysts through Keycloak realm federation.
Embedded dashboards load seamlessly inside the customer portal with sub-second cached render times.
Production deployment packaged into modular Docker images with automated configuration seeding.
Related Engineering Service

Analytics & Business Intelligence

Explore our full deliverables, tech stack, and engagement models for this capability.

View Service Details
Engineering Consultation

Facing a Similar Engineering Challenge?

Whether you need to decouple a monolith, deploy an Azure Databricks Medallion lakehouse, or author custom Airbyte connectors, let's evaluate your technical requirements.