Summary:
A few days ago, my app which schedules Zoom meetings quit working.
API calls are returning: {“code”:124,“message”:“Invalid access token.”}
Are there any issues around time as part of the JWT token that could be causing me issues?
Detail:
Everything has been working fine for several months and in my local code which is set up identical is executing API calls just fine.
I am using the ZoomUS package(so a server module) as the API wrapper which handles the JWT encoding.
Reading up a little expiration time is an important part of the JWT.
Can anyone think of any quarks around time that could be the issue?
The token expiration uses 60 minutes added to time.time
** I have verified key and secret in the app are correct.
Think I am down the root . . . not sure how to create a global solution. Any ideas
After many hours of trial and error the issue seems to be in the encoding of the token. In comparing the jwt token between Anvil and my local environment I eventually noticed that the token in the Anvil object was a byte object and the local token was a string.
Is it possible that pyJWT was rolled back in the server packages?
Not an expert on how and when this class instantiates every time I use it. Do I need to add this every time I call the API in a function?
Is it possible to have two versions of pyJWT in server packages? Then how to do I guarantee that the server package that is calling this package uses the correct version?
Little further digging: the PyJWT package switched to returning a string instead of a byte in version 2.0.
Anvils server package is at 1.7.1.
First time I have ever had to deal with a package dependency issue. This is difficult in Anvil because we do not control the packages or have the ability to pin their versions.
Possibly write a script that will check package versions and write to log table. Next time something breaks unexpectedly, I will check for changes in dependencies first.
Now, how to get a list of all packages and dependencies, without going through every import and manually looking up the dependency chain?
This might be the start: