Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Apache Nifi : Basic Authentication Details using attributes

avatar
Expert Contributor

We have a use case to use "InvokeHttp" for restful service, getting all the details from the DB (URL/username/password), need to pass basic authentication (username and password) via attributes retrieved from DB. Is it possible to pass authentication using attributes ?

1 ACCEPTED SOLUTION

avatar
Master Mentor
@nyakkanti

Only processor properties that support the NiFi expression language can be configured to use FlowFile attributes.

Some properties (even if the processor property says supports expression language: false, you may be able to use a simple ${<FlowFile-attribute-name>} to return a value from a attribute key/value pair.

But this is never true for sensitive properties such as password properties. Password properties are especially difficult since those values are encrypted upon apply. So if you entered ${<FlowFile-attribute-name>} , that is what gets encrypted. The processor then decrypts that when making the connection. Nowhere in that process does it ever retrieve a value from the FlowFile.

Thanks, Matt

View solution in original post

1 REPLY 1

avatar
Master Mentor
@nyakkanti

Only processor properties that support the NiFi expression language can be configured to use FlowFile attributes.

Some properties (even if the processor property says supports expression language: false, you may be able to use a simple ${<FlowFile-attribute-name>} to return a value from a attribute key/value pair.

But this is never true for sensitive properties such as password properties. Password properties are especially difficult since those values are encrypted upon apply. So if you entered ${<FlowFile-attribute-name>} , that is what gets encrypted. The processor then decrypts that when making the connection. Nowhere in that process does it ever retrieve a value from the FlowFile.

Thanks, Matt