google api , using a refresh token to get the access token

zyip發表於2014-12-21

 

router.get('/refresh',function(req,res){
  oauth2Client.credentials = { refresh_token: '1/RqVyL7yLBxwsCA4h5IzDJuMVcCwX3munQz1ntGyg99I'};
  oauth2Client.refreshAccessToken(function(err, tokens){
    res.send({
      access_token: tokens.access_token,
      token:tokens
    });
  });
});

 

相關文章