我已经分叉并克隆了这个 repo:https ://github.com/watson-developer-cloud/personality-insights-nodejs
我已经在文件中添加了我的消费者密钥和秘密,credentials.json
就像它在文件中所说的那样,README
但我得到了一个500 Error
. 我认为问题是我需要包含我的访问令牌和访问令牌秘密,但不清楚我将在哪里包含它。
这是500 Error
我得到的(注意:我替换了敏感路径和变量):
GET /auth/twitter? 302 227.700 ms - 0
error: Error: Failed to find request token in session
at SessionStore.get (/project/node_modules/passport-oauth1/lib/requesttoken/session.js:13:44)
at Strategy.OAuthStrategy.authenticate (/project/node_modules/passport-oauth1/lib/strategy.js:214:33)
at Strategy.authenticate (/project/node_modules/passport-twitter/lib/strategy.js:87:40)
at attempt (/project/node_modules/passport/lib/middleware/authenticate.js:348:16)
at authenticate (/project/node_modules/passport/lib/middleware/authenticate.js:349:7)
at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5)
at next (/project/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/project/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5)
at /project/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/project/node_modules/express/lib/router/index.js:330:12)
at next (/project/node_modules/express/lib/router/index.js:271:10)
at Function.handle (/project/node_modules/express/lib/router/index.js:176:3)
at router (/project/node_modules/express/lib/router/index.js:46:12)
at Layer.handle [as handle_request] (/project/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/project/node_modules/express/lib/router/index.js:312:13) 'url:' '/auth/twitter/callback?oauth_token=SOME_TOKEN&oauth_verifier=SOME_VERIFIER' 'Error:' code=500, code=undefined, error=undefined
GET /auth/twitter/callback?oauth_token=SOME_TOKEN&oauth_verifier=SOME_VERIFIER 500 6.464 ms - 23
401 Error
当我试图在没有Oauth的情况下访问其他人的推文时,我也会得到一个,特别是我得到这个错误:
error: { code: 401,
error: 'Unauthorized: Access is denied due to invalid credentials' } 'url:' '/api/profile/twitter'
'Error:' code=401, code=401, error=There was a problem processing the personality. Please check your credentials.