title: Authenticating with Google oauth through Bot Framework Emulator using node
body: <p>I've unsuccessfully scoured the internet for an example of how to authenticate against Google APIs using node and the Bot Framework emulator. I've got as far as calling the Google login but have no idea how to capture the authorisation code back in the bot. I am using the npm module googleapis. The code so far:</p>
  
  <pre><code> var google = require('googleapis');
   var OAuth2Client = google.auth.OAuth2;
   var plus = google.plus('v1');
   var CLIENT_ID = "xxx.apps.googleusercontent.com";
   var CLIENT_SECRET = "xxx";
   var REDIRECT_URL = 'http://localhost:3978'; // Not sure about this!
  
   var oauth2Client = new OAuth2Client(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL);
   var url = oauth2Client.generateAuthUrl({
           access_type: 'offline', 
           scope: 'https://www.googleapis.com/auth/drive' 
       });
  </code></pre>
  
  <p>The url generated takes me to the Google login page. From there, I haven't been able to make any progress. I've tried <a href="https://github.com/google/google-api-nodejs-client/blob/master/samples/oauth2.js" rel="nofollow noreferrer">https://github.com/google/google-api-nodejs-client/blob/master/samples/oauth2.js</a> and a few other examples but none that use the bot framework. I am unclear as to how to retrieve the authentication code in the bot once I allow access on the Google authentication web page. Any guidance is appreciated.</p>