02-26-2019 19:41
02-26-2019 19:41
I am just writing to get the access token in node js.
When i try to get the access token with the following code with 'fitbit-client-oauth2', the page always reflect 400 bad request.
I try other method to get the access token, it reflect the same error.
Please help. thanks.
app.get('/auth/fitbit/callback', function(req, res, next) {
var code = req.query.code;
client.getToken(code, redirect_uri)
.then(function(token) {
// ... save your token on db or session...
// then redirect
res.redirect(302, '/user');
})
.catch(function(err) {
// something went wrong.
res.send(500, err);
});
});
app.listen(3000);err response:
{"errors":[{"errorType":"invalid_request","message":"Missing parameters: code Visit https://dev.fitbit.com/docs/oauth2 for more information
on the Fitbit Web API authorization process."}],"success":false}
Best Answer