How to use the azure-common.TokenCloudCredentials function in azure-common

To help you get started, we’ve selected a few azure-common 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 / lib / services / apiAppManagement / lib / apiApp.js View on Github external
*/

'use strict';

var common = require('azure-common');
var ApiAppManagementClient = require('./apiAppManagementClient');
var getDeploymentTemplate = require('./getDeploymentTemplate');

exports.ApiAppManagementClient = ApiAppManagementClient.ApiAppManagementClient;

//
// New up a dummy client so we can get at the TemplateOperations
// prototype and attach our custom method to it.
//
var dummyClient = new exports.ApiAppManagementClient(
  new common.TokenCloudCredentials({subscriptionId: '0', token: '0'}),
    'https://dummy.example');
getDeploymentTemplate.attachGetDeploymentTemplate(dummyClient);

/**
* Create a new {@link ApiAppManagementClient} object.
*
* @param {object} credentials The credentials object (typically, a TokenCloudCredentials instance).
* @param {string} [baseUri]                         Optional base uri, defaults to production Azure
* @param {array}  [filters]                         Optional array of service filters
* @return {ApiAppManagementClient}                  A new ApiAppManagementClient object.
*/
exports.createApiAppManagementClient = function (credentials, baseUri, filters)
{
  return new exports.ApiAppManagementClient(credentials, baseUri, filters);
};
github Azure / azure-linux-extensions / AzureEnhancedMonitor / nodejs / setaem.js View on Github external
var getCloudCredential = function(subscription){
    var cred;
    if(subscription.credential.type === 'cert'){
        cred = computeMgmt.createCertificateCloudCredentials({
            subscriptionId:subscription.id ,
            cert:subscription.managementCertificate.cert,
            key:subscription.managementCertificate.key,
        });
    }else{//if(subscription.credential.type === 'token'){
       cred = new common.TokenCloudCredentials({
            subscriptionId : subscription.id,
            token : subscription.credential.token  
       });
    } 
    return cred;
}
github Azure / azure-linux-extensions / AzureEnhancedMonitor / nodejs / setaem.js View on Github external
var getCloudCredential = function(subscription){
    var cred;
    if(subscription.credential.type === 'cert'){
        cred = computeMgmt.createCertificateCloudCredentials({
            subscriptionId:subscription.id ,
            cert:subscription.managementCertificate.cert,
            key:subscription.managementCertificate.key,
        });
    }else{//if(subscription.credential.type === 'token'){
       cred = new common.TokenCloudCredentials({
            subscriptionId : subscription.id,
            token : subscription.credential.token  
       });
    } 
    return cred;
}
github jmspring / chaos-dingo / dingo_job_pipeline.js View on Github external
function (err, result) {
			if (err) throw err;
			obj.credentials = new azureCommon.TokenCloudCredentials({
				subscriptionId: obj.subscriptionId,
				authorizationScheme: result.tokenType,
				token: result.accessToken
			});
			next();
		});
}