Auto-refresh access token for Zoom API not working

Using the Zoom API with OAuth 2.0 expires the access token after one hour. These are their instructions to refresh it:

What do I need to do to get this working? Currently, I'm able to authenticate by clicking on Re-authenticate API, but I'd like to not have to do this every hour.

This is my current setup (plus my Client ID and Client Secret):

Hi @alex-w, I'd love any pointers on this if you have any. I'm totally stuck and it's kind of critical for my app. I don't know what else to do. :sweat_smile:

Hi Nacho!

Well, I set up a connection to my own zoom account to work on testing this. So far, my understanding is that a single use refresh token is returned when the initial Oauth2 authentication happens. Capturing that refresh token is highly challenging and I’m not certain it is possible in Retool. I’m going to meet with another team member that is a little more familiar and see if they think there’s a way to accomplish this.

1 Like

Ok, so we’ve discovered a few things so far:

  • Ideally, we should be saving the refresh token on our end and automatically using it to try to reauthenticate the resource when it’s authentication expires. It doesn’t seem to be happening with the Zoom API, and it’s difficult to track down the cause because to test it we need to have the access expire, not get revoked manually.
  • If you have full admin access on the account, you can authenticate your resource using a JWT token, which you are able to specify the expiration time on. If this works for you, I would definitely recommend going down that route

Thanks a lot for the help, Alex.

If you wait 60 minutes, the access will expire and you’ll be able to refresh. I know it’s not ideal for testing, but this is the only way I’m aware of. There’s also some discussion about this in the Zoom forums:

I hadn’t considered JWT because the guide said you don’t allow it and I saw a few threads in the forum saying the same: How to Refresh JWT Token with Custom Auth, JWT Authentication of REST API, Display HTTP GET result

I’ll give it another try and let you know what I find.

Ok, it seems that this was way easier than I thought (although it doesn't seem very secure :sweat_smile:)

  1. Create a JWT app in Zoom

  2. Fill out the information and click on View JWT Token

  3. Choose "Other" and set a date in the future (this is the unsecure part. :sweat_smile: Ideally, I should be able to create a new one for every request) and copy the Token

  4. Create a new REST API resource in Retool

  5. Set the Base URL, the Content-Type header to application/json and the Authorization header (Bearer <TOKEN>).

  6. Save the resource. Now you can create a query that uses it.

I think that the issue in those cases has to do with automatically provisioning or refreshing those JWT tokens without user input. In this situation the alternative is manually authenticating every 60 minutes vs manually authenticating every X amount of time :man_shrugging:

1 Like