This commit is contained in:
Rikki Gibson 2018-06-27 12:29:07 -07:00
Родитель 58f94a1f52
Коммит bd020c1667
16 изменённых файлов: 60 добавлений и 59 удалений

Просмотреть файл

@ -1 +1 @@
{"version":3,"file":"applicationTokenCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/applicationTokenCredentials.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,iEAA6E;AAE7E,yDAAqE;AAErE,iCAAyC,SAAQ,2CAAoB;IAGnE;;;;;;;;;;;;OAYG;IACH,YACE,QAAgB,EAChB,MAAc,EACd,MAAc,EACd,aAA6B,EAC7B,WAA8B,EAC9B,UAAgB;QAEhB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QACD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,WAAkB,EAAE,UAAU,CAAC,CAAC;QAEvE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE;aAC5B,IAAI,CAAC,CAAC,aAAa,KAAK,aAAa,CAAC;aACtC,KAAK,CAAC,CAAC,KAAK;YACX,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,6BAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;gBAC/D,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACrD,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM;gBACjC,IAAI,CAAC,WAAW,CAAC,iCAAiC,CAAC,Q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CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACK,2BAA2B,CAAC,KAAa;QAC/C,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,MAAM,CAAC,IAAI,OAAO,CAAuC,CAAC,OAAO;YAC/D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAY,EAAE,OAAc;gBACvD,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACV,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;gBACpD,CAAC;gBAED,EAAE,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;oBAClC,oFAAoF;oBACpF,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO;wBACzB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAU;4BAChD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gCACR,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;4BAClD,CAAC;4BACD,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;wBACnC,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACN,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/GD,kEA+GC"}
{"version":3,"file":"applicationTokenCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/applicationTokenCredentials.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,iEAA6E;AA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AE,KAAK,EAAE,CAAC,CAAC;iBACnD;gBAED,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;oBACjC,oFAAoF;oBACpF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;wBAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE;4BACpD,IAAI,GAAG,EAAE;gCACP,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;6BACjD;4BACD,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;wBACnC,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;iBACJ;qBAAM;oBACL,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBAClC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/GD,kEA+GC"}

Просмотреть файл

@ -1 +1 @@
{"version":3,"file":"deviceTokenCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/deviceTokenCredentials.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,iEAA6E;AAE7E,yDAAqE;AAErE,4BAAoC,SAAQ,2CAAoB;IAI9D;;;;;;;;;;;;;;;;;OAiBG;IACH,YACE,QAAiB,EACjB,MAAe,EACf,QAAiB,EACjB,aAA6B,EAC7B,WAA8B,EAC9B,UAAgB;QAEhB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACd,QAAQ,GAAG,kBAAkB,CAAC;QAChC,CAAC;QAED,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,GAAG,6BAAa,CAAC,iBAAiB,CAAC;QAC3C,CAAC;QAED,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACd,QAAQ,GAAG,6BAAa,CAAC,sBAAsB,CAAC;QAClD,CAAC;QAED,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,WAAkB,EAAE,UAAU,CAAC,CAAC;QAEvE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,QAAQ;QACb,mDAAmD;QACnD,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACF;AAnDD,wDAmDC"}
{"version":3,"file":"deviceTokenCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/deviceTokenCredentials.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,+FAA+F;;AAE/F,iEAA6E;AAE7E,yDAAqE;AAErE,4BAAoC,SAAQ,2CAAoB;IAI9D;;;;;;;;;;;;;;;;;OAiBG;IACH,YACE,QAAiB,EACjB,MAAe,EACf,QAAiB,EACjB,aAA6B,EAC7B,WAA8B,EAC9B,UAAgB;QAEhB,IAAI,CAAC,QAAQ,EAAE;YACb,QAAQ,GAAG,kBAAkB,CAAC;SAC/B;QAED,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,6BAAa,CAAC,iBAAiB,CAAC;SAC1C;QAED,IAAI,CAAC,QAAQ,EAAE;YACb,QAAQ,GAAG,6BAAa,CAAC,sBAAsB,CAAC;SACjD;QAED,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,WAAkB,EAAE,UAAU,CAAC,CAAC;QAEvE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,QAAQ;QACb,mDAAmD;QACnD,OAAO,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACF;AAnDD,wDAmDC"}

42
dist/lib/credentials/msiTokenCredentials.js поставляемый
Просмотреть файл

@ -17,25 +17,25 @@ const msRest = require("ms-rest-js");
*/
class MSITokenCredentials {
constructor(
/**
* @property {string} domain - The domain or tenant id for which the token is required.
*/
domain,
/**
* @property {number} port - Port on which the MSI service is running on the host VM. Default port is 50342
*/
port = 50342,
/**
* @property {string} resource - The resource uri or token audience for which the token is needed.
* For e.g. it can be:
* - resourcemanagement endpoint "https://management.azure.com"(default)
* - management endpoint "https://management.core.windows.net/"
*/
resource = "https://management.azure.com",
/**
* @property {string} aadEndpoint - The add endpoint for authentication. default - "https://login.microsoftonline.com"
*/
aadEndpoint = "https://login.microsoftonline.com") {
/**
* @property {string} domain - The domain or tenant id for which the token is required.
*/
domain,
/**
* @property {number} port - Port on which the MSI service is running on the host VM. Default port is 50342
*/
port = 50342,
/**
* @property {string} resource - The resource uri or token audience for which the token is needed.
* For e.g. it can be:
* - resourcemanagement endpoint "https://management.azure.com"(default)
* - management endpoint "https://management.core.windows.net/"
*/
resource = "https://management.azure.com",
/**
* @property {string} aadEndpoint - The add endpoint for authentication. default - "https://login.microsoftonline.com"
*/
aadEndpoint = "https://login.microsoftonline.com") {
this.domain = domain;
this.port = port;
this.resource = resource;
@ -68,7 +68,7 @@ class MSITokenCredentials {
let result;
try {
opRes = yield client.sendRequest(reqOptions);
result = opRes.bodyAsJson;
result = opRes.parsedBody;
if (!result.token_type) {
throw new Error(`Invalid token response, did not find token_type. Response body is: ${opRes.bodyAsText}`);
}
@ -107,7 +107,7 @@ class MSITokenCredentials {
signRequest(webResource) {
return __awaiter(this, void 0, void 0, function* () {
const tokenResponse = yield this.getToken();
webResource.headers[msRest.Constants.HeaderConstants.AUTHORIZATION] = `${tokenResponse.tokenType} ${tokenResponse.accessToken}`;
webResource.headers.set(msRest.Constants.HeaderConstants.AUTHORIZATION, `${tokenResponse.tokenType} ${tokenResponse.accessToken}`);
return Promise.resolve(webResource);
});
}

Просмотреть файл

@ -1 +1 @@
{"version":3,"file":"msiTokenCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/msiTokenCredentials.ts"],"names":[],"mapp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IACpB,CAAC;IAED;;;;;;OAMG;IACU,WAAW,CAAC,WAA+B;;YACtD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5C,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,aAAa,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;YACnI,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;KAAA;CACF;AA1FD,kDA0FC"}

Просмотреть файл

@ -34,6 +34,9 @@ class TokenCredentialsBase {
It must be the actual tenant (preferrably a string in a guid format)."}`);
}
}
else {
this.isGraphContext = false;
}
const authorityUrl = this.environment.activeDirectoryEndpointUrl + this.domain;
this.authContext = new adal.AuthenticationContext(authorityUrl, this.environment.validateAuthority, this.tokenCache);
}
@ -65,7 +68,7 @@ class TokenCredentialsBase {
signRequest(webResource) {
return __awaiter(this, void 0, void 0, function* () {
const tokenResponse = yield this.getToken();
webResource.headers[ms_rest_js_1.Constants.HeaderConstants.AUTHORIZATION] = `${tokenResponse.tokenType} ${tokenResponse.accessToken}`;
webResource.headers.set(ms_rest_js_1.Constants.HeaderConstants.AUTHORIZATION, `${tokenResponse.tokenType} ${tokenResponse.accessToken}`);
return Promise.resolve(webResource);
});
}

Просмотреть файл

@ -1 +1 @@
{"version":3,"file":"tokenCredentialsBase.js","sourceRoot":"","sources":["../../../lib/credentials/tokenCredentialsBase.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,+FAA+F;;;;;;;;;;AAE/F,2CAAuE;AACvE,yDAAqD;AACrD,yDAAsD;AACtD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAQlC;IAIE,YACkB,QAAgB,EACzB,MAAc,EACL,aAA6B,EAC7B,cAAc,oCAAgB,CAAC,KAAK,EAC7C,aAAkB,IAAI,IAAI,CAAC,WAAW,E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Q,CAAC;IAClB,CAAC;IAES,iBAAiB,CAAC,QAAiB;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAErD,OAAO,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACpD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAY,EAAE,aAA4B,EAAE,EAAE;gBAC9G,IAAI,KAAK,EAAE;oBACT,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;iBACtB;gBACD,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAUD;;;;;;OAMG;IACU,WAAW,CAAC,WAAwB;;YAC/C,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5C,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAe,CAAC,eAAe,CAAC,aAAa,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;YAClI,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;KAAA;CACF;AA5ED,oDA4EC"}

Просмотреть файл

@ -1 +1 @@
{"version":3,"file":"userTokenCredentials.js","sourceRoot":"","sources":["../../../lib/credentials/userTokenCredentials.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,+FAA+F;;;;;;;;;;AAE/F,iEAA6E;AAI7E,0BAAkC,SAAQ,2CAAoB;IAK5D;;;;;;;;;;;;;;OAcG;IACH,YACE,QAAgB,EAChB,MAAc,EACd,QAAgB,EAChB,QAAgB,EAChB,aAA6B,EAC7B,WAA8B,EAC9B,UAAgB;QAEhB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ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C,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACrG,CAAC,KAAY,EAAE,aAA4B,EAAE,EAAE;wBAC7C,IAAI,KAAK,EAAE;4BACT,MAAM,CAAC,KAAK,CAAC,CAAC;yBACf;wBACD,IAAI,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE;4BACzE,OAAO,CAAE,aAA+B,CAAC,CAAC;yBAC3C;6BAAM;4BACL,MAAM,CAAC,eAAe,aAAa,CAAC,MAAM,iDAAiD,IAAI,CAAC,QAAQ,mCAAmC,CAAC,CAAC;yBAC9I;oBACH,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;aACJ;QACH,CAAC;KAAA;CACF;AArFD,oDAqFC"}

6
dist/lib/login.js поставляемый
Просмотреть файл

@ -66,12 +66,11 @@ function withUsernamePasswordWithAuthResponse(username, password, options) {
options.domain = authConstants_1.AuthConstants.AAD_COMMON_TENANT;
}
let creds;
let result;
let tenantList = [];
let subscriptionList = [];
try {
creds = new userTokenCredentials_1.UserTokenCredentials(options.clientId, options.domain, username, password, options.tokenAudience, options.environment);
result = yield creds.getToken();
yield creds.getToken();
// The token cache gets propulated for all the tenants as a part of building the tenantList.
tenantList = yield subscriptionUtils_1.buildTenantList(creds);
// We dont need to get the subscriptionList if the tokenAudience is graph as graph clients are tenant based.
@ -107,11 +106,10 @@ function withServicePrincipalSecretWithAuthResponse(clientId, secret, domain, op
options = {};
}
let creds;
let result;
let subscriptionList = [];
try {
creds = new applicationTokenCredentials_1.ApplicationTokenCredentials(clientId, domain, secret, options.tokenAudience, options.environment);
result = yield creds.getToken();
yield creds.getToken();
// We dont need to get the subscriptionList if the tokenAudience is graph as graph clients are tenant based.
if (!(options.tokenAudience && options.tokenAudience === authConstants_1.TokenAudience.graph)) {
subscriptionList = yield subscriptionUtils_1.getSubscriptionsFromTenants(creds, [domain]);

2
dist/lib/login.js.map поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -39,7 +39,7 @@ function buildTenantList(credentials, apiVersion = "2016-06-01") {
return Promise.reject(err);
}
const result = [];
const tenants = res.bodyAsJson;
const tenants = res.parsedBody;
for (const tenant in tenants.value) {
result.push(tenant.tenantId);
}
@ -76,7 +76,7 @@ function getSubscriptionsFromTenants(credentials, tenantList, apiVersion = "2016
catch (err) {
return Promise.reject(err);
}
const subscriptionList = res.bodyAsJson.value;
const subscriptionList = res.parsedBody.value;
subscriptions = subscriptions.concat(subscriptionList.map((s) => {
s.tenantId = tenant;
s.user = { name: username, type: userType };

Просмотреть файл

@ -1 +1 @@
{"version":3,"file":"subscriptionUtils.js","sourceRoot":"","sources":["../../../lib/subscriptionManagement/subscriptionUtils.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,+FAA+F;;;;;;;;;;AAE/F,qCAAqC;AAErC,4FAAyF;AACzF,yDAAsD;AAkEtD;;;;;GAKG;AACH,yBAAsC,WAAiC,EAAE,UAAU,GAAG,YAAY;;QAChG,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,KAAK,6BAAa,CAAC,iBAAiB,CAAC,CAAC,CAAC;YACjF,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,0BAA0B,CAAC;QACnE,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,uBAAuB,UAAU,EAAE,CAAC;QAChG,MAAM,GAAG,GAAiC;YACxC,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,KAAK;SAC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MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;gBACnE,CAAC,CAAC,QAAQ,GAAG,MAAM,CAAC;gBACpB,CAAC,CAAC,IAAI,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;gBAC5C,CAAC,CAAC,eAAe,GAAG,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC;gBACjD,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC;gBACvB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,cAAc,CAAC;gBACxB,OAAO,CAAC,CAAC,WAAW,CAAC;gBACrB,OAAO,CAAC,CAAC,cAAc,CAAC;gBACxB,OAAO,CAAC,CAAC,oBAAoB,CAAC;gBAC9B,OAAO,CAAC,CAAC;YACX,CAAC,CAAC,CAAC,CAAC;SACL;QACD,6BAA6B;QAC7B,WAAW,CAAC,MAAM,GAAG,cAAc,CAAC;QACpC,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACxC,CAAC;CAAA;AA3CD,kEA2CC"}

Просмотреть файл

@ -31,5 +31,5 @@ export declare class ApplicationTokenCredentials extends TokenCredentialsBase {
* @param {object} query The query to be used for finding the token for service principal from the cache
* @returns {result: boolean, details?: Error} resultObject with more info.
*/
private removeInvalidItemsFromCache(query);
private removeInvalidItemsFromCache;
}

Просмотреть файл

@ -41,25 +41,25 @@ export declare class MSITokenCredentials {
*/
aadEndpoint: string;
constructor(
/**
* @property {string} domain - The domain or tenant id for which the token is required.
*/
domain: string,
/**
* @property {number} port - Port on which the MSI service is running on the host VM. Default port is 50342
*/
port?: number,
/**
* @property {string} resource - The resource uri or token audience for which the token is needed.
* For e.g. it can be:
* - resourcemanagement endpoint "https://management.azure.com"(default)
* - management endpoint "https://management.core.windows.net/"
*/
resource?: string,
/**
* @property {string} aadEndpoint - The add endpoint for authentication. default - "https://login.microsoftonline.com"
*/
aadEndpoint?: string);
/**
* @property {string} domain - The domain or tenant id for which the token is required.
*/
domain: string,
/**
* @property {number} port - Port on which the MSI service is running on the host VM. Default port is 50342
*/
port?: number,
/**
* @property {string} resource - The resource uri or token audience for which the token is needed.
* For e.g. it can be:
* - resourcemanagement endpoint "https://management.azure.com"(default)
* - management endpoint "https://management.core.windows.net/"
*/
resource?: string,
/**
* @property {string} aadEndpoint - The add endpoint for authentication. default - "https://login.microsoftonline.com"
*/
aadEndpoint?: string);
/**
* Prepares and sends a POST request to a service endpoint hosted on the Azure VM, which responds with the access token.
* @param {function} callback The callback in the form (err, result)
@ -68,7 +68,7 @@ export declare class MSITokenCredentials {
* {object} [tokenResponse] The tokenResponse (token_type and access_token are the two important properties).
*/
getToken(): Promise<MSITokenResponse>;
private prepareRequestOptions();
private prepareRequestOptions;
/**
* Signs a request with the Authentication header.
*

Просмотреть файл

@ -8,7 +8,7 @@ export interface TokenResponse {
export declare abstract class TokenCredentialsBase {
readonly clientId: string;
domain: string;
readonly tokenAudience: TokenAudience | undefined;
readonly tokenAudience?: TokenAudience | undefined;
readonly environment: {
name: string;
portalUrl: string;

Просмотреть файл

@ -20,7 +20,7 @@ export declare class UserTokenCredentials extends TokenCredentialsBase {
* @param {object} [tokenCache] The token cache. Default value is the MemoryCache object from adal.
*/
constructor(clientId: string, domain: string, username: string, password: string, tokenAudience?: TokenAudience, environment?: AzureEnvironment, tokenCache?: any);
private crossCheckUserNameWithToken(username, userIdFromToken);
private crossCheckUserNameWithToken;
/**
* Tries to get the token from cache initially. If that is unsuccessful then it tries to get the token from ADAL.
* @returns {Promise<TokenResponse>}

2
typings/lib/util/authConstants.d.ts поставляемый
Просмотреть файл

@ -6,5 +6,5 @@ export declare const AuthConstants: {
"AZURE_AUTH_LOCATION": string;
};
export declare enum TokenAudience {
graph = 0,
graph = 0
}