From 8658d7d55be25528a091415ca01671e6ef2a9882 Mon Sep 17 00:00:00 2001 From: Brad Gignac Date: Sat, 27 Jul 2013 18:35:09 -0400 Subject: [PATCH] Remove type query parameter from OAuth2 requests. While the type parameter was required in older versions of the OAuth2 specification, it was removed in version 8. Currently, this breaks OAuth2 against the Dropbox API. Closes #127. http://tools.ietf.org/html/draft-ietf-oauth-v2-08#section-4.1.1 --- lib/oauth2.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/oauth2.js b/lib/oauth2.js index 32c8aaeb..835b327c 100644 --- a/lib/oauth2.js +++ b/lib/oauth2.js @@ -132,13 +132,12 @@ exports.OAuth2.prototype._executeRequest= function( http_library, options, post_ if( options.method == 'POST' && post_body ) { request.write(post_body); } - request.end(); + request.end(); } exports.OAuth2.prototype.getAuthorizeUrl= function( params ) { var params= params || {}; params['client_id'] = this._clientId; - params['type'] = 'web_server'; return this._baseSite + this._authorizeUrl + "?" + querystring.stringify(params); } @@ -146,7 +145,6 @@ exports.OAuth2.prototype.getOAuthAccessToken= function(code, params, callback) { var params= params || {}; params['client_id'] = this._clientId; params['client_secret'] = this._clientSecret; - params['type']= 'web_server'; var codeParam = (params.grant_type === 'refresh_token') ? 'refresh_token' : 'code'; params[codeParam]= code;