diff --git a/lib/oauth2.js b/lib/oauth2.js index 94ed662c..4810bc27 100644 --- a/lib/oauth2.js +++ b/lib/oauth2.js @@ -163,7 +163,8 @@ exports.OAuth2.prototype.getAuthorizeUrl= function( params ) { exports.OAuth2.prototype.getOAuthAccessToken= function(code, params, callback) { var params= params || {}; params['client_id'] = this._clientId; - params['client_secret'] = this._clientSecret; + if ( this._clientSecret ) + params['client_secret'] = this._clientSecret; var codeParam = (params.grant_type === 'refresh_token') ? 'refresh_token' : 'code'; params[codeParam]= code;