Description
I test OAuth features and there are some problems
In my test env is local
I tried blow steps
1.Request user authorization on my frontend web(local test 127.0.0.1) and work well and redirected to URL that is on [Redirect URL for OAuth] of App credentials.
2.get a CODE from redirected querystring
3.call backend server(local test nodejs) with Returned CODE from step2
blow is my code
app.get('/z1/:code', (req, res) => {
var rcode = req.params.code;
fetch("https://zoom.us/oauth/token", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization":"Basic ZjhmSklINXNUNHVrSVQyc2I4Wk1OZzo5ODV1U3dSNkpkclJWcW1wWGljTkVzSkw0QThqMXZCMg=="
},
body: JSON.stringify({
code:rcode,
grant_type:'authorization_code',
redirect_uri:'http://127.0.0.1:8080/eden/zoomredirect'
}),
}).then((response) => console.log(response));
});
but error is returned
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://zoom.us/oauth/token',
status: 400,
statusText: 'Bad Request',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}