We’re migrating from JWT to the Server-Server OAuth application. And we see the “invalid access token” error for some of our requests:
Error response: {"code":124,"message":"Invalid access token."}
I can reproduce it:
Generate token:
curl --location --request POST 'https://zoom.us/oauth/token?grant_type=account_credentials&account_id=XXX' \
--header 'Authorization: Basic XXX'
I can receive an access token, then create a meeting but when I try to remove the meeting I receive this error again. So there is no 100% when the access token doesn’t work at all.
And all requests are done during the same couple of seconds so it’s an expiration issue.
We have many instances of our service and there are many requests on each instance. Each request generates a new access token. Can it be a problem?
Hi @maksymhryhoriev
Thanks for reaching out to the Zoom Developer Forum and welcome to our community, I am happy to help here!
As of right now, the expected behavior when using Server to Server OAuth app, the creation of a new token will invalidate the previous one. So please make sure you are using the most recent token when making API calls so you dont run into this issue.
We have many stateless instances of our service which owns Zoom integration. Now we have to add a common data store + distributive lock. Are there any other options to avoid it?
@maksymhryhoriev
Hi ! yes this feature was released over the weekend
you can generate as many tokens as you want, so it would be up to what works best for you. I think I would do it per service instance so you are not generating tokens per request
Do I need to pass some special parameter to /oauth/token endpoint to make sure other tokens are not invalidated? I can see that change was released 20 days ago and yet I have been experiencing that issue last week.