Skip to content

Add azure_federated authentication to Kafka source#7011

Open
bagmarnikhil wants to merge 2 commits into
opensearch-project:mainfrom
bagmarnikhil:feature/kafka-azure-federated-oauthbearer
Open

Add azure_federated authentication to Kafka source#7011
bagmarnikhil wants to merge 2 commits into
opensearch-project:mainfrom
bagmarnikhil:feature/kafka-azure-federated-oauthbearer

Conversation

@bagmarnikhil

Copy link
Copy Markdown
Contributor

Description

Enables the Kafka source to consume from Azure Event Hubs by federating an AWS identity to Azure Active Directory for OAuth, so no Azure client secret is stored in the pipeline. At runtime the source resolves AWS credentials through Data Prepper's standard AWS configuration, obtains an AWS web-identity token and exchanges it at the Azure Entra token endpoint for a short-lived access token used as the SASL/OAUTHBEARER credential. Credentials use Data Prepper's standard AWS configuration, so one pipeline works across AWS credential setups.

Issues Resolved

Resolves #7007

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
  • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

✅ License Header Check Passed

All newly added files have proper license headers. Great work! 🎉

Enable the Kafka source to consume from Azure Event Hubs by
federating an AWS identity to Azure Active Directory for OAuth,
so no Azure client secret is stored in the pipeline. Credentials
use Data Prepper's standard AWS configuration, so one pipeline
works across AWS credential setups.

Signed-off-by: Nikhil Bagmar <nikhilbagmar73@gmail.com>
@bagmarnikhil
bagmarnikhil force-pushed the feature/kafka-azure-federated-oauthbearer branch from 34f4230 to 8ecc90d Compare July 20, 2026 15:58
- AzureFederatedTokenProvider now exposes close() (lock-guarded) and
  AzureFederatedCallbackHandler.close() delegates to it, releasing the
  lazily-created StsClient on shutdown instead of leaking it.
- Promote the OPT_* JAAS option keys on AzureFederatedCallbackHandler to
  public and reference them from KafkaSecurityConfigurer so the writer and
  reader share one definition and can't drift.
- Replace the repeated "SASL_SSL" literals in KafkaSecurityConfigurer with
  a SASL_SSL_PROTOCOL constant.
- Add unit tests for close() delegation and StsClient cleanup.

Signed-off-by: Nikhil Bagmar <nikhilbagmar73@gmail.com>
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.

Support Azure Event Hubs authentication in the Kafka source via AWS-to-Azure identity federation

2 participants