# Token authentification + Alive

**URL:** <https://community.n8n.io/t/token-authentification-alive/20017>\
**Category:** Questions\
**Tags:** external-api\
**Created:** [November 21, 2022, 8:20pm UTC](https://community.n8n.io/t/token-authentification-alive/20017 "2022-11-21T20:20:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daradaal](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/daradaal/32/10625_2.png) [@Daradaal](https://community.n8n.io/u/Daradaal)\
**Post date:** [November 21, 2022, 8:20pm UTC](https://community.n8n.io/t/token-authentification-alive/20017/1 "2022-11-21T20:20:51Z")

</div>

Hello,

I would need help on a solution to manage authentication on an API that returns me a token.  
I have a problem when my token expires during my workflows.

How can I renew it when it expires?

Here is the capture to retrieve the TOKEN

 ![01 0](https://europe1.discourse-cdn.com/n8n/original/3X/4/f/4f2ab9f4e401d87b2fe664dcb001a74e181bc654.png)  
As well as the return example:  
 ![02 0](https://europe1.discourse-cdn.com/n8n/original/3X/e/e/ee0425b1b62bd82f1ec25c9d66085081dde92649.png)

I also have a GET Alive I don’t know if it’s used for the refresh-token.

 ![03 0](https://europe1.discourse-cdn.com/n8n/original/3X/8/8/8808d2dacc2573d8e66985ba7363db7ae8f13fb7.png)  
Anyway, thanks in advance for your help.

🙂

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [November 23, 2022, 3:11pm UTC](https://community.n8n.io/t/token-authentification-alive/20017/2 "2022-11-23T15:11:23Z")

</div>

Hi @Daradaal, the `/api/Authenticated/Alive` looks like a test request to make sure a token is valid. Is the first request (`/api/Authenticated`) used to renew the token? How often would you need to run it to get a fresh token?

My first thought would be to have one workflow simply renewing the token as often as needed and writing the current token somewhere other workflows can read it from (a database or perhaps just a file).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [January 4, 2023, 10:43pm UTC](https://community.n8n.io/t/token-authentification-alive/20017/3 "2023-01-04T22:43:48Z")

</div>

Closed on January 4, 2023, 10:43pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
