A module help you to let user authenticate their google account from command line
When build command line tools, it's not very convinient for user to copy link and go to browser, then paste the authroization code to the terminal. This authentication process is not user freindly for command line tools.
This module will try to open browser and let user make decision whether grant the authorization or not, and the authorization code will be returned back to your program.
It based on project google-api-nodejs-client
see test/test.js in repository.
gauth // scopesaccess_type: 'offline' // will return a refresh tokenscope: ''// the client key you applied in// the redirect url should be localhost, and your should provide a port, if not default use 80client_id: "<the client id>"client_secret: "<client secret>"port: 8080timeout: 5000 // in secondsif err return doneerr;console.logtokens; // tokens with access_code and refresh_codeclientpluspeoplegetuserId: "me"withAuthClientauthClient // authClient now can be usedexecuteconsole.logprofile err;doneerr;;;
(The MIT License)
Copyright (c) 2014, Villa.Gao <firstname.lastname@example.org>; All rights reserved.