# Flows\_cred.json are encrypted

**URL:** <https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405>\
**Category:** General\
**Tags:** influxdb\
**Created:** [22 April 2024 05:26 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405 "2024-04-22T05:26:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiadong696](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jiadong696/32/90372_2.png) [@jiadong696](https://discourse.nodered.org/u/jiadong696)\
**Post date:** [22 April 2024 05:26 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405/1 "2024-04-22T05:26:51Z")

</div>

flows\_cred.json How do I execute the command to load the credentials in flows.json below the privacy, how do I modify the configuration file, load it through the sh command?

How to solve this problem? Thank you for informing me!

```auto
{
        "id": "3b95270be04c4e92",
        "type": "influxdb",
        "hostname": "127.0.0.1",
        "port": "8086",
        "protocol": "http",
        "database": "database",
        "name": "210office",
        "usetls": false,
        "tls": "d50d0c9f.31e858",
        "influxdbVersion": "2.0",
        "url": "http://127.0.0.1:8086",
        "rejectUnauthorized": false,
         "credentials": {
            "token": "xoxo"
        }
    }

```

If I change the token content, how can I update the contents of the encrypted flows\_cred.json file? Otherwise, I cannot use the new account password in the node  
Otherwise I need to redeploy to execute the command. Do you have a demo or case to encrypt this using Python?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 April 2024 07:51 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405/2 "2024-04-22T07:51:00Z")

</div>

Welcome to the forum.

You do not need to do anything with the credentials json file. Node-RED takes care of it for you. Any node that wants to keep credentials safe will define something as a credential and the value is automatically encrypted into the cred file and retrieved as needed.

---

<div class="post-metadata">

**Author:** ![jiadong696](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jiadong696/32/90372_2.png) [@jiadong696](https://discourse.nodered.org/u/jiadong696)\
**Post date:** [22 April 2024 08:07 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405/3 "2024-04-22T08:07:58Z")

</div>

However, after I restart the service, the new token will not be added to the certificate again, and I need to go to the web side of the node to deploy it again. Why is this?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 April 2024 08:50 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405/4 "2024-04-22T08:50:30Z")

</div>

Which influxdb node do you have installed?  
This should be available in your .node-red folder/package.json  
eg

```auto
pi@Zero2Pink:~ $ grep influx ~/.node-red/package.json
    "node-red-contrib-influxdb": "~0.7.0",

```

Are you trying to change the credentials file from a process external to Node-red? Why?

---

<div class="post-metadata">

**Author:** ![jiadong696](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jiadong696/32/90372_2.png) [@jiadong696](https://discourse.nodered.org/u/jiadong696)\
**Post date:** [22 April 2024 09:25 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405/5 "2024-04-22T09:25:02Z")

</div>

My token in influxdb changes. After I modify the flows.json file, restarting the service does not take effect. I want to write an sh script to make the certificate take effect without performing operations on the web side of the node

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 April 2024 10:19 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405/6 "2024-04-22T10:19:53Z")

</div>

In that case, you may be better off not using that node. You don't really need a node for InfluxDB anyway since the API uses standard REST. That means that you can simply use an http-request node with the appropriate headers set. That will give you full control over the interaction & should let you use a more dynamic token without the need for a shell script.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 July 2024 10:20 UTC](https://discourse.nodered.org/t/flows-cred-json-are-encrypted/87405/7 "2024-07-21T10:20:05Z")

</div>

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