I have obtained a valid access token. like this:
{
“access_token”: “eyJhbGciOiJIUzUxMiJ9jNWVjIn0.9bhbYhldRA”,
“token_type”: “bearer”,
“refresh_token”: “eyJhbGciOiJIUzUxMiJ9.eyJhdWQM3bFZEZlRgtKEb7pjqIA”,
“expires_in”: 3599,
“scope”: "user:write:admin user:read:admin recording:write:admin dashboard:read:admin report:read:admin "
}
But token can only be used for an hour, and it will fail.
So, I want to refresh the token, but keep reporting errors, as shown below:
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor=“white”>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>
=========================================================
Here’s my implementation: I developed the application using the Java language.
String clientWord = zoomClientId + “:” + zoomClientSecret;
// base64 encode
String encodedText = base64.encodeToString(clientWord.getBytes(“UTF-8”));
// add “Basic” (like obtain an OAuth token opt)
String base64ClientWord = "Basic " + encodedText;
// send http post
HttpPost httpPost = new HttpPost(“https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=” + refreshToken);
httpPost.setHeader(“Content-Type”, “application/x-www-form-urlencoded”);
// add header ahth
httpPost.setHeader(“Authorization”, base64ClientWord);
response = httpClient.execute(httpPost);