title: Cannot configure Hyperledger Composer with multiuser authetication
body: <p>I am following the tutorial Using Google OAUTH2.0 with a REST server (<a href="https://hyperledger.github.io/composer/latest/tutorials/google_oauth2_rest" rel="nofollow noreferrer">https://hyperledger.github.io/composer/latest/tutorials/google_oauth2_rest</a>). After login with success into my Google account, I get this error on the browser:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "error": {
      "statusCode": 500,
      "name": "InternalOAuthError",
      "message": "Failed to obtain access token",
      "oauthError": {
        "errno": "ENOTFOUND",
        "code": "ENOTFOUND",
        "syscall": "getaddrinfo",
        "hostname": "accounts.google.com",
        "host": "accounts.google.com",
        "port": 443
      },
      "stack": "InternalOAuthError: Failed to obtain access token\n    at Strategy.OAuth2Strategy._createOAuthError (/home/composer/node_modules/passport-oauth2/lib/strategy.js:379:17)\n    at /home/composer/node_modules/passport-oauth2/lib/strategy.js:166:45\n    at /home/composer/node_modules/oauth/lib/oauth2.js:191:18\n    at ClientRequest.&lt;anonymous&gt; (/home/composer/node_modules/oauth/lib/oauth2.js:162:5)\n    at emitOne (events.js:116:13)\n    at ClientRequest.emit (events.js:211:7)\n    at TLSSocket.socketErrorListener (_http_client.js:387:9)\n    at emitOne (events.js:116:13)\n    at TLSSocket.emit (events.js:211:7)\n    at emitErrorNT (internal/streams/destroy.js:66:8)\n    at args.(anonymous function) (/home/composer/.npm-global/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:138:29)\n    at _combinedTickCallback (internal/process/next_tick.js:139:11)\n    at process._tickDomainCallback (internal/process/next_tick.js:219:9)"
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am behind a corporate proxy. So, I suspect there it is the problem but I am not sure.</p>
  
  <p>Following the tutorial instructions, I edited the file Dockerfile for adding npm configuration of the proxy (ip and port with the right data):</p>
  
  <blockquote>
    <p>FROM hyperledger/composer-rest-server
    RUN npm config set proxy <a href="http://ip:port" rel="nofollow noreferrer">http://ip:port</a> &amp;&amp; npm config set https-proxy <a href="http://ip:port" rel="nofollow noreferrer">http://ip:port</a> &amp;&amp; \
    npm install --production loopback-connector-mongodb passport-google-oauth2 request https-proxy-agent &amp;&amp; \
    npm cache clean --force &amp;&amp; \
    ln -s node_modules .node_modules</p>
  </blockquote>
  
  <p>Also, and I added request and https-proxy-agent modules for implementing the workaround explaining here: <a href="https://stackoverflow.com/questions/33639337/use-passport-js-behind-corporate-firewall-for-facebook-strategy">Use Passport.js Behind Corporate Firewall for Facebook Strategy</a>, but with no success.</p>
  
  <p>I built the Docker image composer-rest-server like this:</p>
  
  <pre><code>docker build -t myorg/composer-rest-server --build-arg http_proxy=http://ip:port --build-arg https_proxy=http://ip:port .
  </code></pre>
  
  <p>When I ran the Docker container, this was the log:</p>
  
  <blockquote>
    <p>[2018-09-28T10:48:18.240Z] PM2 log: Launching in no daemon mode
    [2018-09-28T10:48:18.318Z] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
    [2018-09-28T10:48:18.325Z] PM2 log: App name:composer-rest-server id:0 online
    WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
    WARNING: See <a href="https://github.com/lorenwest/node-config/wiki/Strict-Mode" rel="nofollow noreferrer">https://github.com/lorenwest/node-config/wiki/Strict-Mode</a>
    Discovering types from business network definition ...
    (node:15) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
    Discovering the Returning Transactions..
    Discovered types from business network definition
    Generating schemas for all types in business network definition ...
    Generated schemas for all types in business network definition
    Adding schemas for all types to Loopback ...
    Added schemas for all types to Loopback
    Web server listening at: <a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a>
    Browse your REST API at <a href="http://localhost:3000/explorer" rel="nofollow noreferrer">http://localhost:3000/explorer</a></p>
  </blockquote>
  
  <p>And, after login to my Google account, this was the log:</p>
  
  <blockquote>
    <p>Unhandled error for request GET /auth/google/callback?code=4%2FbAC3w3UnnALN4kKQD8RdjfC_wrXJeFAojIHKOANISGWYn-zvIzTeO24P96T_SaJDhVBPcbdqrmLxUyv9IajeYrg&amp;scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.profile.agerange.read+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.profile.language.read+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile: InternalOAuthError: Failed to obtain access token
        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. (/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:66:8)
        at args.(anonymous function) (/home/composer/.npm-global/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:138:29)
        at _combinedTickCallback (internal/process/next_tick.js:139:11)
        at process._tickDomainCallback (internal/process/next_tick.js:219:9)</p>
  </blockquote>
  
  <p>And this is COMPOSER_PROVIDERS variable, with the right clientID and clientSecret values:</p>
  
  <pre><code>COMPOSER_PROVIDERS='{
  "google": {
      "provider": "google",
      "module": "passport-google-oauth2",
      "clientID": "REPLACE_WITH_CLIENT_ID",
      "clientSecret": "REPLACE_WITH_CLIENT_SECRET",
      "authPath": "/auth/google",
      "callbackURL": "/auth/google/callback",
      "scope": "https://www.googleapis.com/auth/plus.login",
      "successRedirect": "/",
      "failureRedirect": "/"
  }
  </code></pre>
  
  <p>Anyone could tell me where is the problem?</p>
  
  <p>Thanks.</p>
  
  <p>PD: Sorry for this brick!</p>