How to use the ms-rest-azure.UserTokenCredentials function in ms-rest-azure

To help you get started, we’ve selected a few ms-rest-azure 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 Azure / azure-sdk-for-node / test / framework / suite-base.js View on Github external
_createUserCredentials: function() {
    if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') {
      var df = {
        name: 'Dogfood',
        portalUrl: 'https://windows.azure-test.net/',
        activeDirectoryEndpointUrl: 'https://login.windows-ppe.net/',
        activeDirectoryResourceId: 'https://management.core.windows.net/',
        managementEndpointUrl: 'https://management-preview.core.windows-int.net/',
        resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/'
      };
      var env = msRestAzure.AzureEnvironment.add(df);
      return new msRestAzure.UserTokenCredentials(this.clientId, this.domain, this.username,
        this.password, { 'tokenCache': this.tokenCache, 'environment': env });
    }
    
    return new msRestAzure.UserTokenCredentials(this.clientId, this.domain, this.username,
      this.password, { 'tokenCache': this.tokenCache });
  },
github microsoft / botbuilder-js / tools / framework / suite-base.js View on Github external
_createUserCredentials: function() {
        if(process.env['AZURE_ENVIRONMENT'] && process.env['AZURE_ENVIRONMENT'].toUpperCase() === 'DOGFOOD') {
            var df = {
                name: 'Dogfood',
                portalUrl: 'https://windows.azure-test.net/',
                activeDirectoryEndpointUrl: 'https://login.windows-ppe.net/',
                activeDirectoryResourceId: 'https://management.core.windows.net/',
                managementEndpointUrl: 'https://management-preview.core.windows-int.net/',
                resourceManagerEndpointUrl: 'https://api-dogfood.resources.windows-int.net/'
            };
            var env = msRestAzure.AzureEnvironment.add(df);
            return new msRestAzure.UserTokenCredentials(this.clientId, this.domain, this.username,
                this.password, { 'tokenCache': this.tokenCache, 'environment': env });
        }
    
        return new msRestAzure.UserTokenCredentials(this.clientId, this.domain, this.username,
            this.password, { 'tokenCache': this.tokenCache });
    },