API calls /w python and Oauth2 & Refresh tokens

Happy Friday,

Working on a piece of code in python to make API calls in our external project management solution. There is no plugin for this in Rapid7.

I am have diffculties with the following. The solution only provides auhtorizion via codes and temporary access token. Each call returns an access token and a refresh token. The refresh token can be used next time.

This is where the problem lies. Next time is next week, but I am sure there is no option to collect this information next week :slight_smile:

If someone has a solution I am all ears/eyes.

Next week exceeded your refresh token life, you will just have to request a new token each time if you are running weekly.
I only use refresh token for long running scripts, all my scripts pull a fresh token at their start.
Not sure if this is best practices so if anyone disagrees, please chime in.