# Oauth refresh token, best workflow?

**URL:** <https://discourse.nodered.org/t/oauth-refresh-token-best-workflow/62962>\
**Category:** General\
**Tags:** security\
**Created:** [23 May 2022 10:51 UTC](https://discourse.nodered.org/t/oauth-refresh-token-best-workflow/62962 "2022-05-23T10:51:48Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![lizzardguki](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lizzardguki/32/103637_2.png) [@lizzardguki](https://discourse.nodered.org/u/lizzardguki)\
**Post date:** [23 May 2022 10:51 UTC](https://discourse.nodered.org/t/oauth-refresh-token-best-workflow/62962/1 "2022-05-23T10:51:48Z")

</div>

I have a basic OAuth flow to authenticate with 3rd party API , after the authentication is successful, I use a delay node to wait for x seconds (expires\_in property - 100 seconds) and then I push the message to refresh the token, and I am trying to keep that loop going, but after a couple of token refreshes, the node-red fails to authenticate. Is there any better way to make the flow?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/645da267561d01b2bd3699b07bfb07ee7a7c07f2.png)

---

_[View the full topic](https://discourse.nodered.org/t/oauth-refresh-token-best-workflow/62962)._
