Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adding relaxed OAuth2 support

  • Loading branch information...
commit f59228d5f0553433ff0ffa61ad8fb3417d726815 1 parent 60983f5
Lorna Jane Mitchell authored

Showing 2 changed files with 7 additions and 3 deletions. Show diff stats Hide diff stats

  1. +1 1  app.js
  2. +6 2 public/data/apiconfig.json
2  app.js
@@ -528,7 +528,7 @@ function processRequest(req, res, next) {
528 528 }
529 529
530 530 if (apiConfig.auth == 'oauth2' && req.body.oauth == 'authrequired') {
531   - options.headers['Authorization'] = "OAuth " + req.body.apiKey;
  531 + options.headers['Authorization'] = apiConfig.keyParam + " " + req.body.apiKey;
532 532 }
533 533
534 534 if (!options.headers['Content-Length']) {
8 public/data/apiconfig.json
@@ -12,8 +12,11 @@
12 12 "protocol": "https",
13 13 "baseURL": "api.github.com",
14 14 "publicPath": "",
15   - "auth": "",
16   - "keyParam": ""
  15 + "sendFormat": "json",
  16 + "auth": "oauth2",
  17 + "keyParam": "token",
  18 + "oauth": {
  19 + }
17 20 },
18 21 "klout": {
19 22 "name": "Klout API",
@@ -75,6 +78,7 @@
75 78 "baseURL": "test.api.joind.in",
76 79 "publicPath": "",
77 80 "auth": "oauth2",
  81 + "keyParam":"OAuth",
78 82 "oauth": {
79 83 }
80 84 }

0 comments on commit f59228d

Please sign in to comment.
Something went wrong with that request. Please try again.