Permalink
Browse files

adding relaxed OAuth2 support

  • Loading branch information...
1 parent 60983f5 commit f59228d5f0553433ff0ffa61ad8fb3417d726815 @lornajane committed Oct 11, 2012
Showing with 7 additions and 3 deletions.
  1. +1 −1 app.js
  2. +6 −2 public/data/apiconfig.json
View
2 app.js
@@ -528,7 +528,7 @@ function processRequest(req, res, next) {
}
if (apiConfig.auth == 'oauth2' && req.body.oauth == 'authrequired') {
- options.headers['Authorization'] = "OAuth " + req.body.apiKey;
+ options.headers['Authorization'] = apiConfig.keyParam + " " + req.body.apiKey;
}
if (!options.headers['Content-Length']) {
@@ -12,8 +12,11 @@
"protocol": "https",
"baseURL": "api.github.com",
"publicPath": "",
- "auth": "",
- "keyParam": ""
+ "sendFormat": "json",
+ "auth": "oauth2",
+ "keyParam": "token",
+ "oauth": {
+ }
},
"klout": {
"name": "Klout API",
@@ -75,6 +78,7 @@
"baseURL": "test.api.joind.in",
"publicPath": "",
"auth": "oauth2",
+ "keyParam":"OAuth",
"oauth": {
}
}

0 comments on commit f59228d

Please sign in to comment.