我正在尝试编写使用Github Enterprise服务器进行身份验证的Express/Passport应用程序。这需要手动编辑护照的github策略以指向私有企业API端点。没有什么大不了的。Strongloop Passport.js身份验证 - “无法获取访问令牌”
我正在使用Strongloop构建应用程序,所以我正在使用strongloop-passport-component
集成。
至于我可以告诉应用程序配置正确,但对重定向,我得到了以下错误消息:
Loopback 500 InternalOAuthError: Failed to obtain access token at Strategy.OAuth2Strategy._createOAuthError (/Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:370:17) at /Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:166:45 at /Users/Tom/Desktop/soundoff/node_modules/passport-github/lib/strategy.js:75:25 at /Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:177:18 at ClientRequest. (/Users/Tom/Desktop/soundoff/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:148:5) at emitOne (events.js:90:13) at ClientRequest.emit (events.js:182:7) at TLSSocket.socketErrorListener (_http_client.js:262:9) at emitOne (events.js:90:13) at TLSSocket.emit (events.js:182:7)
如果我看github上的应用程序设置,我可以验证用户成功通过应用程序验证。它似乎无法将用户重定向到重定向URI。 aparrently它无法找到访问令牌?
用户最终访问的URL类似于http://0.0.0.0:3000/auth/github/callback?code=dceef2ffe07b5dbfa194
- 但是,我预计它们最终会在http://0.0.0.0:3000/auth/account
之后。
什么可能导致回送找不到访问令牌?是不是在?code=
?
任何机会,你可以提供有关如何/在哪里插入护照到环回的指导?关于做一些非常相似的事情,所以任何帮助表示赞赏 –