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.
CLICK HERE to find out more related problems solutions.