I am trying to drop a database connector into my workflow and have it connect with a username and password generated by another (python) node. I cannot use a flow variable to specify the password, and the postgres and redshift connectors expect a string value for ‘credentials’ - even though it seems credential nodes do not output credentials as a string.
Is there something simple I’m missing here? How do I pass credentials to a DB connector?
for security reasons the DB Connectors expect a credentials variable. You can convert your string variables to a credentials variable using the Variable to Credentials node
In terms of the question “is there something simple I’m missing here?”, I thought I’d look into this further.
Yes the flow variable for “credentials” does accept a String rather than a Credentials variable, which does seem counter-intuitive.
What it accepts is not actually the credentials flow variable itself, but another flow variable containing the name of the Credentials flow variable because what it is doing is using this to populate the Credentials variable name that appears on the settings screen if you select the “Credentials” option.
I’m using an Oracle connector here to demo as this is what I have available, but I’m sure it will be similar for your connectors.
You would need to create your credentials variable from your generated string using a suitable mechanism such as suggested by @tobias.koetter.
To pass this to your DB Connector, you need to either directly enter that variable name the Connection Settings tab
or you can set it using the Flow Variables tab if that is what you need to do, but in this case you would need to have a further variable containing the name of your connection variable, and specify the selectedType as “CREDENTIALS” via another flow variable.
Hope that helps clear up the confusion
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.