@azure/msal-common 14.1.0 → 14.2.0-alpha.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/dist/account/AccountInfo.d.ts +31 -31
- package/dist/account/AuthToken.d.ts +17 -17
- package/dist/account/AuthToken.mjs +58 -58
- package/dist/account/CcsCredential.d.ts +9 -9
- package/dist/account/CcsCredential.mjs +8 -8
- package/dist/account/ClientCredentials.d.ts +14 -14
- package/dist/account/ClientInfo.d.ts +19 -19
- package/dist/account/ClientInfo.mjs +37 -37
- package/dist/account/TokenClaims.d.ts +65 -65
- package/dist/authority/Authority.d.ts +250 -235
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +795 -740
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +31 -31
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +48 -48
- package/dist/authority/AuthorityMetadata.d.ts +646 -623
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +941 -885
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +27 -21
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +18 -18
- package/dist/authority/AuthorityOptions.mjs.map +1 -1
- package/dist/authority/AuthorityType.d.ts +10 -10
- package/dist/authority/AuthorityType.mjs +13 -13
- package/dist/authority/AzureRegion.d.ts +1 -1
- package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
- package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +8 -8
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +8 -8
- package/dist/authority/ImdsOptions.d.ts +5 -5
- package/dist/authority/OIDCOptions.d.ts +8 -8
- package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
- package/dist/authority/OpenIdConfigResponse.mjs +10 -10
- package/dist/authority/ProtocolMode.d.ts +8 -8
- package/dist/authority/ProtocolMode.mjs +11 -11
- package/dist/authority/RegionDiscovery.d.ts +32 -32
- package/dist/authority/RegionDiscovery.mjs +106 -106
- package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
- package/dist/cache/CacheManager.d.ts +480 -464
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +1089 -1049
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +56 -56
- package/dist/cache/entities/AccessTokenEntity.mjs +109 -109
- package/dist/cache/entities/AccountEntity.d.ts +101 -101
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +218 -220
- package/dist/cache/entities/AccountEntity.mjs.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.d.ts +39 -39
- package/dist/cache/entities/AppMetadataEntity.mjs +66 -66
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +48 -48
- package/dist/cache/entities/AuthorityMetadataEntity.mjs +78 -78
- package/dist/cache/entities/CacheRecord.d.ts +14 -14
- package/dist/cache/entities/CacheRecord.mjs +14 -14
- package/dist/cache/entities/CredentialEntity.d.ts +88 -88
- package/dist/cache/entities/CredentialEntity.mjs +136 -136
- package/dist/cache/entities/IdTokenEntity.d.ts +34 -34
- package/dist/cache/entities/IdTokenEntity.mjs +56 -56
- package/dist/cache/entities/RefreshTokenEntity.d.ts +36 -36
- package/dist/cache/entities/RefreshTokenEntity.mjs +59 -59
- package/dist/cache/entities/ServerTelemetryEntity.d.ts +12 -12
- package/dist/cache/entities/ServerTelemetryEntity.mjs +27 -27
- package/dist/cache/entities/ThrottlingEntity.d.ts +13 -13
- package/dist/cache/entities/ThrottlingEntity.mjs +23 -23
- package/dist/cache/interface/ICacheManager.d.ts +166 -166
- package/dist/cache/interface/ICachePlugin.d.ts +5 -5
- package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
- package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
- package/dist/cache/persistence/TokenCacheContext.mjs +25 -25
- package/dist/cache/utils/CacheTypes.d.ts +67 -66
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +73 -73
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +408 -408
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +51 -51
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +100 -99
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +35 -35
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +187 -187
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +27 -26
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +118 -125
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/AppTokenProvider.d.ts +38 -38
- package/dist/config/ClientConfiguration.d.ts +150 -150
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +96 -98
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/crypto/ICrypto.d.ts +58 -58
- package/dist/crypto/ICrypto.mjs +30 -30
- package/dist/crypto/IGuidGenerator.d.ts +4 -4
- package/dist/crypto/JoseHeader.d.ts +22 -22
- package/dist/crypto/JoseHeader.mjs +37 -37
- package/dist/crypto/PopTokenGenerator.d.ts +60 -60
- package/dist/crypto/PopTokenGenerator.mjs +82 -82
- package/dist/crypto/SignedHttpRequest.d.ts +11 -11
- package/dist/error/AuthError.d.ts +44 -44
- package/dist/error/AuthError.mjs +46 -46
- package/dist/error/AuthErrorCodes.d.ts +5 -5
- package/dist/error/AuthErrorCodes.mjs +9 -9
- package/dist/error/ClientAuthError.d.ts +237 -232
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +250 -245
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +44 -43
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +50 -49
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +128 -128
- package/dist/error/ClientConfigurationError.mjs +135 -135
- package/dist/error/ClientConfigurationErrorCodes.d.ts +22 -22
- package/dist/error/ClientConfigurationErrorCodes.mjs +26 -26
- package/dist/error/InteractionRequiredAuthError.d.ts +57 -57
- package/dist/error/InteractionRequiredAuthError.mjs +76 -76
- package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +5 -5
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +11 -11
- package/dist/error/JoseHeaderError.d.ts +15 -15
- package/dist/error/JoseHeaderError.mjs +22 -22
- package/dist/error/JoseHeaderErrorCodes.d.ts +2 -2
- package/dist/error/JoseHeaderErrorCodes.mjs +6 -6
- package/dist/error/ServerError.d.ts +7 -7
- package/dist/error/ServerError.mjs +14 -14
- package/dist/index.cjs +8840 -8677
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +96 -96
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/logger/Logger.d.ts +95 -95
- package/dist/logger/Logger.mjs +188 -188
- package/dist/network/INetworkModule.d.ts +29 -29
- package/dist/network/INetworkModule.mjs +12 -12
- package/dist/network/NetworkManager.d.ts +33 -33
- package/dist/network/NetworkManager.mjs +34 -34
- package/dist/network/RequestThumbprint.d.ts +16 -16
- package/dist/network/ThrottlingUtils.d.ts +42 -42
- package/dist/network/ThrottlingUtils.mjs +95 -95
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +4 -4
- package/dist/packageMetadata.mjs.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
- package/dist/request/AuthenticationHeaderParser.mjs +55 -55
- package/dist/request/BaseAuthRequest.d.ts +40 -40
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
- package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
- package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
- package/dist/request/CommonEndSessionRequest.d.ts +21 -21
- package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
- package/dist/request/CommonRefreshTokenRequest.d.ts +22 -22
- package/dist/request/CommonSilentFlowRequest.d.ts +20 -20
- package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
- package/dist/request/NativeRequest.d.ts +19 -19
- package/dist/request/NativeSignOutRequest.d.ts +5 -5
- package/dist/request/RequestParameterBuilder.d.ts +217 -217
- package/dist/request/RequestParameterBuilder.mjs +381 -381
- package/dist/request/RequestValidator.d.ts +33 -33
- package/dist/request/RequestValidator.mjs +81 -81
- package/dist/request/ScopeSet.d.ts +88 -88
- package/dist/request/ScopeSet.mjs +197 -197
- package/dist/request/StoreInCache.d.ts +8 -8
- package/dist/response/AuthenticationResult.d.ts +41 -41
- package/dist/response/AuthorizationCodePayload.d.ts +13 -13
- package/dist/response/DeviceCodeResponse.d.ts +25 -25
- package/dist/response/ExternalTokenResponse.d.ts +15 -15
- package/dist/response/IMDSBadResponse.d.ts +4 -4
- package/dist/response/ResponseHandler.d.ts +67 -67
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +315 -311
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/response/ServerAuthorizationCodeResponse.d.ts +25 -25
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +46 -46
- package/dist/telemetry/performance/IPerformanceClient.d.ts +51 -51
- package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
- package/dist/telemetry/performance/PerformanceClient.d.ts +191 -191
- package/dist/telemetry/performance/PerformanceClient.mjs +409 -409
- package/dist/telemetry/performance/PerformanceEvent.d.ts +457 -441
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +249 -242
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +24 -24
- package/dist/telemetry/performance/StubPerformanceClient.mjs +76 -76
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +66 -66
- package/dist/telemetry/server/ServerTelemetryManager.mjs +197 -197
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
- package/dist/url/IUri.d.ts +12 -12
- package/dist/url/UrlString.d.ts +83 -83
- package/dist/url/UrlString.mjs +279 -279
- package/dist/utils/Constants.d.ts +368 -366
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +381 -378
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.d.ts +27 -27
- package/dist/utils/FunctionWrappers.mjs +84 -84
- package/dist/utils/MsalTypes.d.ts +6 -6
- package/dist/utils/ProtocolUtils.d.ts +42 -42
- package/dist/utils/ProtocolUtils.mjs +69 -69
- package/dist/utils/StringUtils.d.ts +40 -40
- package/dist/utils/StringUtils.mjs +95 -95
- package/dist/utils/TimeUtils.d.ts +27 -27
- package/dist/utils/TimeUtils.mjs +45 -45
- package/package.json +1 -1
- package/src/authority/Authority.ts +216 -130
- package/src/authority/AuthorityFactory.ts +4 -4
- package/src/authority/AuthorityMetadata.ts +87 -0
- package/src/authority/AuthorityOptions.ts +9 -0
- package/src/cache/CacheManager.ts +120 -52
- package/src/cache/entities/AccountEntity.ts +0 -3
- package/src/cache/utils/CacheTypes.ts +1 -0
- package/src/client/AuthorizationCodeClient.ts +9 -2
- package/src/client/BaseClient.ts +9 -6
- package/src/client/RefreshTokenClient.ts +17 -7
- package/src/client/SilentFlowClient.ts +49 -49
- package/src/config/ClientConfiguration.ts +4 -4
- package/src/error/ClientAuthError.ts +8 -0
- package/src/error/ClientAuthErrorCodes.ts +1 -0
- package/src/index.ts +7 -1
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +9 -3
- package/src/telemetry/performance/PerformanceEvent.ts +24 -2
- package/src/utils/Constants.ts +4 -0
|
@@ -23,7 +23,8 @@ import {
|
|
|
23
23
|
} from "../utils/Constants";
|
|
24
24
|
import {
|
|
25
25
|
EndpointMetadata,
|
|
26
|
-
|
|
26
|
+
getCloudDiscoveryMetadataFromHardcodedValues,
|
|
27
|
+
getCloudDiscoveryMetadataFromNetworkResponse,
|
|
27
28
|
InstanceDiscoveryMetadataAliases,
|
|
28
29
|
} from "./AuthorityMetadata";
|
|
29
30
|
import {
|
|
@@ -33,7 +34,11 @@ import {
|
|
|
33
34
|
import { ProtocolMode } from "./ProtocolMode";
|
|
34
35
|
import { ICacheManager } from "../cache/interface/ICacheManager";
|
|
35
36
|
import { AuthorityMetadataEntity } from "../cache/entities/AuthorityMetadataEntity";
|
|
36
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
AuthorityOptions,
|
|
39
|
+
AzureCloudInstance,
|
|
40
|
+
StaticAuthorityOptions,
|
|
41
|
+
} from "./AuthorityOptions";
|
|
37
42
|
import {
|
|
38
43
|
CloudInstanceDiscoveryResponse,
|
|
39
44
|
isCloudInstanceDiscoveryResponse,
|
|
@@ -81,6 +86,8 @@ export class Authority {
|
|
|
81
86
|
protected performanceClient: IPerformanceClient | undefined;
|
|
82
87
|
// Correlation Id
|
|
83
88
|
protected correlationId: string | undefined;
|
|
89
|
+
// Indicates if the authority is fake, for the purpose of a Managed Identity Application
|
|
90
|
+
private managedIdentity: boolean;
|
|
84
91
|
// Reserved tenant domain names that will not be replaced with tenant id
|
|
85
92
|
private static reservedTenantDomains: Set<string> = new Set([
|
|
86
93
|
"{tenant}",
|
|
@@ -97,7 +104,8 @@ export class Authority {
|
|
|
97
104
|
authorityOptions: AuthorityOptions,
|
|
98
105
|
logger: Logger,
|
|
99
106
|
performanceClient?: IPerformanceClient,
|
|
100
|
-
correlationId?: string
|
|
107
|
+
correlationId?: string,
|
|
108
|
+
managedIdentity?: boolean
|
|
101
109
|
) {
|
|
102
110
|
this.canonicalAuthority = authority;
|
|
103
111
|
this._canonicalAuthority.validateAsUri();
|
|
@@ -112,6 +120,7 @@ export class Authority {
|
|
|
112
120
|
this.logger = logger;
|
|
113
121
|
this.performanceClient = performanceClient;
|
|
114
122
|
this.correlationId = correlationId;
|
|
123
|
+
this.managedIdentity = managedIdentity || false;
|
|
115
124
|
this.regionDiscovery = new RegionDiscovery(
|
|
116
125
|
networkInterface,
|
|
117
126
|
this.logger,
|
|
@@ -377,7 +386,7 @@ export class Authority {
|
|
|
377
386
|
}
|
|
378
387
|
|
|
379
388
|
/**
|
|
380
|
-
* Boolean that returns
|
|
389
|
+
* Boolean that returns whether or not tenant discovery has been completed.
|
|
381
390
|
*/
|
|
382
391
|
discoveryComplete(): boolean {
|
|
383
392
|
return !!this.metadata;
|
|
@@ -393,14 +402,7 @@ export class Authority {
|
|
|
393
402
|
this.correlationId
|
|
394
403
|
);
|
|
395
404
|
|
|
396
|
-
|
|
397
|
-
this.hostnameAndPort
|
|
398
|
-
);
|
|
399
|
-
|
|
400
|
-
if (!metadataEntity) {
|
|
401
|
-
metadataEntity = new AuthorityMetadataEntity();
|
|
402
|
-
metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
|
|
403
|
-
}
|
|
405
|
+
const metadataEntity = this.getCurrentMetadataEntity();
|
|
404
406
|
|
|
405
407
|
const cloudDiscoverySource = await invokeAsync(
|
|
406
408
|
this.updateCloudDiscoveryMetadata.bind(this),
|
|
@@ -420,10 +422,46 @@ export class Authority {
|
|
|
420
422
|
this.performanceClient,
|
|
421
423
|
this.correlationId
|
|
422
424
|
)(metadataEntity);
|
|
425
|
+
this.updateCachedMetadata(metadataEntity, cloudDiscoverySource, {
|
|
426
|
+
source: endpointSource,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Returns metadata entity from cache if it exists, otherwiser returns a new metadata entity built
|
|
432
|
+
* from the configured canonical authority
|
|
433
|
+
* @returns
|
|
434
|
+
*/
|
|
435
|
+
private getCurrentMetadataEntity(): AuthorityMetadataEntity {
|
|
436
|
+
let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(
|
|
437
|
+
this.hostnameAndPort
|
|
438
|
+
);
|
|
439
|
+
|
|
440
|
+
if (!metadataEntity) {
|
|
441
|
+
metadataEntity = new AuthorityMetadataEntity();
|
|
442
|
+
metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
|
|
443
|
+
}
|
|
444
|
+
return metadataEntity;
|
|
445
|
+
}
|
|
423
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Updates cached metadata based on metadata source and sets the instance's metadata
|
|
449
|
+
* property to the same value
|
|
450
|
+
* @param metadataEntity
|
|
451
|
+
* @param cloudDiscoverySource
|
|
452
|
+
* @param endpointMetadataResult
|
|
453
|
+
*/
|
|
454
|
+
private updateCachedMetadata(
|
|
455
|
+
metadataEntity: AuthorityMetadataEntity,
|
|
456
|
+
cloudDiscoverySource: AuthorityMetadataSource | null,
|
|
457
|
+
endpointMetadataResult: {
|
|
458
|
+
source: AuthorityMetadataSource;
|
|
459
|
+
metadata?: OpenIdConfigResponse;
|
|
460
|
+
} | null
|
|
461
|
+
): void {
|
|
424
462
|
if (
|
|
425
463
|
cloudDiscoverySource !== AuthorityMetadataSource.CACHE &&
|
|
426
|
-
|
|
464
|
+
endpointMetadataResult?.source !== AuthorityMetadataSource.CACHE
|
|
427
465
|
) {
|
|
428
466
|
// Reset the expiration time unless both values came from a successful cache lookup
|
|
429
467
|
metadataEntity.resetExpiresAt();
|
|
@@ -448,16 +486,95 @@ export class Authority {
|
|
|
448
486
|
PerformanceEvents.AuthorityUpdateEndpointMetadata,
|
|
449
487
|
this.correlationId
|
|
450
488
|
);
|
|
489
|
+
|
|
490
|
+
const localMetadata =
|
|
491
|
+
this.updateEndpointMetadataFromLocalSources(metadataEntity);
|
|
492
|
+
|
|
493
|
+
// Further update may be required for hardcoded metadata if regional metadata is preferred
|
|
494
|
+
if (localMetadata) {
|
|
495
|
+
if (
|
|
496
|
+
localMetadata.source ===
|
|
497
|
+
AuthorityMetadataSource.HARDCODED_VALUES
|
|
498
|
+
) {
|
|
499
|
+
// If the user prefers to use an azure region replace the global endpoints with regional information.
|
|
500
|
+
if (
|
|
501
|
+
this.authorityOptions.azureRegionConfiguration?.azureRegion
|
|
502
|
+
) {
|
|
503
|
+
if (localMetadata.metadata) {
|
|
504
|
+
const hardcodedMetadata = await invokeAsync(
|
|
505
|
+
this.updateMetadataWithRegionalInformation.bind(
|
|
506
|
+
this
|
|
507
|
+
),
|
|
508
|
+
PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,
|
|
509
|
+
this.logger,
|
|
510
|
+
this.performanceClient,
|
|
511
|
+
this.correlationId
|
|
512
|
+
)(localMetadata.metadata);
|
|
513
|
+
metadataEntity.updateEndpointMetadata(
|
|
514
|
+
hardcodedMetadata,
|
|
515
|
+
false
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return localMetadata.source;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// Get metadata from network if local sources aren't available
|
|
524
|
+
let metadata = await invokeAsync(
|
|
525
|
+
this.getEndpointMetadataFromNetwork.bind(this),
|
|
526
|
+
PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork,
|
|
527
|
+
this.logger,
|
|
528
|
+
this.performanceClient,
|
|
529
|
+
this.correlationId
|
|
530
|
+
)();
|
|
531
|
+
if (metadata) {
|
|
532
|
+
// If the user prefers to use an azure region replace the global endpoints with regional information.
|
|
533
|
+
if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
|
|
534
|
+
metadata = await invokeAsync(
|
|
535
|
+
this.updateMetadataWithRegionalInformation.bind(this),
|
|
536
|
+
PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,
|
|
537
|
+
this.logger,
|
|
538
|
+
this.performanceClient,
|
|
539
|
+
this.correlationId
|
|
540
|
+
)(metadata);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
metadataEntity.updateEndpointMetadata(metadata, true);
|
|
544
|
+
return AuthorityMetadataSource.NETWORK;
|
|
545
|
+
} else {
|
|
546
|
+
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
547
|
+
throw createClientAuthError(
|
|
548
|
+
ClientAuthErrorCodes.openIdConfigError,
|
|
549
|
+
this.defaultOpenIdConfigurationEndpoint
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Updates endpoint metadata from local sources and returns where the information was retrieved from and the metadata config
|
|
556
|
+
* response if the source is hardcoded metadata
|
|
557
|
+
* @param metadataEntity
|
|
558
|
+
* @returns
|
|
559
|
+
*/
|
|
560
|
+
private updateEndpointMetadataFromLocalSources(
|
|
561
|
+
metadataEntity: AuthorityMetadataEntity
|
|
562
|
+
): {
|
|
563
|
+
source: AuthorityMetadataSource;
|
|
564
|
+
metadata?: OpenIdConfigResponse;
|
|
565
|
+
} | null {
|
|
451
566
|
this.logger.verbose(
|
|
452
567
|
"Attempting to get endpoint metadata from authority configuration"
|
|
453
568
|
);
|
|
454
|
-
|
|
455
|
-
if (
|
|
569
|
+
const configMetadata = this.getEndpointMetadataFromConfig();
|
|
570
|
+
if (configMetadata) {
|
|
456
571
|
this.logger.verbose(
|
|
457
572
|
"Found endpoint metadata in authority configuration"
|
|
458
573
|
);
|
|
459
|
-
metadataEntity.updateEndpointMetadata(
|
|
460
|
-
return
|
|
574
|
+
metadataEntity.updateEndpointMetadata(configMetadata, false);
|
|
575
|
+
return {
|
|
576
|
+
source: AuthorityMetadataSource.CONFIG,
|
|
577
|
+
};
|
|
461
578
|
}
|
|
462
579
|
|
|
463
580
|
this.logger.verbose(
|
|
@@ -470,27 +587,14 @@ export class Authority {
|
|
|
470
587
|
"Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache."
|
|
471
588
|
);
|
|
472
589
|
} else {
|
|
473
|
-
|
|
590
|
+
const hardcodedMetadata =
|
|
474
591
|
this.getEndpointMetadataFromHardcodedValues();
|
|
475
592
|
if (hardcodedMetadata) {
|
|
476
|
-
this.logger.verbose(
|
|
477
|
-
"Found endpoint metadata from hardcoded values."
|
|
478
|
-
);
|
|
479
|
-
// If the user prefers to use an azure region replace the global endpoints with regional information.
|
|
480
|
-
if (
|
|
481
|
-
this.authorityOptions.azureRegionConfiguration?.azureRegion
|
|
482
|
-
) {
|
|
483
|
-
hardcodedMetadata = await invokeAsync(
|
|
484
|
-
this.updateMetadataWithRegionalInformation.bind(this),
|
|
485
|
-
PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,
|
|
486
|
-
this.logger,
|
|
487
|
-
this.performanceClient,
|
|
488
|
-
this.correlationId
|
|
489
|
-
)(hardcodedMetadata);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
593
|
metadataEntity.updateEndpointMetadata(hardcodedMetadata, false);
|
|
493
|
-
return
|
|
594
|
+
return {
|
|
595
|
+
source: AuthorityMetadataSource.HARDCODED_VALUES,
|
|
596
|
+
metadata: hardcodedMetadata,
|
|
597
|
+
};
|
|
494
598
|
} else {
|
|
495
599
|
this.logger.verbose(
|
|
496
600
|
"Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache."
|
|
@@ -507,39 +611,12 @@ export class Authority {
|
|
|
507
611
|
) {
|
|
508
612
|
// No need to update
|
|
509
613
|
this.logger.verbose("Found endpoint metadata in the cache.");
|
|
510
|
-
return AuthorityMetadataSource.CACHE;
|
|
614
|
+
return { source: AuthorityMetadataSource.CACHE };
|
|
511
615
|
} else if (metadataEntityExpired) {
|
|
512
616
|
this.logger.verbose("The metadata entity is expired.");
|
|
513
617
|
}
|
|
514
618
|
|
|
515
|
-
|
|
516
|
-
this.getEndpointMetadataFromNetwork.bind(this),
|
|
517
|
-
PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork,
|
|
518
|
-
this.logger,
|
|
519
|
-
this.performanceClient,
|
|
520
|
-
this.correlationId
|
|
521
|
-
)();
|
|
522
|
-
if (metadata) {
|
|
523
|
-
// If the user prefers to use an azure region replace the global endpoints with regional information.
|
|
524
|
-
if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
|
|
525
|
-
metadata = await invokeAsync(
|
|
526
|
-
this.updateMetadataWithRegionalInformation.bind(this),
|
|
527
|
-
PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,
|
|
528
|
-
this.logger,
|
|
529
|
-
this.performanceClient,
|
|
530
|
-
this.correlationId
|
|
531
|
-
)(metadata);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
metadataEntity.updateEndpointMetadata(metadata, true);
|
|
535
|
-
return AuthorityMetadataSource.NETWORK;
|
|
536
|
-
} else {
|
|
537
|
-
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
538
|
-
throw createClientAuthError(
|
|
539
|
-
ClientAuthErrorCodes.openIdConfigError,
|
|
540
|
-
this.defaultOpenIdConfigurationEndpoint
|
|
541
|
-
);
|
|
542
|
-
}
|
|
619
|
+
return null;
|
|
543
620
|
}
|
|
544
621
|
|
|
545
622
|
/**
|
|
@@ -712,6 +789,35 @@ export class Authority {
|
|
|
712
789
|
PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata,
|
|
713
790
|
this.correlationId
|
|
714
791
|
);
|
|
792
|
+
const localMetadataSource =
|
|
793
|
+
this.updateCloudDiscoveryMetadataFromLocalSources(metadataEntity);
|
|
794
|
+
if (localMetadataSource) {
|
|
795
|
+
return localMetadataSource;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// Fallback to network as metadata source
|
|
799
|
+
const metadata = await invokeAsync(
|
|
800
|
+
this.getCloudDiscoveryMetadataFromNetwork.bind(this),
|
|
801
|
+
PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork,
|
|
802
|
+
this.logger,
|
|
803
|
+
this.performanceClient,
|
|
804
|
+
this.correlationId
|
|
805
|
+
)();
|
|
806
|
+
|
|
807
|
+
if (metadata) {
|
|
808
|
+
metadataEntity.updateCloudDiscoveryMetadata(metadata, true);
|
|
809
|
+
return AuthorityMetadataSource.NETWORK;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
813
|
+
throw createClientConfigurationError(
|
|
814
|
+
ClientConfigurationErrorCodes.untrustedAuthority
|
|
815
|
+
);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
private updateCloudDiscoveryMetadataFromLocalSources(
|
|
819
|
+
metadataEntity: AuthorityMetadataEntity
|
|
820
|
+
): AuthorityMetadataSource | null {
|
|
715
821
|
this.logger.verbose(
|
|
716
822
|
"Attempting to get cloud discovery metadata from authority configuration"
|
|
717
823
|
);
|
|
@@ -732,7 +838,7 @@ export class Authority {
|
|
|
732
838
|
metadataEntity.canonical_authority || Constants.NOT_APPLICABLE
|
|
733
839
|
}`
|
|
734
840
|
);
|
|
735
|
-
|
|
841
|
+
const metadata = this.getCloudDiscoveryMetadataFromConfig();
|
|
736
842
|
if (metadata) {
|
|
737
843
|
this.logger.verbose(
|
|
738
844
|
"Found cloud discovery metadata in authority configuration"
|
|
@@ -752,7 +858,9 @@ export class Authority {
|
|
|
752
858
|
);
|
|
753
859
|
} else {
|
|
754
860
|
const hardcodedMetadata =
|
|
755
|
-
|
|
861
|
+
getCloudDiscoveryMetadataFromHardcodedValues(
|
|
862
|
+
this.canonicalAuthority
|
|
863
|
+
);
|
|
756
864
|
if (hardcodedMetadata) {
|
|
757
865
|
this.logger.verbose(
|
|
758
866
|
"Found cloud discovery metadata from hardcoded values."
|
|
@@ -782,23 +890,7 @@ export class Authority {
|
|
|
782
890
|
this.logger.verbose("The metadata entity is expired.");
|
|
783
891
|
}
|
|
784
892
|
|
|
785
|
-
|
|
786
|
-
this.getCloudDiscoveryMetadataFromNetwork.bind(this),
|
|
787
|
-
PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork,
|
|
788
|
-
this.logger,
|
|
789
|
-
this.performanceClient,
|
|
790
|
-
this.correlationId
|
|
791
|
-
)();
|
|
792
|
-
|
|
793
|
-
if (metadata) {
|
|
794
|
-
metadataEntity.updateCloudDiscoveryMetadata(metadata, true);
|
|
795
|
-
return AuthorityMetadataSource.NETWORK;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
799
|
-
throw createClientConfigurationError(
|
|
800
|
-
ClientConfigurationErrorCodes.untrustedAuthority
|
|
801
|
-
);
|
|
893
|
+
return null;
|
|
802
894
|
}
|
|
803
895
|
|
|
804
896
|
/**
|
|
@@ -827,11 +919,10 @@ export class Authority {
|
|
|
827
919
|
const parsedResponse = JSON.parse(
|
|
828
920
|
this.authorityOptions.cloudDiscoveryMetadata
|
|
829
921
|
) as CloudInstanceDiscoveryResponse;
|
|
830
|
-
const metadata =
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
);
|
|
922
|
+
const metadata = getCloudDiscoveryMetadataFromNetworkResponse(
|
|
923
|
+
parsedResponse.metadata,
|
|
924
|
+
this.hostnameAndPort
|
|
925
|
+
);
|
|
835
926
|
this.logger.verbose("Parsed the cloud discovery metadata.");
|
|
836
927
|
if (metadata) {
|
|
837
928
|
this.logger.verbose(
|
|
@@ -937,7 +1028,7 @@ export class Authority {
|
|
|
937
1028
|
this.logger.verbose(
|
|
938
1029
|
"Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."
|
|
939
1030
|
);
|
|
940
|
-
match =
|
|
1031
|
+
match = getCloudDiscoveryMetadataFromNetworkResponse(
|
|
941
1032
|
metadata,
|
|
942
1033
|
this.hostnameAndPort
|
|
943
1034
|
);
|
|
@@ -972,24 +1063,6 @@ export class Authority {
|
|
|
972
1063
|
return match;
|
|
973
1064
|
}
|
|
974
1065
|
|
|
975
|
-
/**
|
|
976
|
-
* Get cloud discovery metadata for common authorities
|
|
977
|
-
*/
|
|
978
|
-
private getCloudDiscoveryMetadataFromHardcodedValues(): CloudDiscoveryMetadata | null {
|
|
979
|
-
if (this.canonicalAuthority in InstanceDiscoveryMetadata) {
|
|
980
|
-
const hardcodedMetadataResponse =
|
|
981
|
-
InstanceDiscoveryMetadata[this.canonicalAuthority];
|
|
982
|
-
const metadata =
|
|
983
|
-
Authority.getCloudDiscoveryMetadataFromNetworkResponse(
|
|
984
|
-
hardcodedMetadataResponse.metadata,
|
|
985
|
-
this.hostnameAndPort
|
|
986
|
-
);
|
|
987
|
-
return metadata;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
return null;
|
|
991
|
-
}
|
|
992
|
-
|
|
993
1066
|
/**
|
|
994
1067
|
* Helper function to determine if this host is included in the knownAuthorities config option
|
|
995
1068
|
*/
|
|
@@ -1046,30 +1119,13 @@ export class Authority {
|
|
|
1046
1119
|
};
|
|
1047
1120
|
}
|
|
1048
1121
|
|
|
1049
|
-
/**
|
|
1050
|
-
* Searches instance discovery network response for the entry that contains the host in the aliases list
|
|
1051
|
-
* @param response
|
|
1052
|
-
* @param authority
|
|
1053
|
-
*/
|
|
1054
|
-
static getCloudDiscoveryMetadataFromNetworkResponse(
|
|
1055
|
-
response: CloudDiscoveryMetadata[],
|
|
1056
|
-
authority: string
|
|
1057
|
-
): CloudDiscoveryMetadata | null {
|
|
1058
|
-
for (let i = 0; i < response.length; i++) {
|
|
1059
|
-
const metadata = response[i];
|
|
1060
|
-
if (metadata.aliases.indexOf(authority) > -1) {
|
|
1061
|
-
return metadata;
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
return null;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
1122
|
/**
|
|
1069
1123
|
* helper function to generate environment from authority object
|
|
1070
1124
|
*/
|
|
1071
1125
|
getPreferredCache(): string {
|
|
1072
|
-
if (this.
|
|
1126
|
+
if (this.managedIdentity) {
|
|
1127
|
+
return Constants.DEFAULT_AUTHORITY_HOST;
|
|
1128
|
+
} else if (this.discoveryComplete()) {
|
|
1073
1129
|
return this.metadata.preferred_cache;
|
|
1074
1130
|
} else {
|
|
1075
1131
|
throw createClientAuthError(
|
|
@@ -1184,9 +1240,7 @@ export class Authority {
|
|
|
1184
1240
|
* @param authority
|
|
1185
1241
|
*/
|
|
1186
1242
|
static transformCIAMAuthority(authority: string): string {
|
|
1187
|
-
let ciamAuthority = authority
|
|
1188
|
-
? authority
|
|
1189
|
-
: `${authority}${Constants.FORWARD_SLASH}`;
|
|
1243
|
+
let ciamAuthority = authority;
|
|
1190
1244
|
const authorityUrl = new UrlString(authority);
|
|
1191
1245
|
const authorityUrlComponents = authorityUrl.getUrlComponents();
|
|
1192
1246
|
|
|
@@ -1205,3 +1259,35 @@ export class Authority {
|
|
|
1205
1259
|
return ciamAuthority;
|
|
1206
1260
|
}
|
|
1207
1261
|
}
|
|
1262
|
+
|
|
1263
|
+
export function formatAuthorityUri(authorityUri: string): string {
|
|
1264
|
+
return authorityUri.endsWith(Constants.FORWARD_SLASH)
|
|
1265
|
+
? authorityUri
|
|
1266
|
+
: `${authorityUri}${Constants.FORWARD_SLASH}`;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
export function buildStaticAuthorityOptions(
|
|
1270
|
+
authOptions: Partial<AuthorityOptions>
|
|
1271
|
+
): StaticAuthorityOptions {
|
|
1272
|
+
const rawCloudDiscoveryMetadata = authOptions.cloudDiscoveryMetadata;
|
|
1273
|
+
let cloudDiscoveryMetadata: CloudDiscoveryMetadata[] | undefined =
|
|
1274
|
+
undefined;
|
|
1275
|
+
if (rawCloudDiscoveryMetadata) {
|
|
1276
|
+
try {
|
|
1277
|
+
cloudDiscoveryMetadata = JSON.parse(
|
|
1278
|
+
rawCloudDiscoveryMetadata
|
|
1279
|
+
).metadata;
|
|
1280
|
+
} catch (e) {
|
|
1281
|
+
throw createClientConfigurationError(
|
|
1282
|
+
ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata
|
|
1283
|
+
);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
return {
|
|
1287
|
+
canonicalAuthority: authOptions.authority
|
|
1288
|
+
? formatAuthorityUri(authOptions.authority)
|
|
1289
|
+
: undefined,
|
|
1290
|
+
knownAuthorities: authOptions.knownAuthorities,
|
|
1291
|
+
cloudDiscoveryMetadata: cloudDiscoveryMetadata,
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Authority } from "./Authority";
|
|
6
|
+
import { Authority, formatAuthorityUri } from "./Authority";
|
|
7
7
|
import {
|
|
8
8
|
createClientConfigurationError,
|
|
9
9
|
ClientConfigurationErrorCodes,
|
|
@@ -45,9 +45,9 @@ export class AuthorityFactory {
|
|
|
45
45
|
PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,
|
|
46
46
|
correlationId
|
|
47
47
|
);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const authorityUriFinal = Authority.transformCIAMAuthority(
|
|
49
|
+
formatAuthorityUri(authorityUri)
|
|
50
|
+
);
|
|
51
51
|
|
|
52
52
|
// Initialize authority and perform discovery endpoint check.
|
|
53
53
|
const acquireTokenAuthority: Authority =
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { UrlString } from "../url/UrlString";
|
|
7
|
+
import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
|
|
8
|
+
|
|
6
9
|
export const rawMetdataJSON = {
|
|
7
10
|
endpointMetadata: {
|
|
8
11
|
"https://login.microsoftonline.com/common/": {
|
|
@@ -951,3 +954,87 @@ for (const key in InstanceDiscoveryMetadata) {
|
|
|
951
954
|
}
|
|
952
955
|
}
|
|
953
956
|
}
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Returns aliases for the given canonical authority if found in hardcoded Instance Discovery Metadata or null if not found
|
|
960
|
+
* @param canonicalAuthority
|
|
961
|
+
* @returns
|
|
962
|
+
*/
|
|
963
|
+
export function getHardcodedAliasesForCanonicalAuthority(
|
|
964
|
+
canonicalAuthority?: string
|
|
965
|
+
): string[] | null {
|
|
966
|
+
if (canonicalAuthority) {
|
|
967
|
+
const instanceDiscoveryMetadata =
|
|
968
|
+
getCloudDiscoveryMetadataFromHardcodedValues(canonicalAuthority);
|
|
969
|
+
if (instanceDiscoveryMetadata) {
|
|
970
|
+
return instanceDiscoveryMetadata.aliases;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
return null;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Returns aliases for from the raw cloud discovery metadata given in configuration or null if no configuration was provided
|
|
978
|
+
* @param rawCloudDiscoveryMetadata
|
|
979
|
+
* @returns
|
|
980
|
+
*/
|
|
981
|
+
export function getAliasesFromConfigMetadata(
|
|
982
|
+
canonicalAuthority?: string,
|
|
983
|
+
cloudDiscoveryMetadata?: CloudDiscoveryMetadata[]
|
|
984
|
+
): string[] | null {
|
|
985
|
+
if (canonicalAuthority && cloudDiscoveryMetadata) {
|
|
986
|
+
const canonicalAuthorityUrlComponents = new UrlString(
|
|
987
|
+
canonicalAuthority
|
|
988
|
+
).getUrlComponents();
|
|
989
|
+
const metadata = getCloudDiscoveryMetadataFromNetworkResponse(
|
|
990
|
+
cloudDiscoveryMetadata,
|
|
991
|
+
canonicalAuthorityUrlComponents.HostNameAndPort
|
|
992
|
+
);
|
|
993
|
+
|
|
994
|
+
if (metadata) {
|
|
995
|
+
return metadata.aliases;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
return null;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Searches instance discovery network response for the entry that contains the host in the aliases list
|
|
1004
|
+
* @param response
|
|
1005
|
+
* @param authority
|
|
1006
|
+
*/
|
|
1007
|
+
export function getCloudDiscoveryMetadataFromNetworkResponse(
|
|
1008
|
+
response: CloudDiscoveryMetadata[],
|
|
1009
|
+
authority: string
|
|
1010
|
+
): CloudDiscoveryMetadata | null {
|
|
1011
|
+
for (let i = 0; i < response.length; i++) {
|
|
1012
|
+
const metadata = response[i];
|
|
1013
|
+
if (metadata.aliases.includes(authority)) {
|
|
1014
|
+
return metadata;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
return null;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Get cloud discovery metadata for common authorities
|
|
1023
|
+
*/
|
|
1024
|
+
export function getCloudDiscoveryMetadataFromHardcodedValues(
|
|
1025
|
+
canonicalAuthority: string
|
|
1026
|
+
): CloudDiscoveryMetadata | null {
|
|
1027
|
+
const canonicalAuthorityUrlComponents = new UrlString(
|
|
1028
|
+
canonicalAuthority
|
|
1029
|
+
).getUrlComponents();
|
|
1030
|
+
|
|
1031
|
+
if (canonicalAuthority in InstanceDiscoveryMetadata) {
|
|
1032
|
+
const metadata = getCloudDiscoveryMetadataFromNetworkResponse(
|
|
1033
|
+
InstanceDiscoveryMetadata[canonicalAuthority].metadata,
|
|
1034
|
+
canonicalAuthorityUrlComponents.HostNameAndPort
|
|
1035
|
+
);
|
|
1036
|
+
return metadata;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
return null;
|
|
1040
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { ProtocolMode } from "./ProtocolMode";
|
|
7
7
|
import { OIDCOptions } from "./OIDCOptions";
|
|
8
8
|
import { AzureRegionConfiguration } from "./AzureRegionConfiguration";
|
|
9
|
+
import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
|
|
9
10
|
|
|
10
11
|
export type AuthorityOptions = {
|
|
11
12
|
protocolMode: ProtocolMode;
|
|
@@ -15,6 +16,14 @@ export type AuthorityOptions = {
|
|
|
15
16
|
authorityMetadata: string;
|
|
16
17
|
skipAuthorityMetadataCache?: boolean;
|
|
17
18
|
azureRegionConfiguration?: AzureRegionConfiguration;
|
|
19
|
+
authority?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type StaticAuthorityOptions = Partial<
|
|
23
|
+
Pick<AuthorityOptions, "knownAuthorities">
|
|
24
|
+
> & {
|
|
25
|
+
canonicalAuthority?: string;
|
|
26
|
+
cloudDiscoveryMetadata?: CloudDiscoveryMetadata[];
|
|
18
27
|
};
|
|
19
28
|
|
|
20
29
|
export const AzureCloudInstance = {
|