M2M token usage in Actions

Hi there,

As part of my login flow, I have an action that executes the following when a new user signs up:

  1. Send a request with client id & client secret to an M2M Application in exchange for an access token
  2. Use that access token to send a request to my API

This works. However, it appears I’m burning one access token from my allotted amount in my pricing tier with every user sign up, and if I released this implementation to production, we’d run out of access tokens in a very short period of time. Given my access tokens are configured to not expire for a few hours, what are my options? Is there somewhere I can cache the access token to reuse it in the next action execution? Or is there a way to configure the M2M application to give me the same access token as long as it does not expire within a few seconds? Thank you.

Hi @f8DhZh3P,

Welcome to the Auth0 Community!

I understand you have some questions about M2M token usage in Actions.

Unfortunately, when using Management API in Actions, it is not possible to cache the Access Token and must always request a new one.

Generally, if you are exceeding your alloted quota, we recommend revising your architecture and design.

Please reach out if you have any additional questions.

Thanks,
Rueben

1 Like

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