无法从oauth2-example-orion-client获取access_token

时间:2014-09-07 21:51:10

标签: oauth fiware-orion fiware

我正在使用来自https://github.com/fgalan/oauth2-example-orion-client/的oauth2-example-orion-client,我遵循了这些步骤,但是在使用我的filab帐户登录后(我已经创建了一个获取Oauth凭据的应用程序),当它转到'callback_uri'/ login:

时,我收到以下错误
express deprecated app.configure: Check app.get('env') in an if statement server.js:16:5
Server listen in port 80. Connect to localhost
127.0.0.2 - - [Tue, 05 Aug 2014 20:43:22 GMT] "GET / HTTP/1.1" 302 342 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131029 Firefox/17.0"
/home/nmerino/Desktop/oauth2sample/server.js:85
        req.session.oauth_token = results.access_token;
                                         ^
TypeError: Cannot read property 'access_token' of undefined
    at /home/nmerino/Desktop/oauth2sample/server.js:85:42
    at /home/nmerino/Desktop/oauth2sample/oauth2.js:138:18
    at ClientRequest.<anonymous> (/home/nmerino/Desktop/oauth2sample/oauth2.js:115:5)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at CleartextStream.socketErrorListener (http.js:1487:9)
    at CleartextStream.EventEmitter.emit (events.js:95:17)
    at SecurePair.<anonymous> (tls.js:1302:19)
    at SecurePair.EventEmitter.emit (events.js:92:17)
    at SecurePair.maybeInitFinished (tls.js:896:10)
    at CleartextStream.read [as _read] (tls.js:430:15)

虽然消息make似乎在使用localhost,但我使用的是127.0.0.2来运行oauth。 我需要帮助解决这些错误。 谢谢

1 个答案:

答案 0 :(得分:0)

您可以使用token_script.sh脚本获取访问令牌,如Orion quick start guide中所述。