After first try, OAuth app get "Invalid authorization code" error when request a new OAuth token

Hello!

I created an OAuth app. After installing it, I got the authorization code.

Using this authorization code, I was able to get OAuth token at the first try. See the following logs.

2020-06-05 20:07:45.163  INFO 74688 --- [   scheduling-1] c.o.o.e.n.q.i.s.p.ActivityMeetingProcess : Get Zoom OAuth: https://zoom.us/oauth/token?grant_type=authorization_code&code=olsDh8lp8w_yhMUmzNeQkyqlte7Etc8Bw&redirect_uri=https:/myredirecturl
2020-06-05 20:07:45.878  INFO 74688 --- [   scheduling-1] c.o.o.e.n.q.i.s.p.ActivityMeetingProcess : Get OAuth: https://zoom.us/oauth/token?grant_type=authorization_code&code=olsDh8lp8w_yhMUmzNeQkyqlte7Etc8Bw&redirect_uri=https://myredirecturl 200 {"access_token":"..","token_type":"bearer","refresh_token":"...","expires_in":3599,"scope":"dashboard_meetings:read:admin meeting:write:admin"}

After one minute, I use the same authorization code and try to get a new OAuth token. However, I got 400 with “Invalid authorization code”

2020-06-05 20:08:46.609  INFO 74688 --- [   scheduling-1] c.o.o.e.n.q.i.s.p.ActivityMeetingProcess : Get Zoom OAuth: https://zoom.us/oauth/token?grant_type=authorization_code&code=olsDh8lp8w_yhMUmzNeQkyqlte7Etc8Bw&redirect_uri=https://myredirecturl
2020-06-05 20:08:47.313 ERROR 74688 --- [   scheduling-1] c.o.o.e.n.q.i.s.p.ActivityMeetingProcess : fail to get OAuth: https://zoom.us/oauth/token?grant_type=authorization_code&code=olsDh8lp8w_yhMUmzNeQkyqlte7Etc8Bw&redirect_uri=https://myredirecturl 400 Bad Request {"reason":"Invalid authorization code olsDh8lp8w_yhMUmzNeQkyqlte7Etc8Bw","error":"invalid_request"}

No matter how many times I tried, with this authorization code, I got the same error. I didn’t reinstall the app to generate a new authorization code.

Could you explain to me why this happen? Thank you.

Hello! Zoom team,

Can you help on this issue?

I got the Auth code by clicking “Install” on the following page

The I was redirected to the following page which has the code in the URL.

Hey @heidi.zh.n,

This is the expected flow. The auth code can only be used once to get an access token.

To refresh your access token, please follow the refresh flow, or direct the user to install / authorize the app again.

Thanks,
Tommy