Sometimes Login failed due to Authorization Extension: ESOCKETTIMEDOUT

Our users sometime facing login failures. When we check logs, we got the error message as “unauthorized (Authorization Extension: ESOCKETTIMEDOUT)”

I already increased the timeout value from 5000 to 10000. But still sometime this issue occurring. Every day at least 5 to 10 users affected by this error.

How to debug / handle this error ? Any help would be appreciated

  function getPolicy(user, context, cb) {
    request.post({
      url: EXTENSION_URL + "/api/users/" + user.user_id + "/policy/" + context.clientID,
      headers: {
        "x-api-key": configuration.AUTHZ_EXT_API_KEY
      },
      json: {
        connectionName: context.connection || user.identities[0].connection,
        groups: parseGroups(user.groups)
      },
      timeout: 10000
    }, cb);
  }