# Custom code not working after private app rotation

**URL:** <https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265>\
**Category:** CMS Development\
**Tags:** local-development\
**Created:** [August 27, 2024, 8:42am UTC](https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265 "2024-08-27T08:42:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahe](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mahe](https://community.hubspot.com/u/Mahe)\
**Post date:** [August 27, 2024, 8:42am UTC](https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265/1 "2024-08-27T08:42:29Z")

</div>

Hi,  
After having rotated my private app, all my workflows are not able to execute, returning a 401 error “Authentication credentials not found”.  
Anyone had the same experience, and have found possible solutions that does not involve going trough all my custom code workflows.

---

<div class="post-metadata">

**Author:** ![coldrickjack](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/coldrickjack/32/6684_2.png) [@coldrickjack](https://community.hubspot.com/u/coldrickjack)\
**Post date:** [August 27, 2024, 11:12am UTC](https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265/2 "2024-08-27T11:12:54Z")

</div>

Hey @Mahe,

If you rotate the access token you need to go into each of your worklfows and update the secret there also.

Not ideal I know, but it’s unfortunatley the way it is at the moment…

Jack

---

<div class="post-metadata">

**Author:** ![Mahe](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mahe](https://community.hubspot.com/u/Mahe)\
**Post date:** [August 27, 2024, 11:14am UTC](https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265/3 "2024-08-27T11:14:35Z")

</div>

And when you say update, how is that? I have tried removing the secret, and adding it again, but the same error happens

---

<div class="post-metadata">

**Author:** ![coldrickjack](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/coldrickjack/32/6684_2.png) [@coldrickjack](https://community.hubspot.com/u/coldrickjack)\
**Post date:** [August 27, 2024, 11:17am UTC](https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265/4 "2024-08-27T11:17:30Z")

</div>

You need to navigate to the custom coded action in the workflow. When you click on the action you will have the ability to “manage secrets” as per the screenshot below:

 ![Screenshot 2024-08-27 at 12.16.18.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/721a67488ffbad7637a8074e85608887b665900d.png)

Next, you click on “Edit” as per the below:

 ![Screenshot 2024-08-27 at 12.15.39.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/7/47c29ca9eca825d0c3fe460c1bd4ec497c375168.png)

Then a pop up will appear that lets you paste in the new access token/secret value:

 ![Screenshot 2024-08-27 at 12.15.43.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/3/35910937ed13fdd58acd66fe238edab49e155fe4.png)

---

<div class="post-metadata">

**Author:** ![Mahe](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mahe](https://community.hubspot.com/u/Mahe)\
**Post date:** [August 27, 2024, 11:19am UTC](https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265/5 "2024-08-27T11:19:44Z")

</div>

@coldrickjack thank you very much! Certainly not an ideal solution as we have a lot of workflows using custom code, and this secret.  
Do you know if there is a feature request open to change this? Then that deserves an upvote

---

<div class="post-metadata">

**Author:** ![coldrickjack](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/coldrickjack/32/6684_2.png) [@coldrickjack](https://community.hubspot.com/u/coldrickjack)\
**Post date:** [August 27, 2024, 12:11pm UTC](https://community.hubspot.com/t/custom-code-not-working-after-private-app-rotation/115265/6 "2024-08-27T12:11:05Z")

</div>

No problem at all @Mahe, I agree - definitely would be useful to have this. Not sure if there is an existing feature request out there though…
