drive.js
function authorize(credentials, callback) {
    var clientSecret = credentials.installed.client_secret;
    var clientId = credentials.installed.client_id;
    var redirectUrl = credentials.installed.redirect_uris[0];
    var auth = new googleAuth();
    var oauth2Client = new auth.OAuth2(clientId, clientSecret, redirectUrl);

    // Check if we have previously stored a token.
    fs.readFile(TOKEN_PATH, function(err, token) {
        if (err) {
            getNewToken(oauth2Client, callback);
        } else {
            oauth2Client.credentials = JSON.parse(token);
            callback(oauth2Client);
        }
    });
}
function authorize(credentials, callback) {
    var clientSecret = credentials.installed.client_secret;
    var clientId = credentials.installed.client_id;
    var redirectUrl = credentials.installed.redirect_uris[0];
    var auth = new googleAuth();
    var oauth2Client = new auth.OAuth2(clientId, clientSecret, redirectUrl);

    // Check if we have previously stored a token.
    fs.readFile(TOKEN_PATH, function(err, token) {
        if (err) {
            getNewToken(oauth2Client, callback);
        } else {
            oauth2Client.credentials = JSON.parse(token);
            callback(oauth2Client);
        }
    });
}
function authorize ( credentials , callback ) { var clientSecret = credentials . installed . client_secret ; var clientId = credentials . installed . client_id ; var redirectUrl = credentials . installed . redirect_uris [ 0 ] ; var auth = new googleAuth ( ) ; var oauth2Client = new auth . OAuth2 ( clientId , clientSecret , redirectUrl ) ; // Check if we have previously stored a token. fs . readFile ( TOKEN_PATH , function ( err , token ) { if ( err ) { getNewToken ( oauth2Client , callback ) ; } else { oauth2Client . credentials = JSON . parse ( token ) ; callback ( oauth2Client ) ; } } ) ; }
This is all from the Google Drive Quickstart 
Create an OAuth2 client with the given credentials, and then execute the
given callback function.

@param {Object} credentials The authorization client credentials.
@param {function} callback The callback to call with the authorized client.
This is all from the Google Drive Quickstart Create an OAuth2 client with the given credentials and then execute the given callback function .