@azure/msal-common 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +37 -0
- package/CHANGELOG.md +14 -1
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/account/AuthToken.js +1 -1
- package/dist/account/CcsCredential.js +1 -1
- package/dist/account/ClientInfo.js +1 -1
- package/dist/account/TokenClaims.d.ts +1 -0
- package/dist/account/TokenClaims.d.ts.map +1 -1
- package/dist/authority/Authority.d.ts +9 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +36 -11
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +2 -2
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.js +5 -5
- package/dist/authority/AuthorityFactory.js.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +7 -0
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.js +22 -0
- package/dist/authority/AuthorityOptions.js.map +1 -0
- package/dist/authority/AuthorityType.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
- package/dist/authority/ImdsOptions.d.ts +7 -0
- package/dist/authority/ImdsOptions.d.ts.map +1 -0
- package/dist/authority/OpenIdConfigResponse.js +1 -1
- package/dist/authority/ProtocolMode.js +1 -1
- package/dist/authority/RegionDiscovery.d.ts +3 -6
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.js +19 -11
- package/dist/authority/RegionDiscovery.js.map +1 -1
- package/dist/cache/CacheManager.js +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +1 -1
- package/dist/cache/entities/AccountEntity.js +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
- package/dist/cache/entities/CacheRecord.js +1 -1
- package/dist/cache/entities/CredentialEntity.js +1 -1
- package/dist/cache/entities/IdTokenEntity.js +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
- package/dist/cache/entities/ThrottlingEntity.js +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +4 -1
- package/dist/client/AuthorizationCodeClient.js.map +1 -1
- package/dist/client/BaseClient.js +2 -2
- package/dist/client/BaseClient.js.map +1 -1
- package/dist/client/ClientCredentialClient.js +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.js +3 -2
- package/dist/client/DeviceCodeClient.js.map +1 -1
- package/dist/client/OnBehalfOfClient.js +1 -1
- package/dist/client/RefreshTokenClient.js +1 -1
- package/dist/client/SilentFlowClient.js +1 -1
- package/dist/client/UsernamePasswordClient.js +1 -1
- package/dist/config/ClientConfiguration.d.ts +13 -0
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +9 -3
- package/dist/config/ClientConfiguration.js.map +1 -1
- package/dist/crypto/ICrypto.js +1 -1
- package/dist/crypto/PopTokenGenerator.js +1 -1
- package/dist/error/AuthError.js +1 -1
- package/dist/error/ClientAuthError.js +1 -1
- package/dist/error/ClientConfigurationError.d.ts +11 -0
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.js +12 -2
- package/dist/error/ClientConfigurationError.js.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +1 -1
- package/dist/error/ServerError.js +1 -1
- package/dist/index.cjs.js +108 -31
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/logger/Logger.js +1 -1
- package/dist/network/INetworkModule.d.ts +1 -0
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.js +1 -1
- package/dist/network/INetworkModule.js.map +1 -1
- package/dist/network/NetworkManager.js +1 -1
- package/dist/network/ThrottlingUtils.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.js +1 -1
- package/dist/request/BaseAuthRequest.d.ts +8 -5
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +2 -0
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +4 -0
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.js +7 -1
- package/dist/request/RequestParameterBuilder.js.map +1 -1
- package/dist/request/RequestValidator.js +1 -1
- package/dist/request/ScopeSet.js +1 -1
- package/dist/response/ResponseHandler.js +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
- package/dist/url/UrlString.js +1 -1
- package/dist/url/UrlString.js.map +1 -1
- package/dist/utils/Constants.d.ts +3 -1
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +3 -1
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/ProtocolUtils.js +1 -1
- package/dist/utils/StringUtils.js +1 -1
- package/dist/utils/TimeUtils.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/msal-common",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Tue, 08 Feb 2022 00:41:06 GMT",
|
|
6
|
+
"tag": "@azure/msal-common_v6.1.0",
|
|
7
|
+
"version": "6.1.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "thomas.norling@microsoft.com",
|
|
12
|
+
"package": "@azure/msal-common",
|
|
13
|
+
"commit": "19f76b1d9cd2b0f1a4a7e4765c8ee9e7e17f3d59",
|
|
14
|
+
"comment": "Test changes #4383"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"patch": [
|
|
18
|
+
{
|
|
19
|
+
"author": "sameera.gajjarapu@microsoft.com",
|
|
20
|
+
"package": "@azure/msal-common",
|
|
21
|
+
"commit": "d576b7d35f8f24e53946c72bc78c0401a8d2dc86",
|
|
22
|
+
"comment": "Add AzureCloudInstance to JS libraries"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"minor": [
|
|
26
|
+
{
|
|
27
|
+
"author": "sameera.gajjarapu@microsoft.com",
|
|
28
|
+
"package": "@azure/msal-common",
|
|
29
|
+
"commit": "a6fda9fd4ff40a90d173ecbd1281d8dd02eb4d58",
|
|
30
|
+
"comment": "Support proxy in msal-node(#4447)"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"author": "hemoral@microsoft.com",
|
|
34
|
+
"package": "@azure/msal-common",
|
|
35
|
+
"commit": "4c7418a6a76f29706ff0e5f7efd890d22fa4af0b",
|
|
36
|
+
"comment": "Add support for logout_hint #4450"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
4
41
|
{
|
|
5
42
|
"date": "Tue, 04 Jan 2022 00:20:29 GMT",
|
|
6
43
|
"tag": "@azure/msal-common_v6.0.0",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
# Change Log - @azure/msal-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on Tue,
|
|
3
|
+
This log was last generated on Tue, 08 Feb 2022 00:41:06 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 6.1.0
|
|
8
|
+
|
|
9
|
+
Tue, 08 Feb 2022 00:41:06 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Support proxy in msal-node(#4447) (sameera.gajjarapu@microsoft.com)
|
|
14
|
+
- Add support for logout_hint #4450 (hemoral@microsoft.com)
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- Add AzureCloudInstance to JS libraries (sameera.gajjarapu@microsoft.com)
|
|
19
|
+
|
|
7
20
|
## 6.0.0
|
|
8
21
|
|
|
9
22
|
Tue, 04 Jan 2022 00:20:29 GMT
|
package/dist/_virtual/_tslib.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenClaims.d.ts","sourceRoot":"","sources":["../../src/account/TokenClaims.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,oBAAY,WAAW,GAAG;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,GAAG,CAAC,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAC"}
|
|
1
|
+
{"version":3,"file":"TokenClaims.d.ts","sourceRoot":"","sources":["../../src/account/TokenClaims.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,oBAAY,WAAW,GAAG;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,GAAG,CAAC,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { ICacheManager } from "../cache/interface/ICacheManager";
|
|
|
7
7
|
import { AuthorityOptions } from "./AuthorityOptions";
|
|
8
8
|
import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
|
|
9
9
|
import { RegionDiscoveryMetadata } from "./RegionDiscoveryMetadata";
|
|
10
|
+
import { AzureCloudOptions } from "../config/ClientConfiguration";
|
|
10
11
|
/**
|
|
11
12
|
* The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
|
|
12
13
|
* endpoint. It will store the pertinent config data in this object for use during token calls.
|
|
@@ -20,7 +21,8 @@ export declare class Authority {
|
|
|
20
21
|
private metadata;
|
|
21
22
|
private regionDiscovery;
|
|
22
23
|
regionDiscoveryMetadata: RegionDiscoveryMetadata;
|
|
23
|
-
|
|
24
|
+
private proxyUrl;
|
|
25
|
+
constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string);
|
|
24
26
|
get authorityType(): AuthorityType;
|
|
25
27
|
/**
|
|
26
28
|
* ProtocolMode enum representing the way endpoints are constructed.
|
|
@@ -128,6 +130,12 @@ export declare class Authority {
|
|
|
128
130
|
* Helper function to determine if this host is included in the knownAuthorities config option
|
|
129
131
|
*/
|
|
130
132
|
private isInKnownAuthorities;
|
|
133
|
+
/**
|
|
134
|
+
* helper function to populate the authority based on azureCloudOptions
|
|
135
|
+
* @param authorityString
|
|
136
|
+
* @param azureCloudOptions
|
|
137
|
+
*/
|
|
138
|
+
static generateAuthority(authorityString: string, azureCloudOptions?: AzureCloudOptions): string;
|
|
131
139
|
/**
|
|
132
140
|
* Creates cloud discovery metadata object from a given host
|
|
133
141
|
* @param host
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authority.d.ts","sourceRoot":"","sources":["../../src/authority/Authority.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAA0B,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE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,GAAG,MAAM;IAWhG;;;OAGG;IACH,MAAM,CAAC,oCAAoC,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB;IAQjF;;;;OAIG;IACH,MAAM,CAAC,4CAA4C,CAAC,QAAQ,EAAE,sBAAsB,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,sBAAsB,GAAG,IAAI;IAWzI;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAQ3B;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIpD;;;;;OAKG;IACH,MAAM,CAAC,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;IAyB/F;;;;;OAKG;IACH,MAAM,CAAC,8BAA8B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,GAAG,oBAAoB;CAWnH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v6.
|
|
1
|
+
/*! @azure/msal-common v6.1.0 2022-02-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AuthorityType } from './AuthorityType.js';
|
|
@@ -9,6 +9,7 @@ import { Constants, AuthorityMetadataSource, RegionDiscoveryOutcomes } from '../
|
|
|
9
9
|
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
10
10
|
import { ProtocolMode } from './ProtocolMode.js';
|
|
11
11
|
import { AuthorityMetadataEntity } from '../cache/entities/AuthorityMetadataEntity.js';
|
|
12
|
+
import { AzureCloudInstance } from './AuthorityOptions.js';
|
|
12
13
|
import { isCloudInstanceDiscoveryResponse } from './CloudInstanceDiscoveryResponse.js';
|
|
13
14
|
import { RegionDiscovery } from './RegionDiscovery.js';
|
|
14
15
|
|
|
@@ -21,7 +22,7 @@ import { RegionDiscovery } from './RegionDiscovery.js';
|
|
|
21
22
|
* endpoint. It will store the pertinent config data in this object for use during token calls.
|
|
22
23
|
*/
|
|
23
24
|
var Authority = /** @class */ (function () {
|
|
24
|
-
function Authority(authority, networkInterface, cacheManager, authorityOptions) {
|
|
25
|
+
function Authority(authority, networkInterface, cacheManager, authorityOptions, proxyUrl) {
|
|
25
26
|
this.canonicalAuthority = authority;
|
|
26
27
|
this._canonicalAuthority.validateAsUri();
|
|
27
28
|
this.networkInterface = networkInterface;
|
|
@@ -29,6 +30,7 @@ var Authority = /** @class */ (function () {
|
|
|
29
30
|
this.authorityOptions = authorityOptions;
|
|
30
31
|
this.regionDiscovery = new RegionDiscovery(networkInterface);
|
|
31
32
|
this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };
|
|
33
|
+
this.proxyUrl = proxyUrl || Constants.EMPTY_STRING;
|
|
32
34
|
}
|
|
33
35
|
Object.defineProperty(Authority.prototype, "authorityType", {
|
|
34
36
|
// See above for AuthorityType
|
|
@@ -297,7 +299,7 @@ var Authority = /** @class */ (function () {
|
|
|
297
299
|
metadata = _b.sent();
|
|
298
300
|
if (!metadata) return [3 /*break*/, 4];
|
|
299
301
|
if (!((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.azureRegion)) return [3 /*break*/, 3];
|
|
300
|
-
return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata)];
|
|
302
|
+
return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata, this.proxyUrl)];
|
|
301
303
|
case 2:
|
|
302
304
|
autodetectedRegionName = _b.sent();
|
|
303
305
|
azureRegion = this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
|
|
@@ -360,19 +362,25 @@ var Authority = /** @class */ (function () {
|
|
|
360
362
|
*/
|
|
361
363
|
Authority.prototype.getEndpointMetadataFromNetwork = function () {
|
|
362
364
|
return __awaiter(this, void 0, void 0, function () {
|
|
363
|
-
var response;
|
|
365
|
+
var options, response;
|
|
364
366
|
return __generator(this, function (_a) {
|
|
365
367
|
switch (_a.label) {
|
|
366
368
|
case 0:
|
|
367
|
-
|
|
368
|
-
|
|
369
|
+
options = {};
|
|
370
|
+
if (this.proxyUrl) {
|
|
371
|
+
options.proxyUrl = this.proxyUrl;
|
|
372
|
+
}
|
|
373
|
+
_a.label = 1;
|
|
369
374
|
case 1:
|
|
375
|
+
_a.trys.push([1, 3, , 4]);
|
|
376
|
+
return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options)];
|
|
377
|
+
case 2:
|
|
370
378
|
response = _a.sent();
|
|
371
379
|
return [2 /*return*/, isOpenIdConfigResponse(response.body) ? response.body : null];
|
|
372
|
-
case
|
|
380
|
+
case 3:
|
|
373
381
|
_a.sent();
|
|
374
382
|
return [2 /*return*/, null];
|
|
375
|
-
case
|
|
383
|
+
case 4: return [2 /*return*/];
|
|
376
384
|
}
|
|
377
385
|
});
|
|
378
386
|
});
|
|
@@ -442,16 +450,20 @@ var Authority = /** @class */ (function () {
|
|
|
442
450
|
*/
|
|
443
451
|
Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
|
|
444
452
|
return __awaiter(this, void 0, void 0, function () {
|
|
445
|
-
var instanceDiscoveryEndpoint, match, response, metadata;
|
|
453
|
+
var instanceDiscoveryEndpoint, options, match, response, metadata;
|
|
446
454
|
return __generator(this, function (_a) {
|
|
447
455
|
switch (_a.label) {
|
|
448
456
|
case 0:
|
|
449
457
|
instanceDiscoveryEndpoint = "" + Constants.AAD_INSTANCE_DISCOVERY_ENDPT + this.canonicalAuthority + "oauth2/v2.0/authorize";
|
|
458
|
+
options = {};
|
|
459
|
+
if (this.proxyUrl) {
|
|
460
|
+
options.proxyUrl = this.proxyUrl;
|
|
461
|
+
}
|
|
450
462
|
match = null;
|
|
451
463
|
_a.label = 1;
|
|
452
464
|
case 1:
|
|
453
465
|
_a.trys.push([1, 3, , 4]);
|
|
454
|
-
return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint)];
|
|
466
|
+
return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
|
|
455
467
|
case 2:
|
|
456
468
|
response = _a.sent();
|
|
457
469
|
metadata = isCloudInstanceDiscoveryResponse(response.body) ? response.body.metadata : [];
|
|
@@ -466,7 +478,7 @@ var Authority = /** @class */ (function () {
|
|
|
466
478
|
return [2 /*return*/, null];
|
|
467
479
|
case 4:
|
|
468
480
|
if (!match) {
|
|
469
|
-
// Custom Domain scenario, host is trusted because Instance Discovery call succeeded
|
|
481
|
+
// Custom Domain scenario, host is trusted because Instance Discovery call succeeded
|
|
470
482
|
match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
|
|
471
483
|
}
|
|
472
484
|
return [2 /*return*/, match];
|
|
@@ -484,6 +496,19 @@ var Authority = /** @class */ (function () {
|
|
|
484
496
|
});
|
|
485
497
|
return matches.length > 0;
|
|
486
498
|
};
|
|
499
|
+
/**
|
|
500
|
+
* helper function to populate the authority based on azureCloudOptions
|
|
501
|
+
* @param authorityString
|
|
502
|
+
* @param azureCloudOptions
|
|
503
|
+
*/
|
|
504
|
+
Authority.generateAuthority = function (authorityString, azureCloudOptions) {
|
|
505
|
+
var authorityAzureCloudInstance;
|
|
506
|
+
if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {
|
|
507
|
+
var tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;
|
|
508
|
+
authorityAzureCloudInstance = azureCloudOptions.azureCloudInstance + "/" + tenant + "/";
|
|
509
|
+
}
|
|
510
|
+
return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;
|
|
511
|
+
};
|
|
487
512
|
/**
|
|
488
513
|
* Creates cloud discovery metadata object from a given host
|
|
489
514
|
* @param host
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authority.js","sources":["../../src/authority/Authority.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorityType } from \"./AuthorityType\";\nimport { isOpenIdConfigResponse, OpenIdConfigResponse } from \"./OpenIdConfigResponse\";\nimport { UrlString } from \"../url/UrlString\";\nimport { IUri } from \"../url/IUri\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { AuthorityMetadataSource, Constants, RegionDiscoveryOutcomes } from \"../utils/Constants\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ProtocolMode } from \"./ProtocolMode\";\nimport { ICacheManager } from \"../cache/interface/ICacheManager\";\nimport { AuthorityMetadataEntity } from \"../cache/entities/AuthorityMetadataEntity\";\nimport { AuthorityOptions } from \"./AuthorityOptions\";\nimport { CloudInstanceDiscoveryResponse, isCloudInstanceDiscoveryResponse } from \"./CloudInstanceDiscoveryResponse\";\nimport { CloudDiscoveryMetadata } from \"./CloudDiscoveryMetadata\";\nimport { RegionDiscovery } from \"./RegionDiscovery\";\nimport { RegionDiscoveryMetadata } from \"./RegionDiscoveryMetadata\";\n\n/**\n * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the\n * endpoint. It will store the pertinent config data in this object for use during token calls.\n */\nexport class Authority {\n\n // Canonical authority url string\n private _canonicalAuthority: UrlString;\n // Canonicaly authority url components\n private _canonicalAuthorityUrlComponents: IUri | null;\n // Network interface to make requests with.\n protected networkInterface: INetworkModule;\n // Cache Manager to cache network responses\n protected cacheManager: ICacheManager;\n // Protocol mode to construct endpoints\n private authorityOptions: AuthorityOptions;\n // Authority metadata\n private metadata: AuthorityMetadataEntity;\n // Region discovery service\n private regionDiscovery: RegionDiscovery;\n // Region discovery metadata\n public regionDiscoveryMetadata: RegionDiscoveryMetadata;\n\n constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions) {\n this.canonicalAuthority = authority;\n this._canonicalAuthority.validateAsUri();\n this.networkInterface = networkInterface;\n this.cacheManager = cacheManager;\n this.authorityOptions = authorityOptions;\n this.regionDiscovery = new RegionDiscovery(networkInterface);\n this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };\n }\n\n // See above for AuthorityType\n public get authorityType(): AuthorityType {\n const pathSegments = this.canonicalAuthorityUrlComponents.PathSegments;\n\n if (pathSegments.length && pathSegments[0].toLowerCase() === Constants.ADFS) {\n return AuthorityType.Adfs;\n }\n\n return AuthorityType.Default;\n }\n\n /**\n * ProtocolMode enum representing the way endpoints are constructed.\n */\n public get protocolMode(): ProtocolMode {\n return this.authorityOptions.protocolMode;\n }\n\n /**\n * Returns authorityOptions which can be used to reinstantiate a new authority instance\n */\n public get options(): AuthorityOptions {\n return this.authorityOptions;\n }\n\n /**\n * A URL that is the authority set by the developer\n */\n public get canonicalAuthority(): string {\n return this._canonicalAuthority.urlString;\n }\n\n /**\n * Sets canonical authority.\n */\n public set canonicalAuthority(url: string) {\n this._canonicalAuthority = new UrlString(url);\n this._canonicalAuthority.validateAsUri();\n this._canonicalAuthorityUrlComponents = null;\n }\n\n /**\n * Get authority components.\n */\n public get canonicalAuthorityUrlComponents(): IUri {\n if (!this._canonicalAuthorityUrlComponents) {\n this._canonicalAuthorityUrlComponents = this._canonicalAuthority.getUrlComponents();\n }\n\n return this._canonicalAuthorityUrlComponents;\n }\n\n /**\n * Get hostname and port i.e. login.microsoftonline.com\n */\n public get hostnameAndPort(): string {\n return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase();\n }\n\n /**\n * Get tenant for authority.\n */\n public get tenant(): string {\n return this.canonicalAuthorityUrlComponents.PathSegments[0];\n }\n\n /**\n * OAuth /authorize endpoint for requests\n */\n public get authorizationEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.authorization_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth /token endpoint for requests\n */\n public get tokenEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.token_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n public get deviceCodeEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.token_endpoint.replace(\"/token\", \"/devicecode\"));\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth logout endpoint for requests\n */\n public get endSessionEndpoint(): string {\n if(this.discoveryComplete()) {\n // ROPC policies may not have end_session_endpoint set\n if (!this.metadata.end_session_endpoint) {\n throw ClientAuthError.createLogoutNotSupportedError();\n }\n const endpoint = this.replacePath(this.metadata.end_session_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth issuer for requests\n */\n public get selfSignedJwtAudience(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.issuer);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * Replaces tenant in url path with current tenant. Defaults to common.\n * @param urlString\n */\n private replaceTenant(urlString: string): string {\n return urlString.replace(/{tenant}|{tenantid}/g, this.tenant);\n }\n\n /**\n * Replaces path such as tenant or policy with the current tenant or policy.\n * @param urlString \n */\n private replacePath(urlString: string): string {\n let endpoint = urlString;\n const cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);\n const cachedAuthorityParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\n const currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;\n\n currentAuthorityParts.forEach((currentPart, index) => {\n const cachedPart = cachedAuthorityParts[index];\n if (currentPart !== cachedPart) {\n endpoint = endpoint.replace(`/${cachedPart}/`, `/${currentPart}/`);\n }\n });\n\n return endpoint;\n }\n\n /**\n * The default open id configuration endpoint for any canonical authority.\n */\n protected get defaultOpenIdConfigurationEndpoint(): string {\n if (this.authorityType === AuthorityType.Adfs || this.protocolMode === ProtocolMode.OIDC) {\n return `${this.canonicalAuthority}.well-known/openid-configuration`;\n }\n return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;\n }\n\n /**\n * Boolean that returns whethr or not tenant discovery has been completed.\n */\n discoveryComplete(): boolean {\n return !!this.metadata;\n }\n\n /**\n * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network\n * and the /authorize, /token and logout endpoints.\n */\n public async resolveEndpointsAsync(): Promise<void> {\n let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);\n if (!metadataEntity) {\n metadataEntity = new AuthorityMetadataEntity();\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\n }\n\n const cloudDiscoverySource = await this.updateCloudDiscoveryMetadata(metadataEntity);\n this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);\n const endpointSource = await this.updateEndpointMetadata(metadataEntity);\n\n if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE && endpointSource !== AuthorityMetadataSource.CACHE) {\n // Reset the expiration time unless both values came from a successful cache lookup\n metadataEntity.resetExpiresAt();\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\n } \n\n const cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache);\n this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);\n this.metadata = metadataEntity;\n }\n\n /**\n * Update AuthorityMetadataEntity with new endpoints and return where the information came from\n * @param metadataEntity \n */\n private async updateEndpointMetadata(metadataEntity: AuthorityMetadataEntity): Promise<AuthorityMetadataSource> {\n let metadata = this.getEndpointMetadataFromConfig();\n if (metadata) {\n metadataEntity.updateEndpointMetadata(metadata, false);\n return AuthorityMetadataSource.CONFIG;\n }\n\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.endpointsFromNetwork && !metadataEntity.isExpired()) {\n // No need to update\n return AuthorityMetadataSource.CACHE;\n }\n\n metadata = await this.getEndpointMetadataFromNetwork();\n if (metadata) {\n // If the user prefers to use an azure region replace the global endpoints with regional information.\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\n const autodetectedRegionName = await this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata);\n\n const azureRegion = this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG \n ? autodetectedRegionName \n : this.authorityOptions.azureRegionConfiguration.azureRegion;\n\n if (this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {\n this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;\n } else {\n if (autodetectedRegionName) {\n this.regionDiscoveryMetadata.region_outcome = (this.authorityOptions.azureRegionConfiguration.azureRegion === autodetectedRegionName) ?\n RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :\n RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;\n } else {\n this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;\n }\n }\n\n if (azureRegion) {\n this.regionDiscoveryMetadata.region_used = azureRegion;\n metadata = Authority.replaceWithRegionalInformation(metadata, azureRegion);\n }\n }\n\n metadataEntity.updateEndpointMetadata(metadata, true);\n return AuthorityMetadataSource.NETWORK;\n } else {\n throw ClientAuthError.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint);\n }\n }\n\n /**\n * Compares the number of url components after the domain to determine if the cached authority metadata can be used for the requested authority\n * Protects against same domain different authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy\n * @param metadataEntity\n */\n private isAuthoritySameType(metadataEntity: AuthorityMetadataEntity): boolean {\n const cachedAuthorityUrl = new UrlString(metadataEntity.canonical_authority);\n const cachedParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\n \n return cachedParts.length === this.canonicalAuthorityUrlComponents.PathSegments.length;\n }\n\n /**\n * Parse authorityMetadata config option\n */\n private getEndpointMetadataFromConfig(): OpenIdConfigResponse | null {\n if (this.authorityOptions.authorityMetadata) {\n try {\n return JSON.parse(this.authorityOptions.authorityMetadata) as OpenIdConfigResponse;\n } catch (e) {\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\n }\n }\n\n return null;\n }\n\n /**\n * Gets OAuth endpoints from the given OpenID configuration endpoint.\n */\n private async getEndpointMetadataFromNetwork(): Promise<OpenIdConfigResponse | null> {\n try {\n const response = await this.networkInterface.sendGetRequestAsync<OpenIdConfigResponse>(this.defaultOpenIdConfigurationEndpoint);\n return isOpenIdConfigResponse(response.body) ? response.body : null;\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache and returns where the information was retrived from\n * @param cachedMetadata \n * @param newMetadata \n */\n private async updateCloudDiscoveryMetadata(metadataEntity: AuthorityMetadataEntity): Promise<AuthorityMetadataSource> {\n let metadata = this.getCloudDiscoveryMetadataFromConfig();\n if (metadata) {\n metadataEntity.updateCloudDiscoveryMetadata(metadata, false);\n return AuthorityMetadataSource.CONFIG;\n }\n\n // If The cached metadata came from config but that config was not passed to this instance, we must go to the network\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.aliasesFromNetwork && !metadataEntity.isExpired()) {\n // No need to update\n return AuthorityMetadataSource.CACHE;\n }\n\n metadata = await this.getCloudDiscoveryMetadataFromNetwork();\n if (metadata) {\n metadataEntity.updateCloudDiscoveryMetadata(metadata, true);\n return AuthorityMetadataSource.NETWORK;\n } else {\n // Metadata could not be obtained from config, cache or network\n throw ClientConfigurationError.createUntrustedAuthorityError();\n }\n }\n\n /**\n * Parse cloudDiscoveryMetadata config or check knownAuthorities\n */\n private getCloudDiscoveryMetadataFromConfig(): CloudDiscoveryMetadata | null {\n // Check if network response was provided in config\n if (this.authorityOptions.cloudDiscoveryMetadata) {\n try {\n const parsedResponse = JSON.parse(this.authorityOptions.cloudDiscoveryMetadata) as CloudInstanceDiscoveryResponse;\n const metadata = Authority.getCloudDiscoveryMetadataFromNetworkResponse(parsedResponse.metadata, this.hostnameAndPort);\n if (metadata) {\n return metadata;\n }\n } catch (e) {\n throw ClientConfigurationError.createInvalidCloudDiscoveryMetadataError();\n }\n }\n\n // If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities\n if (this.isInKnownAuthorities()) {\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\n }\n\n return null;\n }\n\n /**\n * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config\n * @param networkInterface \n */\n private async getCloudDiscoveryMetadataFromNetwork(): Promise<CloudDiscoveryMetadata | null> {\n const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;\n let match = null;\n try {\n const response = await this.networkInterface.sendGetRequestAsync<CloudInstanceDiscoveryResponse>(instanceDiscoveryEndpoint);\n const metadata = isCloudInstanceDiscoveryResponse(response.body) ? response.body.metadata : [];\n if (metadata.length === 0) {\n // If no metadata is returned, authority is untrusted\n return null;\n }\n match = Authority.getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);\n } catch(e) {\n return null;\n }\n\n if (!match) {\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded \n match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\n }\n return match;\n } \n\n /**\n * Helper function to determine if this host is included in the knownAuthorities config option\n */\n private isInKnownAuthorities(): boolean {\n const matches = this.authorityOptions.knownAuthorities.filter((authority) => {\n return UrlString.getDomainFromUrl(authority).toLowerCase() === this.hostnameAndPort;\n });\n\n return matches.length > 0;\n }\n\n /**\n * Creates cloud discovery metadata object from a given host\n * @param host \n */\n static createCloudDiscoveryMetadataFromHost(host: string): CloudDiscoveryMetadata {\n return {\n preferred_network: host,\n preferred_cache: host,\n aliases: [host]\n };\n }\n\n /**\n * Searches instance discovery network response for the entry that contains the host in the aliases list\n * @param response \n * @param authority \n */\n static getCloudDiscoveryMetadataFromNetworkResponse(response: CloudDiscoveryMetadata[], authority: string): CloudDiscoveryMetadata | null {\n for (let i = 0; i < response.length; i++) {\n const metadata = response[i];\n if (metadata.aliases.indexOf(authority) > -1) {\n return metadata;\n }\n }\n\n return null;\n }\n\n /**\n * helper function to generate environment from authority object\n */\n getPreferredCache(): string {\n if(this.discoveryComplete()) {\n return this.metadata.preferred_cache;\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * Returns whether or not the provided host is an alias of this authority instance\n * @param host \n */\n isAlias(host: string): boolean {\n return this.metadata.aliases.indexOf(host) > -1;\n }\n\n /**\n * Checks whether the provided host is that of a public cloud authority\n * \n * @param authority string\n * @returns bool\n */\n static isPublicCloudAuthority(host: string): boolean {\n return Constants.KNOWN_PUBLIC_CLOUDS.indexOf(host) >= 0;\n }\n\n /**\n * Rebuild the authority string with the region\n * \n * @param host string\n * @param region string \n */\n static buildRegionalAuthorityString(host: string, region: string, queryString?: string): string {\n // Create and validate a Url string object with the initial authority string\n const authorityUrlInstance = new UrlString(host);\n authorityUrlInstance.validateAsUri();\n\n const authorityUrlParts = authorityUrlInstance.getUrlComponents();\n\n let hostNameAndPort= `${region}.${authorityUrlParts.HostNameAndPort}`;\n\n if (this.isPublicCloudAuthority(authorityUrlParts.HostNameAndPort)) {\n hostNameAndPort = `${region}.${Constants.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`;\n }\n\n // Include the query string portion of the url\n const url = UrlString.constructAuthorityUriFromObject({\n ...authorityUrlInstance.getUrlComponents(),\n HostNameAndPort: hostNameAndPort\n }).urlString;\n\n // Add the query string if a query string was provided\n if (queryString) return `${url}?${queryString}`;\n\n return url;\n }\n\n /**\n * Replace the endpoints in the metadata object with their regional equivalents.\n * \n * @param metadata OpenIdConfigResponse\n * @param azureRegion string\n */\n static replaceWithRegionalInformation(metadata: OpenIdConfigResponse, azureRegion: string): OpenIdConfigResponse {\n metadata.authorization_endpoint = Authority.buildRegionalAuthorityString(metadata.authorization_endpoint, azureRegion);\n // TODO: Enquire on whether we should leave the query string or remove it before releasing the feature\n metadata.token_endpoint = Authority.buildRegionalAuthorityString(metadata.token_endpoint, azureRegion, \"allowestsrnonmsi=true\");\n\n if (metadata.end_session_endpoint) {\n metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_endpoint, azureRegion);\n }\n \n return metadata;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;AAsBA;;;;;IAuBI,mBAAY,SAAiB,EAAE,gBAAgC,EAAE,YAA2B,EAAE,gBAAkC;QAC5H,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,CAAC;QACzC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAC7D,IAAI,CAAC,uBAAuB,GAAG,EAAE,W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../src/authority/Authority.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorityType } from \"./AuthorityType\";\nimport { isOpenIdConfigResponse, OpenIdConfigResponse } from \"./OpenIdConfigResponse\";\nimport { UrlString } from \"../url/UrlString\";\nimport { IUri } from \"../url/IUri\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { AuthorityMetadataSource, Constants, RegionDiscoveryOutcomes } from \"../utils/Constants\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ProtocolMode } from \"./ProtocolMode\";\nimport { ICacheManager } from \"../cache/interface/ICacheManager\";\nimport { AuthorityMetadataEntity } from \"../cache/entities/AuthorityMetadataEntity\";\nimport { AuthorityOptions , AzureCloudInstance } from \"./AuthorityOptions\";\nimport { CloudInstanceDiscoveryResponse, isCloudInstanceDiscoveryResponse } from \"./CloudInstanceDiscoveryResponse\";\nimport { CloudDiscoveryMetadata } from \"./CloudDiscoveryMetadata\";\nimport { RegionDiscovery } from \"./RegionDiscovery\";\nimport { RegionDiscoveryMetadata } from \"./RegionDiscoveryMetadata\";\nimport { ImdsOptions } from \"./ImdsOptions\";\nimport { AzureCloudOptions } from \"../config/ClientConfiguration\";\n\n/**\n * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the\n * endpoint. It will store the pertinent config data in this object for use during token calls.\n */\nexport class Authority {\n\n // Canonical authority url string\n private _canonicalAuthority: UrlString;\n // Canonicaly authority url components\n private _canonicalAuthorityUrlComponents: IUri | null;\n // Network interface to make requests with.\n protected networkInterface: INetworkModule;\n // Cache Manager to cache network responses\n protected cacheManager: ICacheManager;\n // Protocol mode to construct endpoints\n private authorityOptions: AuthorityOptions;\n // Authority metadata\n private metadata: AuthorityMetadataEntity;\n // Region discovery service\n private regionDiscovery: RegionDiscovery;\n // Region discovery metadata\n public regionDiscoveryMetadata: RegionDiscoveryMetadata;\n // Proxy url string\n private proxyUrl: string;\n\n constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string) {\n this.canonicalAuthority = authority;\n this._canonicalAuthority.validateAsUri();\n this.networkInterface = networkInterface;\n this.cacheManager = cacheManager;\n this.authorityOptions = authorityOptions;\n this.regionDiscovery = new RegionDiscovery(networkInterface);\n this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };\n this.proxyUrl = proxyUrl || Constants.EMPTY_STRING;\n }\n\n // See above for AuthorityType\n public get authorityType(): AuthorityType {\n const pathSegments = this.canonicalAuthorityUrlComponents.PathSegments;\n\n if (pathSegments.length && pathSegments[0].toLowerCase() === Constants.ADFS) {\n return AuthorityType.Adfs;\n }\n\n return AuthorityType.Default;\n }\n\n /**\n * ProtocolMode enum representing the way endpoints are constructed.\n */\n public get protocolMode(): ProtocolMode {\n return this.authorityOptions.protocolMode;\n }\n\n /**\n * Returns authorityOptions which can be used to reinstantiate a new authority instance\n */\n public get options(): AuthorityOptions {\n return this.authorityOptions;\n }\n\n /**\n * A URL that is the authority set by the developer\n */\n public get canonicalAuthority(): string {\n return this._canonicalAuthority.urlString;\n }\n\n /**\n * Sets canonical authority.\n */\n public set canonicalAuthority(url: string) {\n this._canonicalAuthority = new UrlString(url);\n this._canonicalAuthority.validateAsUri();\n this._canonicalAuthorityUrlComponents = null;\n }\n\n /**\n * Get authority components.\n */\n public get canonicalAuthorityUrlComponents(): IUri {\n if (!this._canonicalAuthorityUrlComponents) {\n this._canonicalAuthorityUrlComponents = this._canonicalAuthority.getUrlComponents();\n }\n\n return this._canonicalAuthorityUrlComponents;\n }\n\n /**\n * Get hostname and port i.e. login.microsoftonline.com\n */\n public get hostnameAndPort(): string {\n return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase();\n }\n\n /**\n * Get tenant for authority.\n */\n public get tenant(): string {\n return this.canonicalAuthorityUrlComponents.PathSegments[0];\n }\n\n /**\n * OAuth /authorize endpoint for requests\n */\n public get authorizationEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.authorization_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth /token endpoint for requests\n */\n public get tokenEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.token_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n public get deviceCodeEndpoint(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.token_endpoint.replace(\"/token\", \"/devicecode\"));\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth logout endpoint for requests\n */\n public get endSessionEndpoint(): string {\n if(this.discoveryComplete()) {\n // ROPC policies may not have end_session_endpoint set\n if (!this.metadata.end_session_endpoint) {\n throw ClientAuthError.createLogoutNotSupportedError();\n }\n const endpoint = this.replacePath(this.metadata.end_session_endpoint);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * OAuth issuer for requests\n */\n public get selfSignedJwtAudience(): string {\n if(this.discoveryComplete()) {\n const endpoint = this.replacePath(this.metadata.issuer);\n return this.replaceTenant(endpoint);\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * Replaces tenant in url path with current tenant. Defaults to common.\n * @param urlString\n */\n private replaceTenant(urlString: string): string {\n return urlString.replace(/{tenant}|{tenantid}/g, this.tenant);\n }\n\n /**\n * Replaces path such as tenant or policy with the current tenant or policy.\n * @param urlString\n */\n private replacePath(urlString: string): string {\n let endpoint = urlString;\n const cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);\n const cachedAuthorityParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\n const currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;\n\n currentAuthorityParts.forEach((currentPart, index) => {\n const cachedPart = cachedAuthorityParts[index];\n if (currentPart !== cachedPart) {\n endpoint = endpoint.replace(`/${cachedPart}/`, `/${currentPart}/`);\n }\n });\n\n return endpoint;\n }\n\n /**\n * The default open id configuration endpoint for any canonical authority.\n */\n protected get defaultOpenIdConfigurationEndpoint(): string {\n if (this.authorityType === AuthorityType.Adfs || this.protocolMode === ProtocolMode.OIDC) {\n return `${this.canonicalAuthority}.well-known/openid-configuration`;\n }\n return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;\n }\n\n /**\n * Boolean that returns whethr or not tenant discovery has been completed.\n */\n discoveryComplete(): boolean {\n return !!this.metadata;\n }\n\n /**\n * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network\n * and the /authorize, /token and logout endpoints.\n */\n public async resolveEndpointsAsync(): Promise<void> {\n let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);\n if (!metadataEntity) {\n metadataEntity = new AuthorityMetadataEntity();\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\n }\n\n const cloudDiscoverySource = await this.updateCloudDiscoveryMetadata(metadataEntity);\n this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);\n const endpointSource = await this.updateEndpointMetadata(metadataEntity);\n\n if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE && endpointSource !== AuthorityMetadataSource.CACHE) {\n // Reset the expiration time unless both values came from a successful cache lookup\n metadataEntity.resetExpiresAt();\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\n }\n\n const cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache);\n this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);\n this.metadata = metadataEntity;\n }\n\n /**\n * Update AuthorityMetadataEntity with new endpoints and return where the information came from\n * @param metadataEntity\n */\n private async updateEndpointMetadata(metadataEntity: AuthorityMetadataEntity): Promise<AuthorityMetadataSource> {\n let metadata = this.getEndpointMetadataFromConfig();\n if (metadata) {\n metadataEntity.updateEndpointMetadata(metadata, false);\n return AuthorityMetadataSource.CONFIG;\n }\n\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.endpointsFromNetwork && !metadataEntity.isExpired()) {\n // No need to update\n return AuthorityMetadataSource.CACHE;\n }\n\n metadata = await this.getEndpointMetadataFromNetwork();\n if (metadata) {\n // If the user prefers to use an azure region replace the global endpoints with regional information.\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\n const autodetectedRegionName = await this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata, this.proxyUrl);\n\n const azureRegion = this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG\n ? autodetectedRegionName\n : this.authorityOptions.azureRegionConfiguration.azureRegion;\n\n if (this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {\n this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;\n } else {\n if (autodetectedRegionName) {\n this.regionDiscoveryMetadata.region_outcome = (this.authorityOptions.azureRegionConfiguration.azureRegion === autodetectedRegionName) ?\n RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :\n RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;\n } else {\n this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;\n }\n }\n\n if (azureRegion) {\n this.regionDiscoveryMetadata.region_used = azureRegion;\n metadata = Authority.replaceWithRegionalInformation(metadata, azureRegion);\n }\n }\n\n metadataEntity.updateEndpointMetadata(metadata, true);\n return AuthorityMetadataSource.NETWORK;\n } else {\n throw ClientAuthError.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint);\n }\n }\n\n /**\n * Compares the number of url components after the domain to determine if the cached authority metadata can be used for the requested authority\n * Protects against same domain different authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy\n * @param metadataEntity\n */\n private isAuthoritySameType(metadataEntity: AuthorityMetadataEntity): boolean {\n const cachedAuthorityUrl = new UrlString(metadataEntity.canonical_authority);\n const cachedParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\n\n return cachedParts.length === this.canonicalAuthorityUrlComponents.PathSegments.length;\n }\n\n /**\n * Parse authorityMetadata config option\n */\n private getEndpointMetadataFromConfig(): OpenIdConfigResponse | null {\n if (this.authorityOptions.authorityMetadata) {\n try {\n return JSON.parse(this.authorityOptions.authorityMetadata) as OpenIdConfigResponse;\n } catch (e) {\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\n }\n }\n\n return null;\n }\n\n /**\n * Gets OAuth endpoints from the given OpenID configuration endpoint.\n */\n private async getEndpointMetadataFromNetwork(): Promise<OpenIdConfigResponse | null> {\n const options: ImdsOptions = {};\n if (this.proxyUrl) {\n options.proxyUrl = this.proxyUrl;\n }\n\n try {\n const response = await this.networkInterface.sendGetRequestAsync<OpenIdConfigResponse>(this.defaultOpenIdConfigurationEndpoint, options);\n return isOpenIdConfigResponse(response.body) ? response.body : null;\n } catch (e) {\n return null;\n }\n }\n\n /**\n * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache and returns where the information was retrived from\n * @param cachedMetadata\n * @param newMetadata\n */\n private async updateCloudDiscoveryMetadata(metadataEntity: AuthorityMetadataEntity): Promise<AuthorityMetadataSource> {\n let metadata = this.getCloudDiscoveryMetadataFromConfig();\n if (metadata) {\n metadataEntity.updateCloudDiscoveryMetadata(metadata, false);\n return AuthorityMetadataSource.CONFIG;\n }\n\n // If The cached metadata came from config but that config was not passed to this instance, we must go to the network\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.aliasesFromNetwork && !metadataEntity.isExpired()) {\n // No need to update\n return AuthorityMetadataSource.CACHE;\n }\n\n metadata = await this.getCloudDiscoveryMetadataFromNetwork();\n if (metadata) {\n metadataEntity.updateCloudDiscoveryMetadata(metadata, true);\n return AuthorityMetadataSource.NETWORK;\n } else {\n // Metadata could not be obtained from config, cache or network\n throw ClientConfigurationError.createUntrustedAuthorityError();\n }\n }\n\n /**\n * Parse cloudDiscoveryMetadata config or check knownAuthorities\n */\n private getCloudDiscoveryMetadataFromConfig(): CloudDiscoveryMetadata | null {\n // Check if network response was provided in config\n if (this.authorityOptions.cloudDiscoveryMetadata) {\n try {\n const parsedResponse = JSON.parse(this.authorityOptions.cloudDiscoveryMetadata) as CloudInstanceDiscoveryResponse;\n const metadata = Authority.getCloudDiscoveryMetadataFromNetworkResponse(parsedResponse.metadata, this.hostnameAndPort);\n if (metadata) {\n return metadata;\n }\n } catch (e) {\n throw ClientConfigurationError.createInvalidCloudDiscoveryMetadataError();\n }\n }\n\n // If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities\n if (this.isInKnownAuthorities()) {\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\n }\n\n return null;\n }\n\n /**\n * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config\n * @param networkInterface\n */\n private async getCloudDiscoveryMetadataFromNetwork(): Promise<CloudDiscoveryMetadata | null> {\n const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;\n const options: ImdsOptions = {};\n if (this.proxyUrl) {\n options.proxyUrl = this.proxyUrl;\n }\n\n let match = null;\n try {\n const response = await this.networkInterface.sendGetRequestAsync<CloudInstanceDiscoveryResponse>(instanceDiscoveryEndpoint, options);\n const metadata = isCloudInstanceDiscoveryResponse(response.body) ? response.body.metadata : [];\n if (metadata.length === 0) {\n // If no metadata is returned, authority is untrusted\n return null;\n }\n match = Authority.getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);\n } catch(e) {\n return null;\n }\n\n if (!match) {\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded\n match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\n }\n return match;\n }\n\n /**\n * Helper function to determine if this host is included in the knownAuthorities config option\n */\n private isInKnownAuthorities(): boolean {\n const matches = this.authorityOptions.knownAuthorities.filter((authority) => {\n return UrlString.getDomainFromUrl(authority).toLowerCase() === this.hostnameAndPort;\n });\n\n return matches.length > 0;\n }\n\n /**\n * helper function to populate the authority based on azureCloudOptions\n * @param authorityString\n * @param azureCloudOptions\n */\n static generateAuthority(authorityString: string, azureCloudOptions?: AzureCloudOptions): string {\n let authorityAzureCloudInstance;\n\n if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {\n const tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;\n authorityAzureCloudInstance = `${azureCloudOptions.azureCloudInstance}/${tenant}/`;\n }\n\n return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;\n }\n\n /**\n * Creates cloud discovery metadata object from a given host\n * @param host\n */\n static createCloudDiscoveryMetadataFromHost(host: string): CloudDiscoveryMetadata {\n return {\n preferred_network: host,\n preferred_cache: host,\n aliases: [host]\n };\n }\n\n /**\n * Searches instance discovery network response for the entry that contains the host in the aliases list\n * @param response\n * @param authority\n */\n static getCloudDiscoveryMetadataFromNetworkResponse(response: CloudDiscoveryMetadata[], authority: string): CloudDiscoveryMetadata | null {\n for (let i = 0; i < response.length; i++) {\n const metadata = response[i];\n if (metadata.aliases.indexOf(authority) > -1) {\n return metadata;\n }\n }\n\n return null;\n }\n\n /**\n * helper function to generate environment from authority object\n */\n getPreferredCache(): string {\n if(this.discoveryComplete()) {\n return this.metadata.preferred_cache;\n } else {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\n }\n }\n\n /**\n * Returns whether or not the provided host is an alias of this authority instance\n * @param host\n */\n isAlias(host: string): boolean {\n return this.metadata.aliases.indexOf(host) > -1;\n }\n\n /**\n * Checks whether the provided host is that of a public cloud authority\n *\n * @param authority string\n * @returns bool\n */\n static isPublicCloudAuthority(host: string): boolean {\n return Constants.KNOWN_PUBLIC_CLOUDS.indexOf(host) >= 0;\n }\n\n /**\n * Rebuild the authority string with the region\n *\n * @param host string\n * @param region string\n */\n static buildRegionalAuthorityString(host: string, region: string, queryString?: string): string {\n // Create and validate a Url string object with the initial authority string\n const authorityUrlInstance = new UrlString(host);\n authorityUrlInstance.validateAsUri();\n\n const authorityUrlParts = authorityUrlInstance.getUrlComponents();\n\n let hostNameAndPort= `${region}.${authorityUrlParts.HostNameAndPort}`;\n\n if (this.isPublicCloudAuthority(authorityUrlParts.HostNameAndPort)) {\n hostNameAndPort = `${region}.${Constants.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`;\n }\n\n // Include the query string portion of the url\n const url = UrlString.constructAuthorityUriFromObject({\n ...authorityUrlInstance.getUrlComponents(),\n HostNameAndPort: hostNameAndPort\n }).urlString;\n\n // Add the query string if a query string was provided\n if (queryString) return `${url}?${queryString}`;\n\n return url;\n }\n\n /**\n * Replace the endpoints in the metadata object with their regional equivalents.\n *\n * @param metadata OpenIdConfigResponse\n * @param azureRegion string\n */\n static replaceWithRegionalInformation(metadata: OpenIdConfigResponse, azureRegion: string): OpenIdConfigResponse {\n metadata.authorization_endpoint = Authority.buildRegionalAuthorityString(metadata.authorization_endpoint, azureRegion);\n // TODO: Enquire on whether we should leave the query string or remove it before releasing the feature\n metadata.token_endpoint = Authority.buildRegionalAuthorityString(metadata.token_endpoint, azureRegion, \"allowestsrnonmsi=true\");\n\n if (metadata.end_session_endpoint) {\n metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_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B;IACL,gBAAC;AAAD,CAAC;;;;"}
|
|
@@ -13,7 +13,7 @@ export declare class AuthorityFactory {
|
|
|
13
13
|
* @param networkClient
|
|
14
14
|
* @param protocolMode
|
|
15
15
|
*/
|
|
16
|
-
static createDiscoveredInstance(authorityUri: string, networkClient: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions): Promise<Authority>;
|
|
16
|
+
static createDiscoveredInstance(authorityUri: string, networkClient: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string): Promise<Authority>;
|
|
17
17
|
/**
|
|
18
18
|
* Create an authority object of the correct type based on the url
|
|
19
19
|
* Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)
|
|
@@ -24,6 +24,6 @@ export declare class AuthorityFactory {
|
|
|
24
24
|
* @param networkInterface
|
|
25
25
|
* @param protocolMode
|
|
26
26
|
*/
|
|
27
|
-
static createInstance(authorityUrl: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions): Authority;
|
|
27
|
+
static createInstance(authorityUrl: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string): Authority;
|
|
28
28
|
}
|
|
29
29
|
//# sourceMappingURL=AuthorityFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorityFactory.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityFactory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,gBAAgB;IAEzB;;;;;;;;;OASG;WACU,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthorityFactory.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityFactory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,gBAAgB;IAEzB;;;;;;;;;OASG;WACU,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAYlM;;;;;;;;;OASG;IACH,MAAM,CAAC,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAQ/K"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v6.
|
|
1
|
+
/*! @azure/msal-common v6.1.0 2022-02-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
4
|
import { Authority } from './Authority.js';
|
|
@@ -23,13 +23,13 @@ var AuthorityFactory = /** @class */ (function () {
|
|
|
23
23
|
* @param networkClient
|
|
24
24
|
* @param protocolMode
|
|
25
25
|
*/
|
|
26
|
-
AuthorityFactory.createDiscoveredInstance = function (authorityUri, networkClient, cacheManager, authorityOptions) {
|
|
26
|
+
AuthorityFactory.createDiscoveredInstance = function (authorityUri, networkClient, cacheManager, authorityOptions, proxyUrl) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function () {
|
|
28
28
|
var acquireTokenAuthority, e_1;
|
|
29
29
|
return __generator(this, function (_a) {
|
|
30
30
|
switch (_a.label) {
|
|
31
31
|
case 0:
|
|
32
|
-
acquireTokenAuthority = AuthorityFactory.createInstance(authorityUri, networkClient, cacheManager, authorityOptions);
|
|
32
|
+
acquireTokenAuthority = AuthorityFactory.createInstance(authorityUri, networkClient, cacheManager, authorityOptions, proxyUrl);
|
|
33
33
|
_a.label = 1;
|
|
34
34
|
case 1:
|
|
35
35
|
_a.trys.push([1, 3, , 4]);
|
|
@@ -55,12 +55,12 @@ var AuthorityFactory = /** @class */ (function () {
|
|
|
55
55
|
* @param networkInterface
|
|
56
56
|
* @param protocolMode
|
|
57
57
|
*/
|
|
58
|
-
AuthorityFactory.createInstance = function (authorityUrl, networkInterface, cacheManager, authorityOptions) {
|
|
58
|
+
AuthorityFactory.createInstance = function (authorityUrl, networkInterface, cacheManager, authorityOptions, proxyUrl) {
|
|
59
59
|
// Throw error if authority url is empty
|
|
60
60
|
if (StringUtils.isEmpty(authorityUrl)) {
|
|
61
61
|
throw ClientConfigurationError.createUrlEmptyError();
|
|
62
62
|
}
|
|
63
|
-
return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions);
|
|
63
|
+
return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions, proxyUrl);
|
|
64
64
|
};
|
|
65
65
|
return AuthorityFactory;
|
|
66
66
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorityFactory.js","sources":["../../src/authority/AuthorityFactory.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Authority } from \"./Authority\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { ICacheManager } from \"../cache/interface/ICacheManager\";\nimport { AuthorityOptions } from \"./AuthorityOptions\";\n\nexport class AuthorityFactory {\n\n /**\n * Create an authority object of the correct type based on the url\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\n *\n * Also performs endpoint discovery.\n *\n * @param authorityUri\n * @param networkClient\n * @param protocolMode\n */\n static async createDiscoveredInstance(authorityUri: string, networkClient: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions): Promise<Authority> {\n // Initialize authority and perform discovery endpoint check.\n const acquireTokenAuthority: Authority = AuthorityFactory.createInstance(authorityUri, networkClient, cacheManager, authorityOptions);\n\n try {\n await acquireTokenAuthority.resolveEndpointsAsync();\n return acquireTokenAuthority;\n } catch (e) {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(e);\n }\n }\n\n /**\n * Create an authority object of the correct type based on the url\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\n *\n * Does not perform endpoint discovery.\n *\n * @param authorityUrl\n * @param networkInterface\n * @param protocolMode\n */\n static createInstance(authorityUrl: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions): Authority {\n // Throw error if authority url is empty\n if (StringUtils.isEmpty(authorityUrl)) {\n throw ClientConfigurationError.createUrlEmptyError();\n }\n\n return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAaA;KA0CC;;;;;;;;;;;IA9BgB,yCAAwB,GAArC,UAAsC,YAAoB,EAAE,aAA6B,EAAE,YAA2B,EAAE,gBAAkC;;;;;;
|
|
1
|
+
{"version":3,"file":"AuthorityFactory.js","sources":["../../src/authority/AuthorityFactory.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Authority } from \"./Authority\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { ICacheManager } from \"../cache/interface/ICacheManager\";\nimport { AuthorityOptions } from \"./AuthorityOptions\";\n\nexport class AuthorityFactory {\n\n /**\n * Create an authority object of the correct type based on the url\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\n *\n * Also performs endpoint discovery.\n *\n * @param authorityUri\n * @param networkClient\n * @param protocolMode\n */\n static async createDiscoveredInstance(authorityUri: string, networkClient: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string): Promise<Authority> {\n // Initialize authority and perform discovery endpoint check.\n const acquireTokenAuthority: Authority = AuthorityFactory.createInstance(authorityUri, networkClient, cacheManager, authorityOptions, proxyUrl);\n\n try {\n await acquireTokenAuthority.resolveEndpointsAsync();\n return acquireTokenAuthority;\n } catch (e) {\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(e);\n }\n }\n\n /**\n * Create an authority object of the correct type based on the url\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\n *\n * Does not perform endpoint discovery.\n *\n * @param authorityUrl\n * @param networkInterface\n * @param protocolMode\n */\n static createInstance(authorityUrl: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string): Authority {\n // Throw error if authority url is empty\n if (StringUtils.isEmpty(authorityUrl)) {\n throw ClientConfigurationError.createUrlEmptyError();\n }\n\n return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions, proxyUrl);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAaA;KA0CC;;;;;;;;;;;IA9BgB,yCAAwB,GAArC,UAAsC,YAAoB,EAAE,aAA6B,EAAE,YAA2B,EAAE,gBAAkC,EAAE,QAAiB;;;;;;wBAEnK,qBAAqB,GAAc,gBAAgB,CAAC,cAAc,CAAC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;;;;wBAG5I,qBAAM,qBAAqB,CAAC,qBAAqB,EAAE,EAAA;;wBAAnD,SAAmD,CAAC;wBACpD,sBAAO,qBAAqB,EAAC;;;wBAE7B,MAAM,eAAe,CAAC,sCAAsC,CAAC,GAAC,CAAC,CAAC;;;;;KAEvE;;;;;;;;;;;IAYM,+BAAc,GAArB,UAAsB,YAAoB,EAAE,gBAAgC,EAAE,YAA2B,EAAE,gBAAkC,EAAE,QAAiB;;QAE5J,IAAI,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YACnC,MAAM,wBAAwB,CAAC,mBAAmB,EAAE,CAAC;SACxD;QAED,OAAO,IAAI,SAAS,CAAC,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;KAClG;IACL,uBAAC;AAAD,CAAC;;;;"}
|
|
@@ -7,4 +7,11 @@ export declare type AuthorityOptions = {
|
|
|
7
7
|
authorityMetadata: string;
|
|
8
8
|
azureRegionConfiguration?: AzureRegionConfiguration;
|
|
9
9
|
};
|
|
10
|
+
export declare enum AzureCloudInstance {
|
|
11
|
+
None = 0,
|
|
12
|
+
AzurePublic = "https://login.microsoftonline.com",
|
|
13
|
+
AzureChina = "https://login.chinacloudapi.cn",
|
|
14
|
+
AzureGermany = "https://login.microsoftonline.de",
|
|
15
|
+
AzureUsGovernment = "https://login.microsoftonline.us"
|
|
16
|
+
}
|
|
10
17
|
//# sourceMappingURL=AuthorityOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorityOptions.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityOptions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,oBAAY,gBAAgB,GAAG;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACvD,CAAC"}
|
|
1
|
+
{"version":3,"file":"AuthorityOptions.d.ts","sourceRoot":"","sources":["../../src/authority/AuthorityOptions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,oBAAY,gBAAgB,GAAG;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACvD,CAAC;AAEF,oBAAY,kBAAkB;IAE1B,IAAI,IAAA;IAGJ,WAAW,sCAAsC;IAGjD,UAAU,mCAAmC;IAG7C,YAAY,qCAAqC;IAGjD,iBAAiB,qCAAqC;CACzD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! @azure/msal-common v6.1.0 2022-02-08 */
|
|
2
|
+
'use strict';
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
var AzureCloudInstance;
|
|
8
|
+
(function (AzureCloudInstance) {
|
|
9
|
+
// AzureCloudInstance is not specified.
|
|
10
|
+
AzureCloudInstance[AzureCloudInstance["None"] = 0] = "None";
|
|
11
|
+
// Microsoft Azure public cloud
|
|
12
|
+
AzureCloudInstance["AzurePublic"] = "https://login.microsoftonline.com";
|
|
13
|
+
// Microsoft Chinese national cloud
|
|
14
|
+
AzureCloudInstance["AzureChina"] = "https://login.chinacloudapi.cn";
|
|
15
|
+
// Microsoft German national cloud ("Black Forest")
|
|
16
|
+
AzureCloudInstance["AzureGermany"] = "https://login.microsoftonline.de";
|
|
17
|
+
// US Government cloud
|
|
18
|
+
AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
|
|
19
|
+
})(AzureCloudInstance || (AzureCloudInstance = {}));
|
|
20
|
+
|
|
21
|
+
export { AzureCloudInstance };
|
|
22
|
+
//# sourceMappingURL=AuthorityOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorityOptions.js","sources":["../../src/authority/AuthorityOptions.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ProtocolMode } from \"./ProtocolMode\";\nimport { AzureRegionConfiguration } from \"./AzureRegionConfiguration\";\n\nexport type AuthorityOptions = {\n protocolMode: ProtocolMode;\n knownAuthorities: Array<string>;\n cloudDiscoveryMetadata: string;\n authorityMetadata: string;\n azureRegionConfiguration?: AzureRegionConfiguration;\n};\n\nexport enum AzureCloudInstance {\n // AzureCloudInstance is not specified.\n None,\n\n // Microsoft Azure public cloud\n AzurePublic = \"https://login.microsoftonline.com\",\n\n // Microsoft Chinese national cloud\n AzureChina = \"https://login.chinacloudapi.cn\",\n\n // Microsoft German national cloud (\"Black Forest\")\n AzureGermany = \"https://login.microsoftonline.de\",\n\n // US Government cloud\n AzureUsGovernment = \"https://login.microsoftonline.us\",\n}\n"],"names":[],"mappings":";;AAAA;;;;IAgBY;AAAZ,WAAY,kBAAkB;;IAE1B,2DAAI,CAAA;;IAGJ,uEAAiD,CAAA;;IAGjD,mEAA6C,CAAA;;IAG7C,uEAAiD,CAAA;;IAGjD,4EAAsD,CAAA;AAC1D,CAAC,EAfW,kBAAkB,KAAlB,kBAAkB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImdsOptions.d.ts","sourceRoot":"","sources":["../../src/authority/ImdsOptions.ts"],"names":[],"mappings":"AAKA,oBAAY,WAAW,GAAG;IACtB,OAAO,CAAC,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|