All posts

The simplest way to make Keycloak Pulsar work like it should

Your access logs should not look like a thriller novel. Yet that’s how most teams run identity and messaging today, scattered across services and half-mapped roles. When someone asks who triggered an event, silence follows. Pairing Keycloak with Apache Pulsar fixes that confusion fast. Together they turn identity and events into a single, observable flow. Keycloak handles who you are, issuing tokens that prove user or service identity across any cluster. Pulsar moves what you do, distributing s

Free White Paper

Keycloak + End-to-End Encryption: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

Your access logs should not look like a thriller novel. Yet that’s how most teams run identity and messaging today, scattered across services and half-mapped roles. When someone asks who triggered an event, silence follows. Pairing Keycloak with Apache Pulsar fixes that confusion fast. Together they turn identity and events into a single, observable flow.

Keycloak handles who you are, issuing tokens that prove user or service identity across any cluster. Pulsar moves what you do, distributing streams of messages with high throughput and persistent guarantees. One defines permissions, the other defines actions. When they talk properly, every message in Pulsar can carry trusted context from Keycloak, making event-driven systems genuinely secure rather than merely fast.

Connecting them works like this. Keycloak issues access tokens using OIDC or SAML, depending on how your stack authenticates. Pulsar’s client or proxy validates these tokens before producing or consuming from a topic. You tag operations with user roles or workspace scopes. That binding between token claims and Pulsar authorization rules provides fine-grained control: who can publish, who can subscribe, and who gets denied quietly instead of breaking production.

The integration relies on Pulsar’s AuthenticationProvider plugin, wired to Keycloak’s public key endpoint. When a service attempts a publish, Pulsar checks the JWT signature and claims. No shared secrets, no manual ACLs. Just clean, verifiable identity in motion.

Common refinements tighten the setup.

Continue reading? Get the full guide.

Keycloak + End-to-End Encryption: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.
  • Rotate signing keys in Keycloak and propagate new JWKS URLs automatically.
  • Map roles to Pulsar namespaces, not just topics, to reduce policy churn.
  • Cache tokens judiciously to cut latency without losing freshness.

These steps keep performance steady while maintaining audit integrity under SOC 2 or ISO 27001 expectations.

The gains are easy to measure:

  • Clear accountability. Every event traces back to an authenticated identity.
  • Reduced latency. Token checks happen inline without full database lookups.
  • Simpler compliance. Security teams get unified logs instead of stitching fragments.
  • Developer velocity. Fewer permissions tickets, faster deploy approvals.
  • Operational sanity. Roles stay consistent across apps, queues, and microservices.

In day-to-day development, this model means fewer angry “401” surprises and quicker debugging. Developers move between environments without waiting on yet another credentials sync. For AI-driven automation tools or copilots, it also means safe data boundaries: prompts and agents only access topics they’re authorized for, not the entire cluster.

Platforms like hoop.dev turn those access rules into guardrails that enforce policy automatically. Instead of juggling scripts and configs, you define once in Keycloak, observe everywhere in Pulsar, and let hoop.dev keep it consistent through your CI gates.

How do I connect Keycloak to Pulsar?
Install a Pulsar auth plugin that supports OIDC, point it at your Keycloak realm’s JWKS URL, and assign roles through Keycloak client scopes. Pulsar will then validate tokens in real time, protecting every publish and subscribe call with minimal friction.

With roles and messages unified, your infrastructure finally speaks in one voice: identity-authenticated events that explain themselves.

See an Environment Agnostic Identity-Aware Proxy in action with hoop.dev. Deploy it, connect your identity provider, and watch it protect your endpoints everywhere—live in minutes.

Get started

See hoop.dev in action

One gateway for every database, container, and AI agent. Deploy in minutes.

Get a demoMore posts