Skip to content

feat: Add OAuth2 client credentials support for Kafka SASL#4482

Open
engkeong wants to merge 1 commit into
redpanda-data:mainfrom
engkeong:feat/kafka-sasl-oauth2-client-credentials
Open

feat: Add OAuth2 client credentials support for Kafka SASL#4482
engkeong wants to merge 1 commit into
redpanda-data:mainfrom
engkeong:feat/kafka-sasl-oauth2-client-credentials

Conversation

@engkeong

@engkeong engkeong commented Jun 3, 2026

Copy link
Copy Markdown

Description

Implements OAuth2 client credentials support for Kafka SASL authentication with dynamic token renewal.

Changes

  • OAuth2 Integration: Added OAuth2 client credentials configuration for OAUTHBEARER mechanism
  • Dynamic Token Renewal: Automatic token management without manual updates
  • Provider Compatibility: Supports Microsoft Entra, Okta, Auth0, and Keycloak
  • Configurable Scopes: Optional scopes and endpoint parameters for flexibility
  • Test Coverage: Comprehensive OAuth2 flow testing

How it works

The new \oauth2\ configuration allows specifying OAuth2 client credentials. When enabled, the Kafka client will automatically request and refresh tokens from the configured token endpoint, handling token expiration seamlessly.

Configuration Example

\\yaml
sasl:

Benefits

  • Improved Reliability: Automatic token refresh prevents authentication failures
  • Reduced Overhead: No manual token management required
  • Enterprise Ready: Works with major OAuth2 providers
  • Flexibility: Supports additional endpoint parameters (e.g., audience)

Testing

OAuth2 client credentials flow has been tested with proper token handling and scope configuration.

@CLAassistant

CLAassistant commented Jun 3, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


EK (Eng Keong) Lim seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@engkeong engkeong marked this pull request as ready for review June 3, 2026 11:20
- Implements dynamic token renewal for OAUTHBEARER mechanism
- Supports OAuth2 client credentials grant type
- Compatible with Microsoft Entra, Okta, Auth0, and Keycloak
- Adds configurable scopes and endpoint parameters
- Includes comprehensive test coverage for OAuth2 flow

The new oauth2 configuration allows automatic token management
without requiring manual token updates, improving reliability and
reducing operational overhead.
@engkeong engkeong force-pushed the feat/kafka-sasl-oauth2-client-credentials branch from 15edd0c to bfe62f8 Compare June 3, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants