@azure/msal-common 15.13.0 → 16.0.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 +0 -4
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AccountInfo.mjs.map +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/CcsCredential.mjs.map +1 -1
- package/dist/account/ClientInfo.d.ts +1 -5
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +4 -6
- package/dist/account/ClientInfo.mjs.map +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/account/TokenClaims.mjs.map +1 -1
- package/dist/authority/Authority.d.ts +2 -2
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +89 -105
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +6 -2
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +8 -5
- package/dist/authority/AuthorityFactory.mjs.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +2 -2
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +8 -8
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +0 -1
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs.map +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/AuthorityType.mjs.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OIDCOptions.d.ts +2 -2
- package/dist/authority/OIDCOptions.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs.map +1 -1
- package/dist/authority/RegionDiscovery.d.ts +3 -3
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +14 -15
- package/dist/authority/RegionDiscovery.mjs.map +1 -1
- package/dist/cache/CacheManager.d.ts +25 -17
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +69 -80
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +4 -57
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +0 -2
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +41 -12
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs.map +1 -1
- package/dist/cache/utils/AccountEntityUtils.d.ts +60 -0
- package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/dist/cache/utils/AccountEntityUtils.mjs +212 -0
- package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -0
- package/dist/cache/utils/CacheHelpers.d.ts +2 -2
- package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +10 -13
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +0 -1
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +16 -20
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +3 -3
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +7 -12
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +22 -27
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +8 -12
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +2 -22
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +9 -15
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.d.ts +5 -3
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +2 -2
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +3 -5
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.d.ts +1 -18
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +12 -34
- package/dist/error/AuthError.mjs.map +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.d.ts +1 -6
- package/dist/error/CacheError.d.ts.map +1 -1
- package/dist/error/CacheError.mjs +6 -13
- package/dist/error/CacheError.mjs.map +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.d.ts +0 -224
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +3 -235
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +0 -8
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +2 -10
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +0 -123
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +3 -129
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +3 -5
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +1 -19
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +10 -35
- package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.d.ts +0 -4
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.mjs +3 -8
- package/dist/error/JoseHeaderError.mjs.map +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/NetworkError.mjs.map +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/error/ServerError.mjs.map +1 -1
- package/dist/exports-browser-only.d.ts +4 -3
- package/dist/exports-browser-only.d.ts.map +1 -1
- package/dist/exports-common.d.ts +8 -6
- package/dist/exports-common.d.ts.map +1 -1
- package/dist/exports-node-only.d.ts +1 -4
- package/dist/exports-node-only.d.ts.map +1 -1
- package/dist/index-browser.mjs +12 -8
- package/dist/index-browser.mjs.map +1 -1
- package/dist/index-node.mjs +10 -7
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.d.ts +12 -13
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +16 -21
- package/dist/logger/Logger.mjs.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/INetworkModule.mjs.map +1 -1
- package/dist/network/RequestThumbprint.mjs +1 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +6 -7
- package/dist/network/ThrottlingUtils.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.d.ts +1 -2
- package/dist/protocol/Authorize.d.ts.map +1 -1
- package/dist/protocol/Authorize.mjs +14 -14
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +3 -3
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +1 -7
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +3 -9
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +7 -20
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +5 -5
- package/dist/request/ScopeSet.mjs.map +1 -1
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +6 -5
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +39 -41
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +1 -31
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +6 -85
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +28 -188
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +0 -282
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +2 -483
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvents.d.ts +65 -0
- package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs +73 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs.map +1 -0
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +2 -26
- package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +28 -30
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.d.ts +0 -5
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +5 -13
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +81 -117
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -131
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.d.ts +2 -2
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +19 -20
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +7 -7
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs.map +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs.map +1 -1
- package/dist/utils/UrlUtils.d.ts +1 -2
- package/dist/utils/UrlUtils.d.ts.map +1 -1
- package/dist/utils/UrlUtils.mjs +3 -10
- package/dist/utils/UrlUtils.mjs.map +1 -1
- package/lib/index-browser.cjs +29 -222
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-D8Iaiqq3.js → index-node-FrCFfFuh.js} +1606 -2493
- package/lib/index-node-FrCFfFuh.js.map +1 -0
- package/lib/index-node.cjs +4 -33
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +3 -33
- package/lib/index.cjs.map +1 -1
- package/lib/types/account/AccountInfo.d.ts +0 -4
- package/lib/types/account/AccountInfo.d.ts.map +1 -1
- package/lib/types/account/ClientInfo.d.ts +1 -5
- package/lib/types/account/ClientInfo.d.ts.map +1 -1
- package/lib/types/authority/Authority.d.ts +2 -2
- package/lib/types/authority/Authority.d.ts.map +1 -1
- package/lib/types/authority/AuthorityFactory.d.ts +6 -2
- package/lib/types/authority/AuthorityFactory.d.ts.map +1 -1
- package/lib/types/authority/AuthorityMetadata.d.ts +2 -2
- package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -1
- package/lib/types/authority/AuthorityOptions.d.ts +0 -1
- package/lib/types/authority/AuthorityOptions.d.ts.map +1 -1
- package/lib/types/authority/OIDCOptions.d.ts +2 -2
- package/lib/types/authority/OIDCOptions.d.ts.map +1 -1
- package/lib/types/authority/RegionDiscovery.d.ts +3 -3
- package/lib/types/authority/RegionDiscovery.d.ts.map +1 -1
- package/lib/types/cache/CacheManager.d.ts +25 -17
- package/lib/types/cache/CacheManager.d.ts.map +1 -1
- package/lib/types/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/AccountEntity.d.ts +4 -57
- package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/CredentialEntity.d.ts +0 -2
- package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/lib/types/cache/interface/ICacheManager.d.ts +41 -12
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/cache/utils/AccountEntityUtils.d.ts +60 -0
- package/lib/types/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/lib/types/cache/utils/CacheHelpers.d.ts +2 -2
- package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/lib/types/cache/utils/CacheTypes.d.ts +0 -1
- package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/client/BaseClient.d.ts +3 -3
- package/lib/types/client/BaseClient.d.ts.map +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/lib/types/client/SilentFlowClient.d.ts +1 -1
- package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
- package/lib/types/config/ClientConfiguration.d.ts +2 -22
- package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
- package/lib/types/crypto/ICrypto.d.ts +5 -3
- package/lib/types/crypto/ICrypto.d.ts.map +1 -1
- package/lib/types/crypto/PopTokenGenerator.d.ts +2 -2
- package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/lib/types/error/AuthError.d.ts +1 -18
- package/lib/types/error/AuthError.d.ts.map +1 -1
- package/lib/types/error/CacheError.d.ts +1 -6
- package/lib/types/error/CacheError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthError.d.ts +0 -224
- package/lib/types/error/ClientAuthError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthErrorCodes.d.ts +0 -8
- package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationError.d.ts +0 -123
- package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/lib/types/error/InteractionRequiredAuthError.d.ts +1 -19
- package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/lib/types/error/JoseHeaderError.d.ts +0 -4
- package/lib/types/error/JoseHeaderError.d.ts.map +1 -1
- package/lib/types/exports-browser-only.d.ts +4 -3
- package/lib/types/exports-browser-only.d.ts.map +1 -1
- package/lib/types/exports-common.d.ts +8 -6
- package/lib/types/exports-common.d.ts.map +1 -1
- package/lib/types/exports-node-only.d.ts +1 -4
- package/lib/types/exports-node-only.d.ts.map +1 -1
- package/lib/types/logger/Logger.d.ts +12 -13
- package/lib/types/logger/Logger.d.ts.map +1 -1
- package/lib/types/network/ThrottlingUtils.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/protocol/Authorize.d.ts +1 -2
- package/lib/types/protocol/Authorize.d.ts.map +1 -1
- package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/lib/types/request/BaseAuthRequest.d.ts +1 -7
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/lib/types/request/RequestParameterBuilder.d.ts +3 -9
- package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -1
- package/lib/types/response/AuthenticationResult.d.ts +1 -1
- package/lib/types/response/AuthenticationResult.d.ts.map +1 -1
- package/lib/types/response/ResponseHandler.d.ts +6 -5
- package/lib/types/response/ResponseHandler.d.ts.map +1 -1
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts +1 -31
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +6 -85
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +0 -282
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts +65 -0
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/lib/types/url/UrlString.d.ts +0 -5
- package/lib/types/url/UrlString.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +81 -117
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/lib/types/utils/FunctionWrappers.d.ts +2 -2
- package/lib/types/utils/FunctionWrappers.d.ts.map +1 -1
- package/lib/types/utils/UrlUtils.d.ts +1 -2
- package/lib/types/utils/UrlUtils.d.ts.map +1 -1
- package/package.json +120 -122
- package/src/account/AccountInfo.ts +0 -6
- package/src/account/ClientInfo.ts +4 -11
- package/src/authority/Authority.ts +145 -146
- package/src/authority/AuthorityFactory.ts +7 -7
- package/src/authority/AuthorityMetadata.ts +21 -12
- package/src/authority/AuthorityOptions.ts +0 -1
- package/src/authority/OIDCOptions.ts +2 -2
- package/src/authority/RegionDiscovery.ts +20 -33
- package/src/cache/CacheManager.ts +176 -126
- package/src/cache/entities/AccessTokenEntity.ts +0 -4
- package/src/cache/entities/AccountEntity.ts +4 -293
- package/src/cache/entities/CredentialEntity.ts +0 -2
- package/src/cache/interface/ICacheManager.ts +61 -15
- package/src/cache/utils/AccountEntityUtils.ts +287 -0
- package/src/cache/utils/CacheHelpers.ts +23 -37
- package/src/cache/utils/CacheTypes.ts +0 -1
- package/src/client/AuthorizationCodeClient.ts +28 -49
- package/src/client/BaseClient.ts +8 -20
- package/src/client/RefreshTokenClient.ts +29 -61
- package/src/client/SilentFlowClient.ts +11 -20
- package/src/config/ClientConfiguration.ts +9 -37
- package/src/crypto/ICrypto.ts +5 -3
- package/src/crypto/PopTokenGenerator.ts +3 -13
- package/src/error/AuthError.ts +11 -30
- package/src/error/CacheError.ts +4 -15
- package/src/error/ClientAuthError.ts +1 -311
- package/src/error/ClientAuthErrorCodes.ts +0 -8
- package/src/error/ClientConfigurationError.ts +1 -194
- package/src/error/ClientConfigurationErrorCodes.ts +0 -3
- package/src/error/InteractionRequiredAuthError.ts +8 -48
- package/src/error/JoseHeaderError.ts +1 -8
- package/src/exports-browser-only.ts +2 -6
- package/src/exports-common.ts +4 -34
- package/src/exports-node-only.ts +1 -4
- package/src/logger/Logger.ts +26 -39
- package/src/network/ThrottlingUtils.ts +12 -15
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +24 -20
- package/src/request/AuthenticationHeaderParser.ts +2 -4
- package/src/request/BaseAuthRequest.ts +1 -7
- package/src/request/RequestParameterBuilder.ts +30 -45
- package/src/request/ScopeSet.ts +4 -4
- package/src/response/AuthenticationResult.ts +1 -1
- package/src/response/ResponseHandler.ts +53 -58
- package/src/telemetry/performance/IPerformanceClient.ts +1 -43
- package/src/telemetry/performance/PerformanceClient.ts +32 -295
- package/src/telemetry/performance/PerformanceEvent.ts +0 -586
- package/src/telemetry/performance/PerformanceEvents.ts +97 -0
- package/src/telemetry/performance/StubPerformanceClient.ts +0 -16
- package/src/telemetry/server/ServerTelemetryManager.ts +33 -44
- package/src/url/UrlString.ts +3 -12
- package/src/utils/Constants.ts +103 -146
- package/src/utils/FunctionWrappers.ts +28 -29
- package/src/utils/ProtocolUtils.ts +6 -6
- package/src/utils/UrlUtils.ts +2 -15
- package/dist/cache/entities/AccountEntity.mjs +0 -232
- package/dist/cache/entities/AccountEntity.mjs.map +0 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +0 -18
- package/dist/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/lib/index-node-D8Iaiqq3.js.map +0 -1
- package/lib/types/request/CommonClientCredentialRequest.d.ts +0 -18
- package/lib/types/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/lib/types/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/src/request/CommonClientCredentialRequest.ts +0 -23
- package/src/request/CommonDeviceCodeRequest.ts +0 -31
- package/src/request/CommonOnBehalfOfRequest.ts +0 -19
- package/src/request/CommonUsernamePasswordRequest.ts +0 -23
|
@@ -7,18 +7,14 @@ import {
|
|
|
7
7
|
createClientAuthError,
|
|
8
8
|
ClientAuthErrorCodes,
|
|
9
9
|
} from "../error/ClientAuthError.js";
|
|
10
|
-
import
|
|
10
|
+
import * as Constants from "../utils/Constants.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Client info object which consists of
|
|
14
|
-
* uid: user id
|
|
15
|
-
* utid: tenant id
|
|
16
|
-
* xms_tdbr: optional, only for non-US tenants
|
|
13
|
+
* Client info object which consists of two IDs. Need to add more info here.
|
|
17
14
|
*/
|
|
18
15
|
export type ClientInfo = {
|
|
19
16
|
uid: string;
|
|
20
17
|
utid: string;
|
|
21
|
-
xms_tdbr?: string;
|
|
22
18
|
};
|
|
23
19
|
|
|
24
20
|
/**
|
|
@@ -57,14 +53,11 @@ export function buildClientInfoFromHomeAccountId(
|
|
|
57
53
|
);
|
|
58
54
|
}
|
|
59
55
|
const clientInfoParts: string[] = homeAccountId.split(
|
|
60
|
-
|
|
56
|
+
Constants.CLIENT_INFO_SEPARATOR,
|
|
61
57
|
2
|
|
62
58
|
);
|
|
63
59
|
return {
|
|
64
60
|
uid: clientInfoParts[0],
|
|
65
|
-
utid:
|
|
66
|
-
clientInfoParts.length < 2
|
|
67
|
-
? Constants.EMPTY_STRING
|
|
68
|
-
: clientInfoParts[1],
|
|
61
|
+
utid: clientInfoParts.length < 2 ? "" : clientInfoParts[1],
|
|
69
62
|
};
|
|
70
63
|
}
|
|
@@ -15,12 +15,7 @@ import {
|
|
|
15
15
|
ClientAuthErrorCodes,
|
|
16
16
|
} from "../error/ClientAuthError.js";
|
|
17
17
|
import { INetworkModule } from "../network/INetworkModule.js";
|
|
18
|
-
import
|
|
19
|
-
AADAuthorityConstants,
|
|
20
|
-
AuthorityMetadataSource,
|
|
21
|
-
Constants,
|
|
22
|
-
RegionDiscoveryOutcomes,
|
|
23
|
-
} from "../utils/Constants.js";
|
|
18
|
+
import * as Constants from "../utils/Constants.js";
|
|
24
19
|
import {
|
|
25
20
|
EndpointMetadata,
|
|
26
21
|
getCloudDiscoveryMetadataFromHardcodedValues,
|
|
@@ -55,7 +50,7 @@ import type { AzureCloudOptions } from "../config/ClientConfiguration.js";
|
|
|
55
50
|
import { Logger } from "../logger/Logger.js";
|
|
56
51
|
import { AuthError } from "../error/AuthError.js";
|
|
57
52
|
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
|
|
58
|
-
import
|
|
53
|
+
import * as PerformanceEvents from "../telemetry/performance/PerformanceEvents.js";
|
|
59
54
|
import { invokeAsync } from "../utils/FunctionWrappers.js";
|
|
60
55
|
import * as CacheHelpers from "../cache/utils/CacheHelpers.js";
|
|
61
56
|
|
|
@@ -84,7 +79,7 @@ export class Authority {
|
|
|
84
79
|
// Logger object
|
|
85
80
|
private logger: Logger;
|
|
86
81
|
// Performance client
|
|
87
|
-
protected performanceClient: IPerformanceClient
|
|
82
|
+
protected performanceClient: IPerformanceClient;
|
|
88
83
|
// Correlation Id
|
|
89
84
|
protected correlationId: string;
|
|
90
85
|
// Indicates if the authority is fake, for the purpose of a Managed Identity Application
|
|
@@ -93,9 +88,9 @@ export class Authority {
|
|
|
93
88
|
private static reservedTenantDomains: Set<string> = new Set([
|
|
94
89
|
"{tenant}",
|
|
95
90
|
"{tenantid}",
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
Constants.AADAuthority.COMMON,
|
|
92
|
+
Constants.AADAuthority.CONSUMERS,
|
|
93
|
+
Constants.AADAuthority.ORGANIZATIONS,
|
|
99
94
|
]);
|
|
100
95
|
|
|
101
96
|
constructor(
|
|
@@ -105,7 +100,7 @@ export class Authority {
|
|
|
105
100
|
authorityOptions: AuthorityOptions,
|
|
106
101
|
logger: Logger,
|
|
107
102
|
correlationId: string,
|
|
108
|
-
performanceClient
|
|
103
|
+
performanceClient: IPerformanceClient,
|
|
109
104
|
managedIdentity?: boolean
|
|
110
105
|
) {
|
|
111
106
|
this.canonicalAuthority = authority;
|
|
@@ -354,7 +349,8 @@ export class Authority {
|
|
|
354
349
|
*/
|
|
355
350
|
if (cachedPart !== tenantId) {
|
|
356
351
|
this.logger.verbose(
|
|
357
|
-
`Replacing tenant domain name ${cachedPart} with id ${tenantId}
|
|
352
|
+
`Replacing tenant domain name '${cachedPart}' with id '${tenantId}'`,
|
|
353
|
+
this.correlationId
|
|
358
354
|
);
|
|
359
355
|
cachedPart = tenantId;
|
|
360
356
|
}
|
|
@@ -398,11 +394,6 @@ export class Authority {
|
|
|
398
394
|
* and the /authorize, /token and logout endpoints.
|
|
399
395
|
*/
|
|
400
396
|
public async resolveEndpointsAsync(): Promise<void> {
|
|
401
|
-
this.performanceClient?.addQueueMeasurement(
|
|
402
|
-
PerformanceEvents.AuthorityResolveEndpointsAsync,
|
|
403
|
-
this.correlationId
|
|
404
|
-
);
|
|
405
|
-
|
|
406
397
|
const metadataEntity = this.getCurrentMetadataEntity();
|
|
407
398
|
|
|
408
399
|
const cloudDiscoverySource = await invokeAsync(
|
|
@@ -442,7 +433,10 @@ export class Authority {
|
|
|
442
433
|
*/
|
|
443
434
|
private getCurrentMetadataEntity(): AuthorityMetadataEntity {
|
|
444
435
|
let metadataEntity: AuthorityMetadataEntity | null =
|
|
445
|
-
this.cacheManager.getAuthorityMetadataByAlias(
|
|
436
|
+
this.cacheManager.getAuthorityMetadataByAlias(
|
|
437
|
+
this.hostnameAndPort,
|
|
438
|
+
this.correlationId
|
|
439
|
+
);
|
|
446
440
|
|
|
447
441
|
if (!metadataEntity) {
|
|
448
442
|
metadataEntity = {
|
|
@@ -472,15 +466,16 @@ export class Authority {
|
|
|
472
466
|
*/
|
|
473
467
|
private updateCachedMetadata(
|
|
474
468
|
metadataEntity: AuthorityMetadataEntity,
|
|
475
|
-
cloudDiscoverySource: AuthorityMetadataSource | null,
|
|
469
|
+
cloudDiscoverySource: Constants.AuthorityMetadataSource | null,
|
|
476
470
|
endpointMetadataResult: {
|
|
477
|
-
source: AuthorityMetadataSource;
|
|
471
|
+
source: Constants.AuthorityMetadataSource;
|
|
478
472
|
metadata?: OpenIdConfigResponse;
|
|
479
473
|
} | null
|
|
480
474
|
): void {
|
|
481
475
|
if (
|
|
482
|
-
cloudDiscoverySource !== AuthorityMetadataSource.CACHE &&
|
|
483
|
-
endpointMetadataResult?.source !==
|
|
476
|
+
cloudDiscoverySource !== Constants.AuthorityMetadataSource.CACHE &&
|
|
477
|
+
endpointMetadataResult?.source !==
|
|
478
|
+
Constants.AuthorityMetadataSource.CACHE
|
|
484
479
|
) {
|
|
485
480
|
// Reset the expiration time unless both values came from a successful cache lookup
|
|
486
481
|
metadataEntity.expiresAt =
|
|
@@ -489,9 +484,14 @@ export class Authority {
|
|
|
489
484
|
}
|
|
490
485
|
|
|
491
486
|
const cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(
|
|
492
|
-
metadataEntity.preferred_cache
|
|
487
|
+
metadataEntity.preferred_cache,
|
|
488
|
+
this.correlationId
|
|
489
|
+
);
|
|
490
|
+
this.cacheManager.setAuthorityMetadata(
|
|
491
|
+
cacheKey,
|
|
492
|
+
metadataEntity,
|
|
493
|
+
this.correlationId
|
|
493
494
|
);
|
|
494
|
-
this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);
|
|
495
495
|
this.metadata = metadataEntity;
|
|
496
496
|
}
|
|
497
497
|
|
|
@@ -501,12 +501,7 @@ export class Authority {
|
|
|
501
501
|
*/
|
|
502
502
|
private async updateEndpointMetadata(
|
|
503
503
|
metadataEntity: AuthorityMetadataEntity
|
|
504
|
-
): Promise<AuthorityMetadataSource> {
|
|
505
|
-
this.performanceClient?.addQueueMeasurement(
|
|
506
|
-
PerformanceEvents.AuthorityUpdateEndpointMetadata,
|
|
507
|
-
this.correlationId
|
|
508
|
-
);
|
|
509
|
-
|
|
504
|
+
): Promise<Constants.AuthorityMetadataSource> {
|
|
510
505
|
const localMetadata =
|
|
511
506
|
this.updateEndpointMetadataFromLocalSources(metadataEntity);
|
|
512
507
|
|
|
@@ -514,7 +509,7 @@ export class Authority {
|
|
|
514
509
|
if (localMetadata) {
|
|
515
510
|
if (
|
|
516
511
|
localMetadata.source ===
|
|
517
|
-
AuthorityMetadataSource.HARDCODED_VALUES
|
|
512
|
+
Constants.AuthorityMetadataSource.HARDCODED_VALUES
|
|
518
513
|
) {
|
|
519
514
|
// If the user prefers to use an azure region replace the global endpoints with regional information.
|
|
520
515
|
if (
|
|
@@ -568,7 +563,7 @@ export class Authority {
|
|
|
568
563
|
metadata,
|
|
569
564
|
true
|
|
570
565
|
);
|
|
571
|
-
return AuthorityMetadataSource.NETWORK;
|
|
566
|
+
return Constants.AuthorityMetadataSource.NETWORK;
|
|
572
567
|
} else {
|
|
573
568
|
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
574
569
|
throw createClientAuthError(
|
|
@@ -587,16 +582,18 @@ export class Authority {
|
|
|
587
582
|
private updateEndpointMetadataFromLocalSources(
|
|
588
583
|
metadataEntity: AuthorityMetadataEntity
|
|
589
584
|
): {
|
|
590
|
-
source: AuthorityMetadataSource;
|
|
585
|
+
source: Constants.AuthorityMetadataSource;
|
|
591
586
|
metadata?: OpenIdConfigResponse;
|
|
592
587
|
} | null {
|
|
593
588
|
this.logger.verbose(
|
|
594
|
-
"Attempting to get endpoint metadata from authority configuration"
|
|
589
|
+
"Attempting to get endpoint metadata from authority configuration",
|
|
590
|
+
this.correlationId
|
|
595
591
|
);
|
|
596
592
|
const configMetadata = this.getEndpointMetadataFromConfig();
|
|
597
593
|
if (configMetadata) {
|
|
598
594
|
this.logger.verbose(
|
|
599
|
-
"Found endpoint metadata in authority configuration"
|
|
595
|
+
"Found endpoint metadata in authority configuration",
|
|
596
|
+
this.correlationId
|
|
600
597
|
);
|
|
601
598
|
CacheHelpers.updateAuthorityEndpointMetadata(
|
|
602
599
|
metadataEntity,
|
|
@@ -604,37 +601,31 @@ export class Authority {
|
|
|
604
601
|
false
|
|
605
602
|
);
|
|
606
603
|
return {
|
|
607
|
-
source: AuthorityMetadataSource.CONFIG,
|
|
604
|
+
source: Constants.AuthorityMetadataSource.CONFIG,
|
|
608
605
|
};
|
|
609
606
|
}
|
|
610
607
|
|
|
611
608
|
this.logger.verbose(
|
|
612
|
-
"Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."
|
|
609
|
+
"Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",
|
|
610
|
+
this.correlationId
|
|
613
611
|
);
|
|
614
612
|
|
|
615
|
-
|
|
616
|
-
if (
|
|
617
|
-
|
|
618
|
-
|
|
613
|
+
const hardcodedMetadata = this.getEndpointMetadataFromHardcodedValues();
|
|
614
|
+
if (hardcodedMetadata) {
|
|
615
|
+
CacheHelpers.updateAuthorityEndpointMetadata(
|
|
616
|
+
metadataEntity,
|
|
617
|
+
hardcodedMetadata,
|
|
618
|
+
false
|
|
619
619
|
);
|
|
620
|
+
return {
|
|
621
|
+
source: Constants.AuthorityMetadataSource.HARDCODED_VALUES,
|
|
622
|
+
metadata: hardcodedMetadata,
|
|
623
|
+
};
|
|
620
624
|
} else {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
metadataEntity,
|
|
626
|
-
hardcodedMetadata,
|
|
627
|
-
false
|
|
628
|
-
);
|
|
629
|
-
return {
|
|
630
|
-
source: AuthorityMetadataSource.HARDCODED_VALUES,
|
|
631
|
-
metadata: hardcodedMetadata,
|
|
632
|
-
};
|
|
633
|
-
} else {
|
|
634
|
-
this.logger.verbose(
|
|
635
|
-
"Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache."
|
|
636
|
-
);
|
|
637
|
-
}
|
|
625
|
+
this.logger.verbose(
|
|
626
|
+
"Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",
|
|
627
|
+
this.correlationId
|
|
628
|
+
);
|
|
638
629
|
}
|
|
639
630
|
|
|
640
631
|
// Check cached metadata entity expiration status
|
|
@@ -646,10 +637,10 @@ export class Authority {
|
|
|
646
637
|
!metadataEntityExpired
|
|
647
638
|
) {
|
|
648
639
|
// No need to update
|
|
649
|
-
this.logger.verbose("Found endpoint metadata in the cache.");
|
|
650
|
-
return { source: AuthorityMetadataSource.CACHE };
|
|
640
|
+
this.logger.verbose("Found endpoint metadata in the cache.", "");
|
|
641
|
+
return { source: Constants.AuthorityMetadataSource.CACHE };
|
|
651
642
|
} else if (metadataEntityExpired) {
|
|
652
|
-
this.logger.verbose("The metadata entity is expired.");
|
|
643
|
+
this.logger.verbose("The metadata entity is expired.", "");
|
|
653
644
|
}
|
|
654
645
|
|
|
655
646
|
return null;
|
|
@@ -700,11 +691,6 @@ export class Authority {
|
|
|
700
691
|
* @param hasHardcodedMetadata boolean
|
|
701
692
|
*/
|
|
702
693
|
private async getEndpointMetadataFromNetwork(): Promise<OpenIdConfigResponse | null> {
|
|
703
|
-
this.performanceClient?.addQueueMeasurement(
|
|
704
|
-
PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork,
|
|
705
|
-
this.correlationId
|
|
706
|
-
);
|
|
707
|
-
|
|
708
694
|
const options: ImdsOptions = {};
|
|
709
695
|
|
|
710
696
|
/*
|
|
@@ -715,7 +701,8 @@ export class Authority {
|
|
|
715
701
|
const openIdConfigurationEndpoint =
|
|
716
702
|
this.defaultOpenIdConfigurationEndpoint;
|
|
717
703
|
this.logger.verbose(
|
|
718
|
-
`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${openIdConfigurationEndpoint}
|
|
704
|
+
`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${openIdConfigurationEndpoint}'`,
|
|
705
|
+
this.correlationId
|
|
719
706
|
);
|
|
720
707
|
|
|
721
708
|
try {
|
|
@@ -729,13 +716,15 @@ export class Authority {
|
|
|
729
716
|
return response.body;
|
|
730
717
|
} else {
|
|
731
718
|
this.logger.verbose(
|
|
732
|
-
`Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration
|
|
719
|
+
`Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration`,
|
|
720
|
+
this.correlationId
|
|
733
721
|
);
|
|
734
722
|
return null;
|
|
735
723
|
}
|
|
736
724
|
} catch (e) {
|
|
737
725
|
this.logger.verbose(
|
|
738
|
-
`Authority.getEndpointMetadataFromNetwork: ${e}
|
|
726
|
+
`Authority.getEndpointMetadataFromNetwork: '${e}'`,
|
|
727
|
+
this.correlationId
|
|
739
728
|
);
|
|
740
729
|
return null;
|
|
741
730
|
}
|
|
@@ -759,11 +748,6 @@ export class Authority {
|
|
|
759
748
|
private async updateMetadataWithRegionalInformation(
|
|
760
749
|
metadata: OpenIdConfigResponse
|
|
761
750
|
): Promise<OpenIdConfigResponse> {
|
|
762
|
-
this.performanceClient?.addQueueMeasurement(
|
|
763
|
-
PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,
|
|
764
|
-
this.correlationId
|
|
765
|
-
);
|
|
766
|
-
|
|
767
751
|
const userConfiguredAzureRegion =
|
|
768
752
|
this.authorityOptions.azureRegionConfiguration?.azureRegion;
|
|
769
753
|
|
|
@@ -773,7 +757,7 @@ export class Authority {
|
|
|
773
757
|
Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
|
|
774
758
|
) {
|
|
775
759
|
this.regionDiscoveryMetadata.region_outcome =
|
|
776
|
-
RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
|
|
760
|
+
Constants.RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
|
|
777
761
|
this.regionDiscoveryMetadata.region_used =
|
|
778
762
|
userConfiguredAzureRegion;
|
|
779
763
|
return Authority.replaceWithRegionalInformation(
|
|
@@ -796,7 +780,7 @@ export class Authority {
|
|
|
796
780
|
|
|
797
781
|
if (autodetectedRegionName) {
|
|
798
782
|
this.regionDiscoveryMetadata.region_outcome =
|
|
799
|
-
RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL;
|
|
783
|
+
Constants.RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL;
|
|
800
784
|
this.regionDiscoveryMetadata.region_used =
|
|
801
785
|
autodetectedRegionName;
|
|
802
786
|
return Authority.replaceWithRegionalInformation(
|
|
@@ -806,7 +790,7 @@ export class Authority {
|
|
|
806
790
|
}
|
|
807
791
|
|
|
808
792
|
this.regionDiscoveryMetadata.region_outcome =
|
|
809
|
-
RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
|
|
793
|
+
Constants.RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
|
|
810
794
|
}
|
|
811
795
|
|
|
812
796
|
return metadata;
|
|
@@ -820,11 +804,7 @@ export class Authority {
|
|
|
820
804
|
*/
|
|
821
805
|
private async updateCloudDiscoveryMetadata(
|
|
822
806
|
metadataEntity: AuthorityMetadataEntity
|
|
823
|
-
): Promise<AuthorityMetadataSource> {
|
|
824
|
-
this.performanceClient?.addQueueMeasurement(
|
|
825
|
-
PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata,
|
|
826
|
-
this.correlationId
|
|
827
|
-
);
|
|
807
|
+
): Promise<Constants.AuthorityMetadataSource> {
|
|
828
808
|
const localMetadataSource =
|
|
829
809
|
this.updateCloudDiscoveryMetadataFromLocalSources(metadataEntity);
|
|
830
810
|
if (localMetadataSource) {
|
|
@@ -846,7 +826,7 @@ export class Authority {
|
|
|
846
826
|
metadata,
|
|
847
827
|
true
|
|
848
828
|
);
|
|
849
|
-
return AuthorityMetadataSource.NETWORK;
|
|
829
|
+
return Constants.AuthorityMetadataSource.NETWORK;
|
|
850
830
|
}
|
|
851
831
|
|
|
852
832
|
// Metadata could not be obtained from the config, cache, network or hardcoded values
|
|
@@ -857,71 +837,72 @@ export class Authority {
|
|
|
857
837
|
|
|
858
838
|
private updateCloudDiscoveryMetadataFromLocalSources(
|
|
859
839
|
metadataEntity: AuthorityMetadataEntity
|
|
860
|
-
): AuthorityMetadataSource | null {
|
|
840
|
+
): Constants.AuthorityMetadataSource | null {
|
|
861
841
|
this.logger.verbose(
|
|
862
|
-
"Attempting to get cloud discovery metadata from authority configuration"
|
|
842
|
+
"Attempting to get cloud discovery metadata from authority configuration",
|
|
843
|
+
this.correlationId
|
|
863
844
|
);
|
|
864
845
|
this.logger.verbosePii(
|
|
865
|
-
`Known Authorities: ${
|
|
846
|
+
`Known Authorities: '${
|
|
866
847
|
this.authorityOptions.knownAuthorities ||
|
|
867
848
|
Constants.NOT_APPLICABLE
|
|
868
|
-
}
|
|
849
|
+
}'`,
|
|
850
|
+
this.correlationId
|
|
869
851
|
);
|
|
870
852
|
this.logger.verbosePii(
|
|
871
|
-
`Authority Metadata: ${
|
|
853
|
+
`Authority Metadata: '${
|
|
872
854
|
this.authorityOptions.authorityMetadata ||
|
|
873
855
|
Constants.NOT_APPLICABLE
|
|
874
|
-
}
|
|
856
|
+
}'`,
|
|
857
|
+
this.correlationId
|
|
875
858
|
);
|
|
876
859
|
this.logger.verbosePii(
|
|
877
|
-
`Canonical Authority: ${
|
|
860
|
+
`Canonical Authority: '${
|
|
878
861
|
metadataEntity.canonical_authority || Constants.NOT_APPLICABLE
|
|
879
|
-
}
|
|
862
|
+
}'`,
|
|
863
|
+
this.correlationId
|
|
880
864
|
);
|
|
881
865
|
const metadata = this.getCloudDiscoveryMetadataFromConfig();
|
|
882
866
|
if (metadata) {
|
|
883
867
|
this.logger.verbose(
|
|
884
|
-
"Found cloud discovery metadata in authority configuration"
|
|
868
|
+
"Found cloud discovery metadata in authority configuration",
|
|
869
|
+
this.correlationId
|
|
885
870
|
);
|
|
886
871
|
CacheHelpers.updateCloudDiscoveryMetadata(
|
|
887
872
|
metadataEntity,
|
|
888
873
|
metadata,
|
|
889
874
|
false
|
|
890
875
|
);
|
|
891
|
-
return AuthorityMetadataSource.CONFIG;
|
|
876
|
+
return Constants.AuthorityMetadataSource.CONFIG;
|
|
892
877
|
}
|
|
893
878
|
|
|
894
879
|
// If the cached metadata came from config but that config was not passed to this instance, we must go to hardcoded values
|
|
895
880
|
this.logger.verbose(
|
|
896
|
-
"Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."
|
|
881
|
+
"Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",
|
|
882
|
+
this.correlationId
|
|
897
883
|
);
|
|
898
884
|
|
|
899
|
-
|
|
885
|
+
const hardcodedMetadata = getCloudDiscoveryMetadataFromHardcodedValues(
|
|
886
|
+
this.hostnameAndPort
|
|
887
|
+
);
|
|
888
|
+
if (hardcodedMetadata) {
|
|
900
889
|
this.logger.verbose(
|
|
901
|
-
"
|
|
890
|
+
"Found cloud discovery metadata from hardcoded values.",
|
|
891
|
+
this.correlationId
|
|
902
892
|
);
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
);
|
|
908
|
-
if (hardcodedMetadata) {
|
|
909
|
-
this.logger.verbose(
|
|
910
|
-
"Found cloud discovery metadata from hardcoded values."
|
|
911
|
-
);
|
|
912
|
-
CacheHelpers.updateCloudDiscoveryMetadata(
|
|
913
|
-
metadataEntity,
|
|
914
|
-
hardcodedMetadata,
|
|
915
|
-
false
|
|
916
|
-
);
|
|
917
|
-
return AuthorityMetadataSource.HARDCODED_VALUES;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
this.logger.verbose(
|
|
921
|
-
"Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache."
|
|
893
|
+
CacheHelpers.updateCloudDiscoveryMetadata(
|
|
894
|
+
metadataEntity,
|
|
895
|
+
hardcodedMetadata,
|
|
896
|
+
false
|
|
922
897
|
);
|
|
898
|
+
return Constants.AuthorityMetadataSource.HARDCODED_VALUES;
|
|
923
899
|
}
|
|
924
900
|
|
|
901
|
+
this.logger.verbose(
|
|
902
|
+
"Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",
|
|
903
|
+
this.correlationId
|
|
904
|
+
);
|
|
905
|
+
|
|
925
906
|
const metadataEntityExpired =
|
|
926
907
|
CacheHelpers.isAuthorityMetadataExpired(metadataEntity);
|
|
927
908
|
if (
|
|
@@ -929,11 +910,14 @@ export class Authority {
|
|
|
929
910
|
metadataEntity.aliasesFromNetwork &&
|
|
930
911
|
!metadataEntityExpired
|
|
931
912
|
) {
|
|
932
|
-
this.logger.verbose(
|
|
913
|
+
this.logger.verbose(
|
|
914
|
+
"Found cloud discovery metadata in the cache.",
|
|
915
|
+
""
|
|
916
|
+
);
|
|
933
917
|
// No need to update
|
|
934
|
-
return AuthorityMetadataSource.CACHE;
|
|
918
|
+
return Constants.AuthorityMetadataSource.CACHE;
|
|
935
919
|
} else if (metadataEntityExpired) {
|
|
936
|
-
this.logger.verbose("The metadata entity is expired.");
|
|
920
|
+
this.logger.verbose("The metadata entity is expired.", "");
|
|
937
921
|
}
|
|
938
922
|
|
|
939
923
|
return null;
|
|
@@ -946,7 +930,8 @@ export class Authority {
|
|
|
946
930
|
// CIAM does not support cloud discovery metadata
|
|
947
931
|
if (this.authorityType === AuthorityType.Ciam) {
|
|
948
932
|
this.logger.verbose(
|
|
949
|
-
"CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."
|
|
933
|
+
"CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",
|
|
934
|
+
this.correlationId
|
|
950
935
|
);
|
|
951
936
|
return Authority.createCloudDiscoveryMetadataFromHost(
|
|
952
937
|
this.hostnameAndPort
|
|
@@ -956,11 +941,13 @@ export class Authority {
|
|
|
956
941
|
// Check if network response was provided in config
|
|
957
942
|
if (this.authorityOptions.cloudDiscoveryMetadata) {
|
|
958
943
|
this.logger.verbose(
|
|
959
|
-
"The cloud discovery metadata has been provided as a network response, in the config."
|
|
944
|
+
"The cloud discovery metadata has been provided as a network response, in the config.",
|
|
945
|
+
this.correlationId
|
|
960
946
|
);
|
|
961
947
|
try {
|
|
962
948
|
this.logger.verbose(
|
|
963
|
-
"Attempting to parse the cloud discovery metadata."
|
|
949
|
+
"Attempting to parse the cloud discovery metadata.",
|
|
950
|
+
this.correlationId
|
|
964
951
|
);
|
|
965
952
|
const parsedResponse = JSON.parse(
|
|
966
953
|
this.authorityOptions.cloudDiscoveryMetadata
|
|
@@ -969,20 +956,23 @@ export class Authority {
|
|
|
969
956
|
parsedResponse.metadata,
|
|
970
957
|
this.hostnameAndPort
|
|
971
958
|
);
|
|
972
|
-
this.logger.verbose("Parsed the cloud discovery metadata.");
|
|
959
|
+
this.logger.verbose("Parsed the cloud discovery metadata.", "");
|
|
973
960
|
if (metadata) {
|
|
974
961
|
this.logger.verbose(
|
|
975
|
-
"There is returnable metadata attached to the parsed cloud discovery metadata."
|
|
962
|
+
"There is returnable metadata attached to the parsed cloud discovery metadata.",
|
|
963
|
+
this.correlationId
|
|
976
964
|
);
|
|
977
965
|
return metadata;
|
|
978
966
|
} else {
|
|
979
967
|
this.logger.verbose(
|
|
980
|
-
"There is no metadata attached to the parsed cloud discovery metadata."
|
|
968
|
+
"There is no metadata attached to the parsed cloud discovery metadata.",
|
|
969
|
+
this.correlationId
|
|
981
970
|
);
|
|
982
971
|
}
|
|
983
972
|
} catch (e) {
|
|
984
973
|
this.logger.verbose(
|
|
985
|
-
"Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."
|
|
974
|
+
"Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",
|
|
975
|
+
this.correlationId
|
|
986
976
|
);
|
|
987
977
|
throw createClientConfigurationError(
|
|
988
978
|
ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata
|
|
@@ -993,7 +983,8 @@ export class Authority {
|
|
|
993
983
|
// If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities
|
|
994
984
|
if (this.isInKnownAuthorities()) {
|
|
995
985
|
this.logger.verbose(
|
|
996
|
-
"The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."
|
|
986
|
+
"The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",
|
|
987
|
+
this.correlationId
|
|
997
988
|
);
|
|
998
989
|
return Authority.createCloudDiscoveryMetadataFromHost(
|
|
999
990
|
this.hostnameAndPort
|
|
@@ -1009,10 +1000,6 @@ export class Authority {
|
|
|
1009
1000
|
* @param hasHardcodedMetadata boolean
|
|
1010
1001
|
*/
|
|
1011
1002
|
private async getCloudDiscoveryMetadataFromNetwork(): Promise<CloudDiscoveryMetadata | null> {
|
|
1012
|
-
this.performanceClient?.addQueueMeasurement(
|
|
1013
|
-
PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork,
|
|
1014
|
-
this.correlationId
|
|
1015
|
-
);
|
|
1016
1003
|
const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;
|
|
1017
1004
|
const options: ImdsOptions = {};
|
|
1018
1005
|
|
|
@@ -1037,42 +1024,50 @@ export class Authority {
|
|
|
1037
1024
|
metadata = typedResponseBody.metadata;
|
|
1038
1025
|
|
|
1039
1026
|
this.logger.verbosePii(
|
|
1040
|
-
`tenant_discovery_endpoint is: ${typedResponseBody.tenant_discovery_endpoint}
|
|
1027
|
+
`tenant_discovery_endpoint is: '${typedResponseBody.tenant_discovery_endpoint}'`,
|
|
1028
|
+
this.correlationId
|
|
1041
1029
|
);
|
|
1042
1030
|
} else if (isCloudInstanceDiscoveryErrorResponse(response.body)) {
|
|
1043
1031
|
this.logger.warning(
|
|
1044
|
-
`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${response.status}
|
|
1032
|
+
`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${response.status}'`,
|
|
1033
|
+
this.correlationId
|
|
1045
1034
|
);
|
|
1046
1035
|
|
|
1047
1036
|
typedResponseBody =
|
|
1048
1037
|
response.body as CloudInstanceDiscoveryErrorResponse;
|
|
1049
1038
|
if (typedResponseBody.error === Constants.INVALID_INSTANCE) {
|
|
1050
1039
|
this.logger.error(
|
|
1051
|
-
"The CloudInstanceDiscoveryErrorResponse error is invalid_instance."
|
|
1040
|
+
"The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",
|
|
1041
|
+
this.correlationId
|
|
1052
1042
|
);
|
|
1053
1043
|
return null;
|
|
1054
1044
|
}
|
|
1055
1045
|
|
|
1056
1046
|
this.logger.warning(
|
|
1057
|
-
`The CloudInstanceDiscoveryErrorResponse error is ${typedResponseBody.error}
|
|
1047
|
+
`The CloudInstanceDiscoveryErrorResponse error is '${typedResponseBody.error}'`,
|
|
1048
|
+
this.correlationId
|
|
1058
1049
|
);
|
|
1059
1050
|
this.logger.warning(
|
|
1060
|
-
`The CloudInstanceDiscoveryErrorResponse error description is ${typedResponseBody.error_description}
|
|
1051
|
+
`The CloudInstanceDiscoveryErrorResponse error description is '${typedResponseBody.error_description}'`,
|
|
1052
|
+
this.correlationId
|
|
1061
1053
|
);
|
|
1062
1054
|
|
|
1063
1055
|
this.logger.warning(
|
|
1064
|
-
"Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"
|
|
1056
|
+
"Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",
|
|
1057
|
+
this.correlationId
|
|
1065
1058
|
);
|
|
1066
1059
|
metadata = [];
|
|
1067
1060
|
} else {
|
|
1068
1061
|
this.logger.error(
|
|
1069
|
-
"AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"
|
|
1062
|
+
"AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",
|
|
1063
|
+
this.correlationId
|
|
1070
1064
|
);
|
|
1071
1065
|
return null;
|
|
1072
1066
|
}
|
|
1073
1067
|
|
|
1074
1068
|
this.logger.verbose(
|
|
1075
|
-
"Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."
|
|
1069
|
+
"Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",
|
|
1070
|
+
this.correlationId
|
|
1076
1071
|
);
|
|
1077
1072
|
match = getCloudDiscoveryMetadataFromNetworkResponse(
|
|
1078
1073
|
metadata,
|
|
@@ -1081,12 +1076,14 @@ export class Authority {
|
|
|
1081
1076
|
} catch (error) {
|
|
1082
1077
|
if (error instanceof AuthError) {
|
|
1083
1078
|
this.logger.error(
|
|
1084
|
-
`There was a network error while attempting to get the cloud discovery instance metadata.\nError: ${error.errorCode}\nError Description: ${error.errorMessage}
|
|
1079
|
+
`There was a network error while attempting to get the cloud discovery instance metadata.\nError: '${error.errorCode}'\nError Description: '${error.errorMessage}'`,
|
|
1080
|
+
this.correlationId
|
|
1085
1081
|
);
|
|
1086
1082
|
} else {
|
|
1087
1083
|
const typedError = error as Error;
|
|
1088
1084
|
this.logger.error(
|
|
1089
|
-
`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: ${typedError.name}\nError Description: ${typedError.message}
|
|
1085
|
+
`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: '${typedError.name}'\nError Description: '${typedError.message}'`,
|
|
1086
|
+
this.correlationId
|
|
1090
1087
|
);
|
|
1091
1088
|
}
|
|
1092
1089
|
|
|
@@ -1096,10 +1093,12 @@ export class Authority {
|
|
|
1096
1093
|
// Custom Domain scenario, host is trusted because Instance Discovery call succeeded
|
|
1097
1094
|
if (!match) {
|
|
1098
1095
|
this.logger.warning(
|
|
1099
|
-
"The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."
|
|
1096
|
+
"The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",
|
|
1097
|
+
this.correlationId
|
|
1100
1098
|
);
|
|
1101
1099
|
this.logger.verbose(
|
|
1102
|
-
"Creating custom Authority for custom domain scenario."
|
|
1100
|
+
"Creating custom Authority for custom domain scenario.",
|
|
1101
|
+
this.correlationId
|
|
1103
1102
|
);
|
|
1104
1103
|
|
|
1105
1104
|
match = Authority.createCloudDiscoveryMetadataFromHost(
|
|
@@ -1325,9 +1324,9 @@ export function getTenantFromAuthorityString(
|
|
|
1325
1324
|
authorityUrlComponents.PathSegments.slice(-1)[0]?.toLowerCase();
|
|
1326
1325
|
|
|
1327
1326
|
switch (tenantId) {
|
|
1328
|
-
case
|
|
1329
|
-
case
|
|
1330
|
-
case
|
|
1327
|
+
case Constants.AADAuthority.COMMON:
|
|
1328
|
+
case Constants.AADAuthority.ORGANIZATIONS:
|
|
1329
|
+
case Constants.AADAuthority.CONSUMERS:
|
|
1331
1330
|
return undefined;
|
|
1332
1331
|
default:
|
|
1333
1332
|
return tenantId;
|