Persist user/password info for nodes

Hello,

Specifics nodes need user/pwd informations like MQTT broker for example.

If I want to persist informations after nodered restart, I need to put them in flows_cred.json. It works.
If I only fill these informations directly in the flow, I will loose these values after nodered restart.

Is there another way to keep these informations whithout using flows_cred.json ?

Best Regards,

Louison

Can you explain what you mean here?

Taking the MQTT Broker node as your example, you enter the username/password details in the node, then hit deploy and the credentials get saved.

Do you mean your flow is generating credentials as part of its running and you want to be able to store them somewhere?

I'm not aware of a node that can dynamically store values like credentials in a secure manner.

Hi knolleary,

Your understanding is good.
Taking the MQTT Broker node as an example, I enter the username/password details in the node, then hit deploy and the credentials get saved. I don't know where ? Probably in RAM but not in flows.json.

You're right. I want to keep my user/pwd informations after a nodered restart.
I don't want to use flows_cred.json to persist them. Is there another way to keep these informations ?

When you deploy the MQTT Broker node, its credentials are stored in the credentials file. That is where all node credentials are stored.

As I said before, I'm not aware of a node that can dynamically store values like credentials in a secure manner.

You could store them in context, but that would require persistent context to be enabled, and the credentials would be stored unencrypted.

The credentials file you mentionned is flows_cred.json ?

I'm not sure about another way to persist the data indeed.

Yes, that is the file that contains node credentials.

If you still have the problem that mqtt node credentials are not saved over a node red restart then I suggest doing the following.
Restart node-red by running

node-red-stop
node-red-start

leave the terminal open. Then enter the credentials in the MQTT node. This is what you mean presumably
image
Deploy it and then run

node-red-stop
node-red-start

again. Assuming that your credentials are not saved then copy/paste the full log here. Also run, in the .node-red directory
ls -l
and post that too.

Hi Colin,

Just to give you some precisions.

I don't really have problems to store MQTT credentials. I can store them in flows_cred.json and after restarting nodered my credentials exist.

I just try to find another way to persist my credentials whithout using flows_cred.json.

I will have several customers and I don't want to share some informations in flows_cred.json. Even if this file can be crypted. And I don't want to manage a file per customer.

The idea is (but I don't know if it's possible):

I start nodered.
I load the flow.
I set up user and password for mqtt broker in the node.
I deploy.
And that's all.
The problem: if nodered restarts, I will lost the setup.

Do you always need that I proceed with your recommandations to trace ?

OK, I understand what you mean now.

Do different users need different credentials for MQTT? If not then I don't see why the credentials file would be unique to a customer.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.