failing with
(401) {“reason”:“Invalid Token!”,“error”:“invalid_request”}
Additional context
We are always storing and reusing the refresh token
also tried curl request with same results:
curl -X POST -H “Content-Type:application/x-www-form-urlencoded” --user {client_id}:{client_secret} --data ‘grant_type=refresh_token&refresh_token={refresh_token}’ https://zoom.us/oauth/token
Finally I also tried uninstalling and reinstalling the app which gave a new access token but the same refresh token. Refresh requests are still failing.
Are you storing and using the new refresh token every time?
Each time you refresh, a new refresh token is returned which must be used for the next refresh.
“Refresh Tokens have a lifespan of 15 years. When you refresh an access token, you will also get a new refresh token that you need to use in your next refresh. Store the new refresh token safely for the next time when you try to refresh the tokens.”
I am also getting this error and I am also doing everything as documented. Not only that but the logs as linked above do not show the errors. It seems like its failing at the auth stage on zoom.us side.
I don’t see any failed logs in that link you gave me. But we do log errors to zoomus failing on our own end. Here is from oct 23 to oct 26 with timestamp:
Oct 23 17:33:02 - unable to refresh token
Oct 24 10:46:35 - unable to refresh token
Oct 24 12:26:30 - unable to refresh token
Oct 24 13:06:15 - unable to refresh token
Oct 25 11:37:36 - unable to refresh token
Oct 25 12:32:42 - unable to refresh token
Oct 26 10:36:00 - unable to refresh token
Message logged when refresh token api call to zoomus fails. And the error from zoom.us is
I should note that, to get around the issue temporarily, we ask the user to re do the authorization process by forwarding them to the authorization url. Which is definitely not ideal for us.
The app scopes were changed so the user needed to update or re install the app.
Or.
The refresh_token was not saved properly on your end so the next time you went to refresh the access_token it used an old refresh_token, hence the error.
Let me know if any of the two could have happened on your end. If not I will check the Zoom logs to see why the refresh failed.
Hey I’m investigating further on if we are not saving the refresh token properly. But could you explain step 1. I am not too sure what that involves. It’s a time sensitive issue at the moment due to not being able to create zoom.us meeting. So if there are any logs that you may find as well it would be helpful as well. Thanks.
When you change the Scopes of your app, or Event Subscriptions, this will require users to update your app to approve the additional scope change because you are accessing additional data. Once they approve, it restarts the authorization flow in which you need to get a new access and refresh token and update your database.
If users choose not to update, the application, access, and refresh token will still work as expected, but your app won’t be able to access the newly request data in the scope change.
Hey @tommy. Thanks for the explanation. I just looked into the code and tested it more. We are saving the new refresh token. I talked to someone internally who has told me that he hasn’t ran into this issue last few weeks which perhaps rule out the app scope issue. And I don’t believe the scope was being changed every day. Is it entirely possible that it could be user account related?