# New Device Using Experience Workflow

**URL:** <https://forums.losant.com/t/new-device-using-experience-workflow/5688>\
**Category:** Help\
**Tags:** experience\
**Created:** [November 27, 2024, 8:07am UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688 "2024-11-27T08:07:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subrahmanyam\_Jonnal1](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@Subrahmanyam\_Jonnal1](https://forums.losant.com/u/Subrahmanyam_Jonnal1)\
**Post date:** [November 27, 2024, 8:07am UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/1 "2024-11-27T08:07:46Z")

</div>

Hi,

I am trying a create a new device using the methodology specified as below. [https://forums.losant.com/t/self-register-devices-faster/2534](https://forums.losant.com/t/self-register-devices-faster/2534)

How do retrieve access secret after creation

Thanks  
Subrahmanyam

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [November 27, 2024, 2:35pm UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/2 "2024-11-27T14:35:03Z")

</div>

[Access key secrets](https://docs.losant.com/applications/access-keys/#access-secret) cannot be retrieved after creation; you need to send the key and secret back to the device in the response to its registration request.

We have a [Dynamic Registration template](https://app.losant.com/applications/recent/template-library?templateId=5f909d5ec0779800540ef0fb) that demonstrates the concept from the forum post. I recommend you start by importing that.

---

<div class="post-metadata">

**Author:** ![Subrahmanyam\_Jonnal1](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@Subrahmanyam\_Jonnal1](https://forums.losant.com/u/Subrahmanyam_Jonnal1)\
**Post date:** [December 5, 2024, 12:04pm UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/3 "2024-12-05T12:04:19Z")

</div>

Thanks. Instead of using the manufacturing ID, I want to use the device name in the payload. Currently, I’m using the manufacturing ID as an alias for the device name. Additionally, is there a way to use service credentials instead of a token?

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [December 5, 2024, 2:48pm UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/4 "2024-12-05T14:48:58Z")

</div>

That depends on what you mean by “use service credentials”. The device making the request to Losant cannot use a service credential to send authentication information.

However, you could use a [JWT service credential](https://docs.losant.com/applications/credentials/#json-web-tokens-jwt) to store a secret used to sign - and then verify - a token unique to each device. The device then sends that token up in the request and you use a [JWT: Verify Node](https://docs.losant.com/workflows/logic/jwt-verify/) that references that credential to ensure the request from the device is legitimate.

---

<div class="post-metadata">

**Author:** ![Subrahmanyam\_Jonnal1](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@Subrahmanyam\_Jonnal1](https://forums.losant.com/u/Subrahmanyam_Jonnal1)\
**Post date:** [December 5, 2024, 3:05pm UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/5 "2024-12-05T15:05:00Z")

</div>

Thanks. I tried that and got a malformed jwt error after providing ‘credential id’ to ‘token to decode template’.  
In the above, I was referring to token and manufacturingId in the Payload.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [December 5, 2024, 3:56pm UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/6 "2024-12-05T15:56:40Z")

</div>

You need to provide an actual JWT that was created using the secret you’d be storing in the credential - not just the ID of the credential.

The template I mentioned includes a sample workflow both for generating and for verifying a JWT. The template stores the secret value in an application global; you would just need to create a JWT credential to store the secret and adjust the flows to use the credential instead of the global.

---

<div class="post-metadata">

**Author:** ![Subrahmanyam\_Jonnal1](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@Subrahmanyam\_Jonnal1](https://forums.losant.com/u/Subrahmanyam_Jonnal1)\
**Post date:** [December 5, 2024, 4:20pm UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/7 "2024-12-05T16:20:53Z")

</div>

My apologies. After creation, how do access, All I see is Credential ID. I am pretty new to this.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [December 5, 2024, 6:15pm UTC](https://forums.losant.com/t/new-device-using-experience-workflow/5688/8 "2024-12-05T18:15:58Z")

</div>

I recommend reading our [documentation on service credentials](https://docs.losant.com/applications/credentials/#using-service-credentials) and our [blog post announcing the original feature](https://www.losant.com/blog/cloud-service-credentials-payload-usage-visibility).

The whole point of service credentials is to hide the sensitive authentication information after creation of the credential, and only allow using of it by the Losant back end to interact with third-party services.

So, assuming we are still talking about the same use case that started this thread - dynamic device registration and returning a new access key / secret in response to the registration request - then you should stick with the template I mentioned originally and, if you wish to store the JWT secret in a service credential, to then modify the imported template resources to use a credential for signing the original JWT(s) to distribute to the devices, and also to verify the requests coming back from those devices.

I will also file a ticket to update that template to use a credential instead of globals to store the JWT signing secret.
