I need to authenticate to a Kafka Broker using OAuth.
I am looking at the Apache NiFi issues pages and see this URL to add support for SASL/OAUTHBEARER to the Kafka 3 processors which now have an allowable values list of SASL mechanisms - https://issues.apache.org/jira/browse/NIFI-7421
Does anyone know if this will ever be implemented?
Otherwise, does anyone have any list of ideas I could use to achieve this requirement?
@drewski7 I have just picked your ticket I hope I can help you resolve this issue if its still unresolved. There are are couple of configurations changes and implementations that have to done.
1. Overview
OAuth allows Kafka clients to obtain access tokens from an external authentication provider like OAuth providers to authenticate with the Kafka broker. This process involves configuring the Kafka broker, OAuth provider, and Kafka clients.
2. Prerequisites
Kafka cluster with SASL/OAUTHBEARER enabled.
An OAuth provider set up to issue access tokens.
Kafka clients that support SASL/OAUTHBEARER.
Required libraries for OAuth integration (e.g. kafka-clients, oauth2-client, or keycloak adapters).
3. Procedure
Step 1: Configure the OAuth Provider
Set up an OAuth provider (e.g., Keycloak, Okta, etc.) to act as the identity provider (IdP).
Register a new client application for Kafka in the OAuth provider:
Set up client ID and client secret for Kafka clients.
Configure scopes, roles, or claims required for authorization.
Enable grant types like Client Credentials or Password (depending on your use case).
Note down the following details:
Authorization Server URL (e.g.https://authlogin.northwind.com/token).
Client ID and Client Secret.
Step 2: Configure the Kafka Broker
Enable SASL/OAUTHBEARER Authentication:
Edit the Kafka broker configuration (/config/server.properties)
@drewski7 I have just picked your ticket I hope I can help you resolve this issue if its still unresolved. There are are couple of configurations changes and implementations that have to done.
1. Overview
OAuth allows Kafka clients to obtain access tokens from an external authentication provider like OAuth providers to authenticate with the Kafka broker. This process involves configuring the Kafka broker, OAuth provider, and Kafka clients.
2. Prerequisites
Kafka cluster with SASL/OAUTHBEARER enabled.
An OAuth provider set up to issue access tokens.
Kafka clients that support SASL/OAUTHBEARER.
Required libraries for OAuth integration (e.g. kafka-clients, oauth2-client, or keycloak adapters).
3. Procedure
Step 1: Configure the OAuth Provider
Set up an OAuth provider (e.g., Keycloak, Okta, etc.) to act as the identity provider (IdP).
Register a new client application for Kafka in the OAuth provider:
Set up client ID and client secret for Kafka clients.
Configure scopes, roles, or claims required for authorization.
Enable grant types like Client Credentials or Password (depending on your use case).
Note down the following details:
Authorization Server URL (e.g.https://authlogin.northwind.com/token).
Client ID and Client Secret.
Step 2: Configure the Kafka Broker
Enable SASL/OAUTHBEARER Authentication:
Edit the Kafka broker configuration (/config/server.properties)