我正在嘗試編寫使用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=
?
任何機會,你可以提供有關如何/在哪裏插入護照到環回的指導?關於做一些非常相似的事情,所以任何幫助表示讚賞 –