credentials ???

Hi,

I am implementing a node to read Google spreadsheets... For this I would like to store user name and password somewhere... 

Could you please let me know what the recommended way to do so is, with a pointer to some sample code? THANKS!!!!!

 

The only mentioning of credentials was this:

Bug 2258: Introduce credentials store on workflow, replacing current master key concept

And the Java docs don't provide much information for me as well...

 

thanks,

 

Bernd

Hi Bernd, I personally would recommend looking into the database package in org.knime.core and org.knime.base, the important classes are of course the DBReaderNodeModel and DatabaseConnectionSettings. In principle you simply need to access the CredentialsStore on the NodeModel and/or NodeDialogPane which returns a user and password, for a given (in the dialog adjusted) credential. A credential can be set on workflow level, next to the global flow variables. Hope this helps?

Is it true that you are avoiding the problem of storing a password by just not storing/writing it to disk?

Is this good practice (This is a naive and honest question, not provacation!)?

Yes and no, we don't store this password with the credenials, secondly this is also a missing feature. We have this on our list allowing credentials to be stored together with their password.

Is this still an issue or resolved in new versions, I am still not able to store credentials with password in local workflows.

Hi,
since version 3.2 there is ‘org.knime.core.node.defaultnodesettings.DialogComponentAuthentication’ which provides an panel for authentication with credentials and/or username, and other options. This panel stores the set input. Furthermore, the node Credentials Input also offers to store the provided credentials and is able to pass these credentials via a FlowVariable to other nodes. This can be accessed in the NodeModel by the method ‘getCredentialsProvider()’.