How to use the strong-soap.soap.BearerSecurity function in strong-soap

To help you get started, we’ve selected a few strong-soap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github strongloop / loopback-connector-soap / lib / soap-connector.js View on Github external
if (secConfig.pfx) {
              sec = new soap.ClientSSLSecurityPFX(
                secConfig.pfx,
                secConfig.passphrase,
                secConfig.options
              );
            } else {
              sec = new soap.ClientSSLSecurity(
                secConfig.keyPath || secConfig.key,
                secConfig.certPath || secConfig.cert,
                secConfig.ca || secConfig.caPath,
                secConfig.options);
            }
            break;
          case 'Bearer':
            sec = new soap.BearerSecurity(
              secConfig.token,
              secConfig.options);
            break;
          case 'BasicAuth':
          default:
            sec = new soap.BasicAuthSecurity(
              secConfig.username, secConfig.password, secConfig.options);
            break;
        }
        if (sec) {
          client.setSecurity(sec);
        }
      }
      if (self.settings.soapAction || self.settings.SOAPAction) {
        client.setSOAPAction(self.settings.soapAction || self.settings.SOAPAction);
      }