Skip to content

Commit

Permalink
Defined content-type for OAuth 2.0 (Client Credentials) request.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Lazutkin committed Oct 31, 2013
1 parent bb88332 commit 7ad9f4d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.js
Expand Up @@ -266,7 +266,10 @@ function oauth2(req, res, next){
var encoded_basic = new Buffer(basic_cred).toString('base64')

http_method = (apiConfig.oauth2.authorizationHeader == 'Y') ? "POST" : "GET";
header = (apiConfig.oauth2.authorizationHeader == 'Y') ? {'Authorization' : 'Basic ' + encoded_basic} : '';
header = { 'Content-Type': 'application/x-www-form-urlencoded' };
if ( apiConfig.oauth2.authorizationHeader == 'Y' ) {
header[ 'Authorization' ] = 'Basic ' + encoded_basic;
}
fillerpost = query.stringify({grant_type : "client_credentials", client_id : apiKey, client_secret : apiSecret});

db.set(key + ':apiKey', apiKey, redis.print);
Expand Down

0 comments on commit 7ad9f4d

Please sign in to comment.