# New Device ID causes failure to connect to Losant MQTT broker

**URL:** <https://forums.losant.com/t/new-device-id-causes-failure-to-connect-to-losant-mqtt-broker/3399>\
**Category:** Help\
**Tags:** mqtt\
**Created:** [November 14, 2020, 6:19pm UTC](https://forums.losant.com/t/new-device-id-causes-failure-to-connect-to-losant-mqtt-broker/3399 "2020-11-14T18:19:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Assouad](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@Nicolas\_Assouad](https://forums.losant.com/u/Nicolas_Assouad)\
**Post date:** [November 14, 2020, 6:19pm UTC](https://forums.losant.com/t/new-device-id-causes-failure-to-connect-to-losant-mqtt-broker/3399/1 "2020-11-14T18:19:40Z")

</div>

Hello,  
Created new Application with a new device ID… Using the same keys on Losant ESP32 app (Key and secret) and the new device ID and NO THER MODIFICATIONS, I am not able to connect to Losant (Not the device connection but the Losant account!!!) if I restore the device ID to the prior application device ID no problem, able to connect to Losant account… Do I need a new customer key and secret key for each new application with a different device ID?  
Thanks

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [November 14, 2020, 8:43pm UTC](https://forums.losant.com/t/new-device-id-causes-failure-to-connect-to-losant-mqtt-broker/3399/3 "2020-11-14T20:43:18Z")

</div>

Access Keys and Secrets are scoped to a single application. An access key from one application cannot be used to authenticate a device from a different application.

So in this case, you will need to create a new access key and secret within your new application.

For security best practices, it is also recommended to use a single access key and secret per device ID. This way if an access key and secret were ever compromised, the affect is limited to only one device.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Assouad](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@Nicolas\_Assouad](https://forums.losant.com/u/Nicolas_Assouad)\
**Post date:** [November 15, 2020, 3:04pm UTC](https://forums.losant.com/t/new-device-id-causes-failure-to-connect-to-losant-mqtt-broker/3399/4 "2020-11-15T15:04:53Z")

</div>

Got it…Thanks…
