feat(connector): support Kafka SASL/OAUTHBEARER OIDC login (KIP-768)#25499
Open
bpaquet wants to merge 1 commit intorisingwavelabs:mainfrom
Open
feat(connector): support Kafka SASL/OAUTHBEARER OIDC login (KIP-768)#25499bpaquet wants to merge 1 commit intorisingwavelabs:mainfrom
bpaquet wants to merge 1 commit intorisingwavelabs:mainfrom
Conversation
Enable native OIDC client credentials flow for Kafka authentication by exposing librdkafka's built-in OIDC configuration properties through KafkaConnectionProps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This is a fork of #25491, rebased on current main.
Motivation
RisingWave cannot connect to Kafka clusters protected by OAuth 2.0 / OIDC authentication — a standard pattern in enterprise deployments (Keycloak, Auth0, Okta, Azure AD, Confluent Cloud with OIDC, etc.).
librdkafka has supported the full OIDC login flow since KIP-768: given
sasl.oauthbearer.method=oidcplus client credentials and a token endpoint, it fetches and auto-refreshes tokens against the IdP without any application-level callback.The only thing missing was on the RisingWave side:
KafkaConnectionPropsdid not expose any of the OIDC properties, so users had no way to pass them throughWITH (...).set_security_propertiesunconditionally enabledenable.sasl.oauthbearer.unsecure.jwt=true, which conflicts withmethod=oidc.curlsupport, which is required for the OIDC HTTP token flow.What this PR does
This is a pure configuration passthrough — no custom token logic, no callbacks, no refresh threads. We just expose librdkafka's existing OIDC configuration properties and let it handle everything:
KafkaConnectionProps:sasl.oauthbearer.method,sasl.oauthbearer.client.id,sasl.oauthbearer.client.secret,sasl.oauthbearer.token.endpoint.url,sasl.oauthbearer.scopeenable.sasl.oauthbearer.unsecure.jwt=truewhen method is NOToidccurlfeature on rdkafka so librdkafka is built with HTTP client support (required for OIDC)with_options_*.yamlfilesUsage
Token acquisition, caching, and refresh are fully delegated to librdkafka's built-in OIDC client.
Scope & safety
KafkaConnectionProps).unsecure.jwtflag is still set unless the user explicitly opts intomethod=oidc.Checklist
Documentation
Release note
Kafka sources, sinks, and connections can now authenticate against OAuth 2.0 / OIDC providers using librdkafka's built-in OIDC login flow. Set
properties.sasl.oauthbearer.methodtooidcand provideproperties.sasl.oauthbearer.client.id,properties.sasl.oauthbearer.client.secret, andproperties.sasl.oauthbearer.token.endpoint.url. Tokens are fetched and refreshed automatically by librdkafka.properties.sasl.oauthbearer.scopeis also available.