# How to config mqtt by "POST /flows"(remotely way) with username and passwd

**URL:** <https://discourse.nodered.org/t/how-to-config-mqtt-by-post-flows-remotely-way-with-username-and-passwd/69776>\
**Category:** General\
**Tags:** mqtt\
**Created:** [29 October 2022 17:33 UTC](https://discourse.nodered.org/t/how-to-config-mqtt-by-post-flows-remotely-way-with-username-and-passwd/69776 "2022-10-29T17:33:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joe1](https://discourse.nodered.org/u/joe1)\
**Post date:** [29 October 2022 17:33 UTC](https://discourse.nodered.org/t/how-to-config-mqtt-by-post-flows-remotely-way-with-username-and-passwd/69776/1 "2022-10-29T17:33:37Z")

</div>

I'm used "POST /flows" remotely api is effect,but in mqtt-broker-json can't set password and username ,I do not know the key in json. please tell me .

nodered-version:v2.1.6  
ex "type": "mqtt-broker",  
....  
{  
"id": "cb7119a711fda880",  
"type": "mqtt-broker",  
"name": "test-dasboard-mqtt",  
"broker": "x.x.x.x",  
"port": "8001",  
"clientid": "",  
"autoConnect": true,  
"usetls": false,  
"protocolVersion": "4",  
"keepalive": "60",  
"cleansession": true,  
"birthTopic": "",  
"birthQos": "0",  
"birthPayload": "",  
"birthMsg": {},  
"closeTopic": "",  
"closeQos": "0",  
"closePayload": "",  
"closeMsg": {},  
"willTopic": "",  
"willQos": "0",  
"willPayload": "",  
"willMsg": {},  
"sessionExpiry": "",  
},  
....

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 October 2022 17:40 UTC](https://discourse.nodered.org/t/how-to-config-mqtt-by-post-flows-remotely-way-with-username-and-passwd/69776/2 "2022-10-29T17:40:58Z")

</div>

Add a new broker, enter username and password, don't deploy and dont refresh. Export the new node - you will see the correct format.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [29 October 2022 17:45 UTC](https://discourse.nodered.org/t/how-to-config-mqtt-by-post-flows-remotely-way-with-username-and-passwd/69776/3 "2022-10-29T17:45:07Z")

</div>

If you wanted to do it remotely you could have an http endpoint or another mqtt topic. You could then set the mqtt node using dynamic subscription settings. Read the help text in the sidebar, it will give you the properties you can set.

---

<div class="post-metadata">

**Author:** ![joe1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joe1](https://discourse.nodered.org/u/joe1)\
**Post date:** [29 October 2022 17:55 UTC](https://discourse.nodered.org/t/how-to-config-mqtt-by-post-flows-remotely-way-with-username-and-passwd/69776/4 "2022-10-29T17:55:04Z")

</div>

```
"credentials": {
        "user": "username",
        "password": "password"
    }

```

find it,be grateful!

---

<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:** [12 November 2022 17:55 UTC](https://discourse.nodered.org/t/how-to-config-mqtt-by-post-flows-remotely-way-with-username-and-passwd/69776/5 "2022-11-12T17:55:16Z")

</div>

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