Search code examples
apache-nifi

Pass Jaas Config to Nifi Consume Kafka at runtime


Can we pass java.security.auth.login.config containing path of JaaS config to consumeKafka processor using a dynamic property without setting it in bootstrap.conf?

Is it possible?


Solution

  • That is not possible.

    The property "java.security.auth.login.config" is a JVM system property so you can only set that in bootstrap.conf and there can be only one value set for the whole JVM.

    The Kafka client accepts a property "sasl.jaas.config" so you should be able to specify a dynamic property in the processor and put that as the name and the JAAS entry as the value (not the path to the jaas file, the actual content of the KafkaClient entry).

    However, you shouldn't need to do this. For Kafka processors starting with 0.10 and later there a properties directly in the processor for principal and keytab, or there is a property for a keytab credential service. By specifying the principal and keytab through one of these approaches, it will create the appropriate JAAS entry behind the scenes for you.