Skip to content

Authentication & Authorization

BoilStream provides two distinct authentication systems tailored to different use cases: enterprise JWT-based authentication for programmatic access and web-based OAuth authentication for PostgreSQL connections.

Two Authentication Systems

BoilStream has two independent authentication systems that can be enabled separately:

SystemInterfaceMethodConfigurationUse Case
FlightRPC JWT AuthDuckDB Airport, Arrow FlightJWT tokens from enterprise SSOauth sectionData ingestion, programmatic API access
PostgreSQL Web AuthPostgreSQL protocol, BI toolsOAuth web UI + email/passwordauth_server + oauth_providersSQL queries, BI tools, interactive exploration

PostgreSQL Web Auth Login

Which Authentication System Do You Need?

  • For data ingestion from DuckDB or applications: Use FlightRPC JWT Authentication (this page)
  • For SQL queries from BI tools (Power BI, Tableau) or psql: Use PostgreSQL Web Authentication
  • For both use cases: Enable both systems independently

FlightRPC JWT Authentication

BoilStream's FlightRPC authentication provides enterprise-grade JWT-based security for data streaming operations. The system supports multiple identity providers and implements a flexible 3-level authorization hierarchy.

Overview

BoilStream's FlightRPC security model consists of two main components:

  • Authentication: Verifying user identity using JWT tokens from trusted providers
  • Authorization: Controlling access to resources based on user groups, scopes, and identity

Supported Identity Providers

BoilStream supports the following enterprise SSO providers:

ProviderStatusMulti-tenantCustom Claims
AWS Cognito✅ Production ReadyNoLimited
Azure AD (Entra ID)✅ Production Ready✅ YesYes
Google Cloud Platform✅ Production Ready✅ Workspace✅ Configurable
Auth0✅ Production Ready✅ Yes✅ Configurable
Okta✅ Production Ready✅ Yes✅ Configurable

3-Level Authorization Hierarchy

BoilStream implements a prioritized authorization system with three levels:

Level 1: Groups/Roles (Highest Priority)

  • Primary authorization mechanism
  • Provider-specific group mappings
  • Admin, read-only, and write groups

Level 2: Scopes/Permissions (API-level)

  • OAuth 2.0 style scopes for API access
  • Fine-grained operation control
  • Can require specific scopes for read/write/admin operations

Level 3: User Identity (User-specific)

  • Individual user access rules
  • Topic-specific permissions
  • Lowest priority, used for edge cases

Security Features

JWT Token Validation

  • Signature Verification: RSA/ECDSA signature validation using JWKS
  • Claims Validation: Issuer, audience, expiration, and custom claims
  • JWKS Caching: Automatic key rotation support with TTL-based caching

Access Control

  • Resource-based Authorization: Control access to topics, admin functions, metrics
  • Action-based Permissions: Separate read, write, publish, subscribe, admin actions
  • Topic-level Security: Fine-grained per-topic access control

Production Security

  • TLS Encryption: All FlightRPC communications encrypted in transit
  • Database Encryption: OAuth and users databases are always encrypted at rest
  • PGP Email Encryption: Optional PGP encryption for deleted account emails (GDPR Article 17 compliance with legal claim preservation)
  • Audit Logging: Comprehensive authentication and authorization logging
  • Graceful Degradation: System works with authentication disabled for development

When to Use Authentication

Enable Authentication When:

  • ✅ Running in production environments
  • ✅ Multi-tenant deployments
  • ✅ Compliance requirements (SOC2, GDPR, etc.)
  • ✅ Sensitive data processing
  • ✅ External client access

Skip Authentication When:

  • ⚠️ Development and testing environments
  • ⚠️ Internal, trusted network deployments
  • ⚠️ Single-user scenarios
  • ⚠️ Performance testing (reduces overhead)

Security Consideration

Always enable authentication in production environments. Running without authentication exposes all data and administrative functions to any network client.

Database Encryption (PostgreSQL Web Auth)

PostgreSQL authentication databases are always encrypted when the authentication server is enabled. This ensures user credentials and session data are protected at rest.

For complete encryption key management details, see the PostgreSQL Web Authentication guide.

FlightRPC vs PostgreSQL Authentication

  • FlightRPC JWT Auth: No database encryption (stateless JWT validation)
  • PostgreSQL Web Auth: Encrypted databases for user profiles and sessions

Quick Key Management Reference

MethodConfigurationKey StorageUse Case
Auto-generateencryption_key_path: "key.file"Saved to fileDevelopment
Manual entryNo encryption_key_pathNot savedHigh security
File-basedencryption_key_path: "key.file"Loaded from fileProduction
Piped inputAny configNever savedCI/CD, K8s secrets

WARNING

If you lose the encryption key, the PostgreSQL user databases cannot be decrypted. Store keys securely!

See PostgreSQL Web Authentication - Initial Setup for detailed encryption key setup instructions.

Configuration Overview

Authentication is configured entirely through environment variables, making it ideal for containerized deployments:

bash
# Enable authentication with multiple providers
AUTH_PROVIDERS="cognito,azure-ad,gcp"

# Configure authorization rules
ADMIN_GROUPS="boilstream-admins,data-engineers"
READ_ONLY_GROUPS="analysts,viewers"
WRITE_GROUPS="producers,data-writers"

Quick Start

FlightRPC JWT Authentication

For complete FlightRPC authentication setup, see our provider-specific guides:

PostgreSQL Web Authentication

For PostgreSQL access with OAuth or email/password:

Next Steps

For FlightRPC JWT Authentication:

  1. Choose Your Provider: Select the identity provider that matches your organization
  2. Configure Environment Variables: Set up authentication credentials and rules
  3. Test Authentication: Verify JWT tokens are properly validated
  4. Deploy with Security: Enable TLS and proper network security

For PostgreSQL Web Authentication:

  1. Enable auth_server: Configure auth_server and oauth_providers in config.yaml
  2. Setup Encryption Key: Provide encryption key on first startup
  3. Configure OAuth Providers: Setup GitHub, Google, or SAML integration
  4. Access Web UI: Navigate to https://your-domain/auth to login

Dashboard Example

Ready to secure your BoilStream deployment?