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

 

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
    });
  });
});

 

posted @ 2014-12-21 21:09  zyip  阅读(317)  评论(0编辑  收藏  举报