I would like to create a new credentials flow variable from my node.
Currently I just do:
pushFlowVariableString(“User”, userName);
pushFlowVariableString(“Password”, password);
is there something like pushCredentialsFlowVariable or can I somehow turn these string flow variables to a credential?
I tried to check out:
but could not quite grasp what do to…
Is there a simple way to create new credential variables?
Thanks in advance (and sorry if i missed something obvious)
You have two options, you can either use this method
This would be the easiest method, but it is not encouraged. Instead, you can use the auth pannel created for the new filehandling framework, you can take a look at e.g. FtpConnectorNodeDialog from the org.knime.ext.ftp.filehandling plugin. The sources for that plugin are not published to github yet but you access them as described in this post:
i fail to get any of the two versions to work.
For the “auth pannel” version - I followed the steps in the post but cannot find org.knime.ext.ftp.filehandling in the “Open Type” explorer (I tried with release 2020-12 as well as with 2019-12)
Not sure which version it should be in?
For the “newCredentialsFlowVariable” how would I call this function? I do not seem to have any access to the credentialsstore from my NodeModel level.
I would need a WorkflowManager reference to create a new instance (which i also do not see where to get)
The the getCredentialsProvider() is availible - which does not help in getting either one
But for credentials I guess I have to use the generic one?
But
pushFlowVariable(flowVar); //is not visible
pushFlowVariable(“PWD”, flowVar.getVariableType(), flowVar.getValue(VariableType.CredentialsType)); //not quite sure how to get the flowVariable here
Sorry for all these questions - but regarding flow variable usage - it seems like there is little information to look into