code: function refreshProxyAccessToken() {
          settings.AZTokenProvider().then(function(token) {
              proxyAccessToken = token;
              logger.log('Refreshed proxy access token: ' + proxyAccessToken);
          }, function(err) {
              logger.log(err);
              emitter.emit('error', 'Unable to refresh access token from AZTokenProvider');
              return null;
         });
      }
docs: After invoking this function, one must invoke elasticsearchOptions again in order for new access token to be used.