我已经分叉并克隆了这个仓库:https://github.com/watson-developer-cloud/personality-insights-nodejs
我已经添加了我的消费者密钥& credentials.json
文件中的秘密就像它在README
中所述,但我得到的是500 Error
。我认为问题在于我需要包含我的Access Token&访问令牌秘密,但不清楚我将把它包含在哪里。
这是我得到的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.
答案 0 :(得分:0)
你确定你在Twitter电话上获得了401吗?设置Twitter访问权限的说明在您提供的链接的回购说明中,在“设置Twitter应用程序”标题下。