Answers for "node google client api to get user profile with already fetched token"

1

node google client api to get user profile with already fetched token

var google = require('googleapis').google;
var OAuth2 = google.auth.OAuth2;
var oauth2Client = new OAuth2();
oauth2Client.setCredentials({access_token: 'ACCESS TOKEN HERE'});
var oauth2 = google.oauth2({
  auth: oauth2Client,
  version: 'v2'
});
oauth2.userinfo.get(
  function(err, res) {
    if (err) {
       console.log(err);
    } else {
       console.log(res);
    }
});
Posted by: Guest on December-16-2020

Code answers related to "node google client api to get user profile with already fetched token"

Code answers related to "Javascript"

Browse Popular Code Answers by Language