使用谷歌+ api oauth2服务错误

时间:2018-04-11 06:39:34

标签: hyperledger-fabric hyperledger-composer

我已按照文档(https://hyperledger.github.io/composer/latest/tutorials/google_oauth2_rest)设置了我的商家网络,并使用我自己的Google帐户。 当我访问http://localhost:3000/auth/google,然后执行allow操作时,在等待几分钟后收到错误。

错误如下:

   {
  "error":{
    "statusCode":500,
    "name":"InternalOAuthError",
    "message":"Failed to obtain access token",
    "oauthError":{
      "code":"ECONNREFUSED",
      "errno":"ECONNREFUSED",
      "syscall":"connect",
      "address":"172.217.24.13",
      "port":443
    },
    "stack":"Error: connect ECONNREFUSED 172.217.24.13:443
at Strategy.OAuth2Strategy._createOAuthError (/home/composer/node_modules/passport-oauth2/lib/strategy.js:379:17)
at /home/composer/node_modules/passport-oauth2/lib/strategy.js:166:45
at /home/composer/node_modules/oauth/lib/oauth2.js:191:18
at ClientRequest.<anonymous> (/home/composer/node_modules/oauth/lib/oauth2.js:162:5)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)"
  }
}

1 个答案:

答案 0 :(得分:0)

它尝试联系accounts.google.com,IP地址为172.217.24.13。

https://ipinfo.io/172.217.24.13

这几乎肯定是某种本地网络问题。您是否在办公室中安装了防火墙或启用了代理?因此,它无法进入下一步,即重定向到http://localhost:3000/explorer

也许您需要为https请求设置HTTPS_PROXY。 AFAIK,它可以是完整的URL或“主机[:端口]”等。