I have to invoke multiple Endpoints with the "same" user credentials (basic auth). I don't want to hard code "Basic Auth UserName" and "Basic Auth Password" for each InvokeHttp header. Is there a easy way to maintain it in one place and pass it to each InvokeHttp processor?
1 Answer
If you are using NiFi 1.10.0 or newer, then you can create a parameter context with parameters for "basic.auth.user" and a sensitive parameter for "basic.auth.password", then bind the parameter context to the process group, then in the processor reference #{basic.auth.user} and #{basic.auth.password}.
https://nifi.apache.org/docs/nifi-docs/html/user-guide.html#Parameters
If older than 1.10.0, then you can user expression language to reference a variable, system property, or environment variable.
2 Comments
MKS_AWS
Thanks @Bryan for the response. I'm using 1.9.0. "Basic Authentication Password" doesn't support expression language. How do I go about passing "variable" to sensitive value which doesn't support expression language.
Bryan Bende
There is not a good way, that is one reason why parameters were added so that it can be done from any property no matter what