0

当我尝试使用在 http://ox.no/software/node-openid找到的 openid 运行示例 nodejs 服务器时

我得到以下跟踪:

/home/ubuntu/node_modules/openid/openid.js:868

      return callback({ message: 'No providers found for the given identifier'
             ^
TypeError: undefined is not a function

    at /home/ubuntu/node_modules/openid/openid.js:868:14

    at /home/ubuntu/node_modules/openid/openid.js:656:13

    at /home/ubuntu/node_modules/openid/openid.js:612:11

    at /home/ubuntu/node_modules/openid/openid.js:254:9

    at IncomingMessage.<anonymous> (/home/ubuntu/node_modules/openid/openid.js:258:32)

    at IncomingMessage.emit (events.js:88:20)

    at HTTPParser.onMessageComplete (http.js:137:23)

    at CleartextStream.ondata (http.js:1150:24)

    at CleartextStream._push (tls.js:375:27)

    at SecurePair.cycle (tls.js:734:20)

也许问题是我在第一页提供的 openid_identifier。我努力了

雅虎网

www.google.com/accounts/o8/id

www.google.com/accounts/o9/ud

当我尝试 www.google.com/accounts/o8/id 时,我得到的跟踪略有不同:

/home/ubuntu/node_modules/openid/openid.js:895

          return callback(null, authUrl);

                 ^

TypeError: undefined is not a function

    at successOrNext (/home/ubuntu/node_modules/openid/openid.js:895:18)

    at /home/ubuntu/node_modules/openid/openid.js:1008:3

    at successOrNext (/home/ubuntu/node_modules/openid/openid.js:909:9)

    at /home/ubuntu/node_modules/openid/openid.js:931:5

    at /home/ubuntu/node_modules/openid/openid.js:678:7

    at /home/ubuntu/node_modules/openid/openid.js:544:16

    at /home/ubuntu/node_modules/openid/openid.js:254:9

    at IncomingMessage.<anonymous> (/home/ubuntu/node_modules/openid/openid.js:258:32)

    at IncomingMessage.emit (events.js:88:20)

    at HTTPParser.onMessageComplete (http.js:137:23)

任何人都知道我做错了什么,我该如何解决?

4

1 回答 1

1

至少对我来说,以下工作就像一个魅力:

git clone git@github.com:havard/node-openid.git
cd node-openid/
sudo node sample.js 

然后我将浏览器启动到 localhost 并使用 Google 的地址登录:https ://www.google.com/accounts/o8/id

它工作得很好。所以看起来他们网站上的示例有点过时,而他们的 git repo 中的示例可以正常工作。

于 2013-10-24T19:44:17.537 回答