Skip to content

Commit

Permalink
Remove type query parameter from OAuth2 requests.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Brad Gignac committed Jul 27, 2013
1 parent 3fc9c63 commit 8658d7d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,19 @@ 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);
}

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;

Expand Down

0 comments on commit 8658d7d

Please sign in to comment.