Refresh token request failing with 401

@tommy also experiencing this issue. DMing details to you. Thanks for all the help lately :slight_smile:

You are welcome! :slight_smile:

Thanks for sending details, we are looking into this. (ZOOM-148612)

-Tommy

Hi @tommy, we have 6 examples of this error from recent days. We lock while updating Zoom access tokens, so we are confident we are using the most recent refresh token. Would you like additional examples to help debug?

Edit: the access token is valid for the hour, as expected, but we get a 401 when trying to generate a new access token from our refresh token.

Hey @mattpegler,

Apologies you are running into this issue.

Can you private message me your most recent access_token and refresh_token and Client ID so I can debug?

Thanks,
Tommy

Hey @jford,

After looking into the logs, we have found that the issue is because the user uninstalled the application, so the token has been revoked

The user installed it on Mar 31, 2020 @ 20:27:35.183 (UTC) and uninstalled it on Mar 31, 2020 @ 21:31:42.850. And you got the error on Apr 1, 2020 @ 16:00:44.168.

Hey @ncsquared,

After looking into the logs, we have found that the issue is because you authorized the application twice but only hold the OAuth token from the first authorization

You authorized the application on Mar 26, 2020 @ 19:04:09.421 (UTC) and authorized the application again on Mar 26, 2020 @ 19:18:02.489. And you hold the token from first authorization. But these tokens will be revoked when the user authorize the application again. Make sure to save the latest tokens when re authorizing or refreshing the access_token.

Thanks,
Tommy

Hey @tommy,

I got the error while the app was installed. The error time you mentioned is over a day after I posted you the error details.

Thanks,
James

Sharing in hopes this helps others on this threadā€¦

Iā€™ve been calling the API using Content-Type: application/json and a json payload to refresh the token. This is rejected by Zoomā€™s OAuth server with the error 401 { code: 124, message: 'invalid access token' }, which is the same error given, when using a bad refresh token.

I switched my code to use application/x-www-form-urlencoded, and it works like a charm.

@tommy the API docs section on OAuth doesnā€™t have an example request for token refresh. Because Iā€™m an OAuth n00b, I assumed this endpoint will accept JSON posts like the rest of the APIā€¦ Another doc improvement for your trello/jira/dev/null or a feature request for a different error message when the Content-Type is wrong :slight_smile:

Hey @ncsquared,

Strange, it should work with a type application JSON request too.

Here are the refresh docs: https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing

Thanks,
Tommy

Hey @jford,

Strange. Can you try the install flow again and see if that fixes it?

Thanks,
Tommy

@tommy good to know about this page. I thought this was the reference page https://marketplace.zoom.us/docs/api-reference/using-zoom-apis

1 Like

Happy to help! :slight_smile:

-Tommy

Hi Tommy,
I am getting this error
{
ā€œreasonā€: ā€œInvalid Token!ā€,
ā€œerrorā€: ā€œinvalid_requestā€
}

and here is my URL https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token={refersh Token}

In header
Authorization Basic base64Encode (Client_ID:Client_Secret)
Please help me to resolve this

Thanks,

Hi Iā€™m getting this error ā€™ {ā€œreasonā€:ā€œInvalid Token!ā€,ā€œerrorā€:ā€œinvalid_requestā€} ā€™ for some reason which was working before. All of a sudden all of our users are reporting that zoom integration is not working. Please respond asap.

Hey @asif,

Please make sure you are making a POST request and not a GET request.

Thanks,
Tommy

Hey @picktime,

I will respond to you in your other thread:

Thanks,
Tommy

Hi @tommy

Please can you verify the issue asap. We have been waiting on it for last 1 week. Please let us know if there is any update.

Hi @tommy

Is there a way to directly get in touch with you?

For future note - Weā€™re currently investigating with other users in the thread Tommy linked above

We have the same issue - is there any update?

For others reference, here is the solution to @picktimeā€™s issue:

Thanks,
Tommy