【发布时间】:2014-12-14 16:44:12
【问题描述】:
我已下载文档中建议的 oauth2orize provider code example 和 sample oauth client,但出现以下错误:
500 AuthorizationError: 在验证时未授权 (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/node_modules/oauth2orize/lib/middleware/authorization.js:131:36) 在 /Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/oauth2.js:180:14 在 Object.exports.findByClientId (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/db/clients.js:24:10) 在exports.authorization.res.render.transactionID (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/oauth2.js:174:16) 在 /Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/node_modules/oauth2orize/lib/middleware/authorization.js:167:9 通过 (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/node_modules/oauth2orize/lib/server.js:262:26) 通过时 (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/node_modules/oauth2orize/lib/server.js:280:9) 通过时 (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/node_modules/oauth2orize/lib/server.js:271:11) 在 Server._parse (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/node_modules/oauth2orize/lib/server.js:285:5) 经授权 (/Users/trevorallred/projects/pics/node-soa/oauth2orize/examples/all-grants/node_modules/oauth2orize/lib/middleware/authorization.js:118:12)
我在这里运行客户端:http://localhost:3002/
我单击“与 example-oauth2orize 连接”的链接
它将我重定向到提供者:http://localhost:3000/login
使用“bob”登录后,我被发送到此错误页面。
我所做的唯一修改是示例客户端中的 oauth-config.js。
'use strict';
module.exports = {
provider: {
protocol: "http",
host: "localhost:3000",
profileUrl: "/api/userinfo"
},
consumer: {
protocol: "http",
host: "localhost:3002"
}
};
我在看到this bug report 后尝试修改 oauth-consumer-config.js,但它似乎没有改变任何行为。
module.exports = {
name: 'Example Consumer App'
, icon: 'http://example.com/icon_64.png'
, clientId: 'trevorclient'
, clientSecret: 'kasdfasdfoq34t134tg109gqerg1gjc'
};
【问题讨论】:
标签: oauth-2.0 oauth2orize