I generate a token
Store the token in redis
And have a service check/remake it when needed and put it back into redis
Then when a thing needs app access it’ll grab it from redis.
I have multiple scripts/servers both cronjob/long form that need a token so I use redis to store the one token to rule them all and they all call from there