# MQTT Integration. Dynamic Updates for Client ID and Password

**URL:** https://forums.losant.com/t/mqtt-integration-dynamic-updates-for-client-id-and-password/2395
**Category:** Help
**Tags:** mqtt, workflow
**Created:** [November 20, 2019, 3:53pm UTC](https://forums.losant.com/t/mqtt-integration-dynamic-updates-for-client-id-and-password/2395 "2019-11-20T15:53:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander\_Kondrov](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/alexander_kondrov/32/1392_2.png) [@Alexander\_Kondrov](https://forums.losant.com/u/Alexander_Kondrov)
#### Post date: [November 20, 2019, 3:53pm UTC](https://forums.losant.com/t/mqtt-integration-dynamic-updates-for-client-id-and-password/2395/1 "2019-11-20T15:53:45Z")

</div>

Hello Losant Team,

I need to integrate with another service using MQTT. I’ve selected MQTT Integration feature and I need to use dynamically updated Client ID and Password. As far as I can see in Losant Web GUI, MQTT Integrations support only statically entered credentials. Can I use `Losant API Node / Application: MQTT Publish Message` for those purposes? If yes, could you refer an example with topic, message, broker address, etc defined in Node Payload?  
Thanks

---

<div class="post-metadata">

### Author: ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)
#### Post date: [November 20, 2019, 4:53pm UTC](https://forums.losant.com/t/mqtt-integration-dynamic-updates-for-client-id-and-password/2395/2 "2019-11-20T16:53:25Z")

</div>

@Alexander_Kondrov,

Yes, this would have to be done using the Losant API Node. You can use the Integration Post API:

> **[Integrations Actions](https://docs.losant.com/rest-api/integrations/#post)**
>
> A detailed look at the various REST actions supported by the Integrations resource of the Losant API. Learn more.

In the body of the request, you can use templated values:

```auto
{
  "name": "Example Integrations",
  "integrationType": "mqtt",
  "topics": [
    "myTopic"
  ],
  "mqttConfig": {
    "clientId": "{{ example template }}",
    "username": "exampleUsername",
    "password": "examplePassword",
    "port": 8883,
    "protocol": "mqtts",
    "host": "broker.example.com"
  }
}

```

---

<div class="post-metadata">

### Author: ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)
#### Post date: [November 20, 2019, 4:58pm UTC](https://forums.losant.com/t/mqtt-integration-dynamic-updates-for-client-id-and-password/2395/3 "2019-11-20T16:58:11Z")

</div>

@Alexander_Kondrov,

Now that I think about it. If you use the API to create an Integration, it would be hard to then consume automatically. The creation of said integration could be automated but, you’d still have to build a workflow to consume the newly created MQTT integration.

Could you give more background into what you’re trying to accomplish?

---

<div class="post-metadata">

### Author: ![Alexander\_Kondrov](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/alexander_kondrov/32/1392_2.png) [@Alexander\_Kondrov](https://forums.losant.com/u/Alexander_Kondrov)
#### Post date: [November 20, 2019, 5:15pm UTC](https://forums.losant.com/t/mqtt-integration-dynamic-updates-for-client-id-and-password/2395/4 "2019-11-20T17:15:02Z")

</div>

Thank you, Taron. I created an integration and just planning to patch it I guess with API node every time sending a message in a workflow. At least `Losant API Node /Integration: Patch` looks as the most appropriate command for me so far

---

<div class="post-metadata">

### Author: ![Alexander\_Kondrov](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/alexander_kondrov/32/1392_2.png) [@Alexander\_Kondrov](https://forums.losant.com/u/Alexander_Kondrov)
#### Post date: [November 21, 2019, 4:42pm UTC](https://forums.losant.com/t/mqtt-integration-dynamic-updates-for-client-id-and-password/2395/7 "2019-11-21T16:42:51Z")

</div>

Taron,

Continuing this topic, Could you help me to understand if I can generate sha256 encryption of a string value in Losant using JWT: CREATE Node with RS256 Algorithm selected?

Thank you.

UPD and solution: HASH Node worked great for this task finally
