Master Password for Database Writer

Hi,

I'd like to know if there is a way to have a masterpassword for the database writer in Knime.  My thought is that if the password for the username writing to the database changes, then every workflow would have to be edited with the new credentials.  If there's a way to set that variable in one place, then that would make upkeep of the workflows simpler over the course of time.

 

Thanks,

Olga

Hi opolyakov,

You can do this by creating a metanode template that contains a Credentials Input node. For this, you need the KNIME Personal Productivity Extensions. They are available for free at https://tech.knime.org/knime-store

After installing the extensions, you configure a Credentials Input node with your credentials. Make sure to uncheck "Prompt username in warapped metanode dialog/wizard" and to check "Save password in configuration (weakly encrypted)".

Next, you create a wrapped metanode from this node with a flow variable output. Make sure to add the credentials flow variable in the WrappedNode Output configuration.

Finally, right click the wrapped metanode and select Wrapped metanode -> Save as template

Afterwards, you can use this metanode template in every workflow that uses these credentials and connect it to the database connector. If you make any changes to the template, all workflows linked to the template will automatically updated with the new credentials.

Hope that helps!

Cheers,

Roland

Thanks Roland!

Hi Roland,

When I right-click on Wrapped Metanode to save as template, that option is greyed out.

Any ideas as to which step I've missed?  I've attached some screenshots.

Thanks,

Olga

 

 



 

Hi Olga,

Have you installed the KNIME Personal Productivity Extensions? You need those to save as template (see link in my first post)

Cheers,

Roland

Hi Roland,

Yes, I installed those.

 

Olga

Hi Roland,

I am going through this step by step from the beginning.  Would you mind confirming that I have installed the extension?  The screenshot in the installation guide says "Knime.com Extension Store".  I don't have any extension with that name in my list.  I thought perhaps the name had changed to Productivty Extensions. I have gone to the preferences menu and verified that Store Update is checked and reloaded just to make sure, but still no Extension Store showed up.

Thanks - I appreciate your support!

Sincerely,
Olga

Hi Olga,

From your screenshot, it seems like the extension is installed already. You might still need the license now. Did you download a license as described here? https://tech.knime.org/installation-instructions

Cheers,

Roland

Hi Roland,

Thanks for the reply!  I was away on travel but am back now and was able to take the next step.  I missed that on the instructions earlier.

So, now I have a template, though I'm not sure which template type to pick.  I chose workflow-relative.  Is that right?

Also, I'm not sure how to connect the Metanode to the Database Reader.  Could you help me with that step?

Thanks,
olga

Can you post an example “create a wrapped metanode from this node with a flow variable output. Make sure to add the credentials flow variable in the WrappedNode Output configuration.”

Hi there,

right-click on the Metanode and then from Wrapped Metanode menu chose Setup. There you add input and output ports :wink:

Created flow variables inside Wrapped Metanode are not visible to rest of the workflow. So in WrappedNode Output inside Wrapped Metanode you should include your created credentials flow variable from configuration menu.

Here is link on (Wrapped) Metanodes for more info: https://docs.knime.com/2018-12/analytics_platform_metanode_guide/index.html

Additionally my practice was I used to keep all my credentials in a file on my computer which I would import at the beginning of a workflow. Then I would create a flow variables out of it and use it in a workflow. If credential changes I change it in a file. Worked pretty ok for me.

Br,
Ivan

2 Likes

On the first step where you say to create a wrapped metanode with a flow variable output. How do you create the flow variable Output? I went to the screen with adding ports and added an Output port. Do I also need an input port? So if I want to pass the Output variable to a Reader node or a Connection Node, how is this done?

Also, I like the idea of importing the user credentials, how are you doing this?

Thanks for your help as I am having a difficult time with this.

Finally, got this to work for me. I would like to have my workflows run via a bat file with the template updating my credentials. If the password changes in my file, does the workflow always prompt when using a template to update? I am trying to determine how to use both the template passing current credentals in bat.

Hi,

Sry for a delay on this one and glad you got it to work.

Regarding updating Metanode template you got option “Remember my decision” so it will not always prompt you when starting workflow. To be honest I have never used it in a batch mode so not sure how it works but if you check above mentioned option you should be just fine.

To be clear what updating of a Wrapped Metanode means. It updates nodes and its configuration and not data those nodes produce. It is like version update. So, changed data on your local file will be read correctly into KNIME whether you update or not your Wrapped Metanode.

Br,
Ivan