NiFi 中的 Kafka oauth 2.0

Kafka oauth 2.0 in NiFi

我找到了如何对 Kafka 执行 OAuth 2.0。

我可以配置 kafka 并创建安全主题。在教程中考虑了控制台消费者和生产者:

./bin/kafka-console-producer.sh --broker-list localhost:9093 --topic oauth2-demo-topic --producer.config ./config/sasl-oauth2-producerapp-config.properties

sasl-oauth2-producerapp-config.properties:

security.protocol=SASL_PLAINTEXT
sasl.mechanism=OAUTHBEARER
sasl.login.callback.handler.class=com.oauth2.security.oauthbearer.OAuthAuthenticateLoginCallbackHandler
sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required OAUTH_LOGIN_SERVER=<OAuth-server-url> OAUTH_LOGIN_ENDPOINT='/oauth2/default/v1/token' OAUTH_LOGIN_GRANT_TYPE=client_credentials OAUTH_LOGIN_SCOPE=kafka OAUTH_AUTHORIZATION='Basic <encoded-producer-clientId:clientsecret>' OAUTH_INTROSPECT_SERVER=<OAuth-server-url> OAUTH_INTROSPECT_ENDPOINT='/oauth2/default/v1/introspect' OAUTH_INTROSPECT_AUTHORIZATION='Basic <encoded-producer-clientId:clientsecret>';

消费者相似

是否可以将此功能添加到 NiFi 中的 Kafka 生产者和消费者处理器中?我没有找到我可以在哪里输入 sasl-oauth2-producerapp-config.properties 的路径,或者这个属性直接指向处理器参数

您的问题尚未解决。看https://issues.apache.org/jira/browse/NIFI-7421