# Keeping M2M tokens to re-use in action

**URL:** <https://community.auth0.com/t/keeping-m2m-tokens-to-re-use-in-action/87068>\
**Category:** Get Help\
**Tags:** actions, m2m-tokens\
**Created:** [July 15, 2022, 8:34pm UTC](https://community.auth0.com/t/keeping-m2m-tokens-to-re-use-in-action/87068 "2022-07-15T20:34:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian.weissmann](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/christian.weissmann/32/33549_2.png) [@christian.weissmann](https://community.auth0.com/u/christian.weissmann)\
**Post date:** [July 15, 2022, 8:34pm UTC](https://community.auth0.com/t/keeping-m2m-tokens-to-re-use-in-action/87068/1 "2022-07-15T20:34:52Z")

</div>

On the login actions with the first login I need to hit an API endpoint behind my auth wall. I would like to use an M2M token to get to the endpoint. However, as these tokens are limited, I don’t want to re-generate one every time I need to hit that endpoint.

My understanding is, actions can not persist data.  
Which leads to my question: How can I generate a token and then keep it for my action to re-use every time I need to get past my auth wall?  
Ideally I then use it to refresh when it expires.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 15, 2022, 11:14pm UTC](https://community.auth0.com/t/keeping-m2m-tokens-to-re-use-in-action/87068/3 "2022-07-15T23:14:03Z")

</div>

Hello @christian.weissmann welcome to the community!

> [@christian.weissmann](#):
>
> Which leads to my question: How can I generate a token and then keep it for my action to re-use every time I need to get past my auth wall?

Unfortunately, as you’ve discovered, there’s currently no mechanism to cache tokens in Actions - This is a common ask, and something that is being discussed internally. I did a brief dig through our Feedback section and did find [this request](https://community.auth0.com/t/add-rate-limiting-and-cache-for-m2m-token-authentication-endpoints/75367/11) which I definitely recommend adding to - Our product team monitors these closely 🤞

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 30, 2022, 11:14pm UTC](https://community.auth0.com/t/keeping-m2m-tokens-to-re-use-in-action/87068/4 "2022-07-30T23:14:41Z")

</div>

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