@azure/msal-common 15.13.3 → 16.0.0-beta.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 -1
- 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.d.ts.map +1 -1
- package/dist/account/AuthToken.mjs +2 -3
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- 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/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 +34 -31
- 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/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/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 +26 -19
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +70 -83
- 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 -56
- 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 +35 -17
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/AccountEntityUtils.d.ts +53 -0
- package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/dist/cache/utils/AccountEntityUtils.mjs +192 -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 +23 -4
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +63 -35
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +17 -4
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +51 -37
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +17 -4
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +28 -15
- 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/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 -229
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +3 -240
- 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 -128
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +3 -134
- 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/PlatformBrokerError.d.ts.map +1 -1
- package/dist/error/PlatformBrokerError.mjs +3 -2
- package/dist/error/PlatformBrokerError.mjs.map +1 -1
- package/dist/error/ServerError.mjs +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 +11 -8
- package/dist/exports-common.d.ts.map +1 -1
- package/dist/exports-node-only.d.ts +2 -4
- package/dist/exports-node-only.d.ts.map +1 -1
- package/dist/index-node.mjs +15 -10
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +17 -11
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.d.ts +36 -13
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +105 -22
- package/dist/logger/Logger.mjs.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/RequestThumbprint.mjs +2 -2
- package/dist/network/RequestThumbprint.mjs.map +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/protocol/Token.d.ts +40 -0
- package/dist/protocol/Token.d.ts.map +1 -0
- package/dist/protocol/Token.mjs +129 -0
- package/dist/protocol/Token.mjs.map +1 -0
- 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 +4 -8
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +2 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +2 -4
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +2 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +2 -1
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +6 -12
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +11 -24
- 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 +7 -6
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +41 -43
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +0 -29
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +5 -81
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +24 -170
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +1 -280
- 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 +66 -0
- package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs +74 -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/Constants.d.ts +81 -112
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -127
- 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.d.ts +14 -35
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +57 -61
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StateTypes.d.ts +15 -0
- package/dist/utils/StateTypes.d.ts.map +1 -0
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +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 +26 -206
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-4Jss3kYh.js → index-node-B7mR4APO.js} +3494 -4270
- package/lib/index-node-B7mR4APO.js.map +1 -0
- package/lib/index-node.cjs +6 -34
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +5 -34
- package/lib/index.cjs.map +1 -1
- package/lib/types/account/AccountInfo.d.ts +0 -1
- package/lib/types/account/AccountInfo.d.ts.map +1 -1
- package/lib/types/account/AuthToken.d.ts.map +1 -1
- 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 +26 -19
- 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 -56
- 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 +35 -17
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/cache/utils/AccountEntityUtils.d.ts +53 -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 +23 -4
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts +17 -4
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/lib/types/client/SilentFlowClient.d.ts +17 -4
- 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 -229
- 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 -128
- 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/error/PlatformBrokerError.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 +11 -8
- package/lib/types/exports-common.d.ts.map +1 -1
- package/lib/types/exports-node-only.d.ts +2 -4
- package/lib/types/exports-node-only.d.ts.map +1 -1
- package/lib/types/logger/Logger.d.ts +36 -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/protocol/Token.d.ts +40 -0
- package/lib/types/protocol/Token.d.ts.map +1 -0
- package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/lib/types/request/BaseAuthRequest.d.ts +4 -8
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts +2 -1
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts +2 -4
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/lib/types/request/CommonRefreshTokenRequest.d.ts +2 -1
- package/lib/types/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/lib/types/request/CommonSilentFlowRequest.d.ts +2 -1
- package/lib/types/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/lib/types/request/RequestParameterBuilder.d.ts +6 -12
- 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 +7 -6
- package/lib/types/response/ResponseHandler.d.ts.map +1 -1
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts +0 -29
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +5 -81
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +1 -280
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts +66 -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 -112
- 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/ProtocolUtils.d.ts +14 -35
- package/lib/types/utils/ProtocolUtils.d.ts.map +1 -1
- package/lib/types/utils/StateTypes.d.ts +15 -0
- package/lib/types/utils/StateTypes.d.ts.map +1 -0
- package/lib/types/utils/UrlUtils.d.ts +1 -2
- package/lib/types/utils/UrlUtils.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/account/AccountInfo.ts +0 -1
- package/src/account/AuthToken.ts +1 -2
- package/src/account/ClientInfo.ts +3 -6
- package/src/authority/Authority.ts +145 -146
- package/src/authority/AuthorityFactory.ts +7 -7
- package/src/authority/AuthorityMetadata.ts +54 -47
- 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 +177 -128
- package/src/cache/entities/AccessTokenEntity.ts +0 -4
- package/src/cache/entities/AccountEntity.ts +4 -292
- package/src/cache/entities/CredentialEntity.ts +0 -2
- package/src/cache/interface/ICacheManager.ts +55 -20
- package/src/cache/utils/AccountEntityUtils.ts +258 -0
- package/src/cache/utils/CacheHelpers.ts +23 -37
- package/src/cache/utils/CacheTypes.ts +0 -1
- package/src/client/AuthorizationCodeClient.ts +146 -58
- package/src/client/RefreshTokenClient.ts +108 -65
- package/src/client/SilentFlowClient.ts +74 -25
- 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 -317
- package/src/error/ClientAuthErrorCodes.ts +0 -8
- package/src/error/ClientConfigurationError.ts +1 -202
- package/src/error/ClientConfigurationErrorCodes.ts +0 -4
- package/src/error/InteractionRequiredAuthError.ts +8 -48
- package/src/error/JoseHeaderError.ts +1 -8
- package/src/error/PlatformBrokerError.ts +2 -1
- package/src/exports-browser-only.ts +2 -6
- package/src/exports-common.ts +8 -40
- package/src/exports-node-only.ts +5 -4
- package/src/logger/Logger.ts +174 -39
- package/src/network/RequestThumbprint.ts +1 -1
- package/src/network/ThrottlingUtils.ts +12 -15
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +24 -20
- package/src/protocol/Token.ts +230 -0
- package/src/request/AuthenticationHeaderParser.ts +2 -4
- package/src/request/BaseAuthRequest.ts +4 -8
- package/src/request/CommonAuthorizationCodeRequest.ts +2 -1
- package/src/request/CommonAuthorizationUrlRequest.ts +2 -4
- package/src/request/CommonRefreshTokenRequest.ts +2 -1
- package/src/request/CommonSilentFlowRequest.ts +2 -1
- package/src/request/RequestParameterBuilder.ts +35 -50
- package/src/request/ScopeSet.ts +4 -4
- package/src/response/AuthenticationResult.ts +1 -1
- package/src/response/ResponseHandler.ts +56 -60
- package/src/telemetry/performance/IPerformanceClient.ts +0 -40
- package/src/telemetry/performance/PerformanceClient.ts +26 -295
- package/src/telemetry/performance/PerformanceEvent.ts +3 -582
- package/src/telemetry/performance/PerformanceEvents.ts +98 -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 -140
- package/src/utils/FunctionWrappers.ts +28 -29
- package/src/utils/ProtocolUtils.ts +67 -93
- package/src/utils/StateTypes.ts +20 -0
- 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/client/BaseClient.d.ts +0 -59
- package/dist/client/BaseClient.d.ts.map +0 -1
- package/dist/client/BaseClient.mjs +0 -167
- package/dist/client/BaseClient.mjs.map +0 -1
- package/dist/index-browser.mjs +0 -72
- package/dist/index-browser.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-4Jss3kYh.js.map +0 -1
- package/lib/types/client/BaseClient.d.ts +0 -59
- package/lib/types/client/BaseClient.d.ts.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/client/BaseClient.ts +0 -320
- 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
|
@@ -22,38 +22,35 @@ export const invoke = <T extends Array<any>, U>(
|
|
|
22
22
|
callback: (...args: T) => U,
|
|
23
23
|
eventName: string,
|
|
24
24
|
logger: Logger,
|
|
25
|
-
telemetryClient
|
|
26
|
-
correlationId
|
|
25
|
+
telemetryClient: IPerformanceClient,
|
|
26
|
+
correlationId: string
|
|
27
27
|
) => {
|
|
28
28
|
return (...args: T): U => {
|
|
29
|
-
logger.trace(`Executing function ${eventName}
|
|
30
|
-
const inProgressEvent = telemetryClient
|
|
29
|
+
logger.trace(`Executing function '${eventName}'`, correlationId);
|
|
30
|
+
const inProgressEvent = telemetryClient.startMeasurement(
|
|
31
31
|
eventName,
|
|
32
32
|
correlationId
|
|
33
33
|
);
|
|
34
34
|
if (correlationId) {
|
|
35
35
|
// Track number of times this API is called in a single request
|
|
36
36
|
const eventCount = eventName + "CallCount";
|
|
37
|
-
telemetryClient
|
|
38
|
-
{ [eventCount]: 1 },
|
|
39
|
-
correlationId
|
|
40
|
-
);
|
|
37
|
+
telemetryClient.incrementFields({ [eventCount]: 1 }, correlationId);
|
|
41
38
|
}
|
|
42
39
|
try {
|
|
43
40
|
const result = callback(...args);
|
|
44
|
-
inProgressEvent
|
|
41
|
+
inProgressEvent.end({
|
|
45
42
|
success: true,
|
|
46
43
|
});
|
|
47
|
-
logger.trace(`Returning result from ${eventName}
|
|
44
|
+
logger.trace(`Returning result from '${eventName}'`, correlationId);
|
|
48
45
|
return result;
|
|
49
46
|
} catch (e) {
|
|
50
|
-
logger.trace(`Error occurred in ${eventName}
|
|
47
|
+
logger.trace(`Error occurred in '${eventName}'`, correlationId);
|
|
51
48
|
try {
|
|
52
|
-
logger.trace(JSON.stringify(e));
|
|
49
|
+
logger.trace(JSON.stringify(e), correlationId);
|
|
53
50
|
} catch (e) {
|
|
54
|
-
logger.trace("Unable to print error message.");
|
|
51
|
+
logger.trace("Unable to print error message.", correlationId);
|
|
55
52
|
}
|
|
56
|
-
inProgressEvent
|
|
53
|
+
inProgressEvent.end(
|
|
57
54
|
{
|
|
58
55
|
success: false,
|
|
59
56
|
},
|
|
@@ -81,40 +78,42 @@ export const invokeAsync = <T extends Array<any>, U>(
|
|
|
81
78
|
callback: (...args: T) => Promise<U>,
|
|
82
79
|
eventName: string,
|
|
83
80
|
logger: Logger,
|
|
84
|
-
telemetryClient
|
|
85
|
-
correlationId
|
|
81
|
+
telemetryClient: IPerformanceClient,
|
|
82
|
+
correlationId: string
|
|
86
83
|
) => {
|
|
87
84
|
return (...args: T): Promise<U> => {
|
|
88
|
-
logger.trace(`Executing function ${eventName}
|
|
89
|
-
const inProgressEvent = telemetryClient
|
|
85
|
+
logger.trace(`Executing function '${eventName}'`, correlationId);
|
|
86
|
+
const inProgressEvent = telemetryClient.startMeasurement(
|
|
90
87
|
eventName,
|
|
91
88
|
correlationId
|
|
92
89
|
);
|
|
93
90
|
if (correlationId) {
|
|
94
91
|
// Track number of times this API is called in a single request
|
|
95
92
|
const eventCount = eventName + "CallCount";
|
|
96
|
-
telemetryClient
|
|
97
|
-
{ [eventCount]: 1 },
|
|
98
|
-
correlationId
|
|
99
|
-
);
|
|
93
|
+
telemetryClient.incrementFields({ [eventCount]: 1 }, correlationId);
|
|
100
94
|
}
|
|
101
|
-
telemetryClient?.setPreQueueTime(eventName, correlationId);
|
|
102
95
|
return callback(...args)
|
|
103
96
|
.then((response) => {
|
|
104
|
-
logger.trace(
|
|
105
|
-
|
|
97
|
+
logger.trace(
|
|
98
|
+
`Returning result from '${eventName}'`,
|
|
99
|
+
correlationId
|
|
100
|
+
);
|
|
101
|
+
inProgressEvent.end({
|
|
106
102
|
success: true,
|
|
107
103
|
});
|
|
108
104
|
return response;
|
|
109
105
|
})
|
|
110
106
|
.catch((e) => {
|
|
111
|
-
logger.trace(`Error occurred in ${eventName}
|
|
107
|
+
logger.trace(`Error occurred in '${eventName}'`, correlationId);
|
|
112
108
|
try {
|
|
113
|
-
logger.trace(JSON.stringify(e));
|
|
109
|
+
logger.trace(JSON.stringify(e), correlationId);
|
|
114
110
|
} catch (e) {
|
|
115
|
-
logger.trace(
|
|
111
|
+
logger.trace(
|
|
112
|
+
"Unable to print error message.",
|
|
113
|
+
correlationId
|
|
114
|
+
);
|
|
116
115
|
}
|
|
117
|
-
inProgressEvent
|
|
116
|
+
inProgressEvent.end(
|
|
118
117
|
{
|
|
119
118
|
success: false,
|
|
120
119
|
},
|
|
@@ -3,118 +3,92 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { RESOURCE_DELIM } from "./Constants.js";
|
|
7
7
|
import { ICrypto } from "../crypto/ICrypto.js";
|
|
8
8
|
import {
|
|
9
9
|
ClientAuthErrorCodes,
|
|
10
10
|
createClientAuthError,
|
|
11
11
|
} from "../error/ClientAuthError.js";
|
|
12
|
+
import { LibraryStateObject, RequestStateObject } from "./StateTypes.js";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* - platformState - string value sent from the platform.
|
|
15
|
+
* Appends user state with random guid, or returns random guid.
|
|
16
|
+
* @param cryptoObj
|
|
17
|
+
* @param userState
|
|
18
|
+
* @param meta
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
libraryState: LibraryStateObject;
|
|
31
|
-
};
|
|
20
|
+
export function setRequestState(
|
|
21
|
+
cryptoObj: ICrypto,
|
|
22
|
+
userState?: string,
|
|
23
|
+
meta?: Record<string, string>
|
|
24
|
+
): string {
|
|
25
|
+
const libraryState = generateLibraryState(cryptoObj, meta);
|
|
26
|
+
return userState
|
|
27
|
+
? `${libraryState}${RESOURCE_DELIM}${userState}`
|
|
28
|
+
: libraryState;
|
|
29
|
+
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
|
-
*
|
|
32
|
+
* Generates the state value used by the common library.
|
|
33
|
+
* @param cryptoObj
|
|
34
|
+
* @param meta
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
static setRequestState(
|
|
43
|
-
cryptoObj: ICrypto,
|
|
44
|
-
userState?: string,
|
|
45
|
-
meta?: Record<string, string>
|
|
46
|
-
): string {
|
|
47
|
-
const libraryState = ProtocolUtils.generateLibraryState(
|
|
48
|
-
cryptoObj,
|
|
49
|
-
meta
|
|
50
|
-
);
|
|
51
|
-
return userState
|
|
52
|
-
? `${libraryState}${Constants.RESOURCE_DELIM}${userState}`
|
|
53
|
-
: libraryState;
|
|
36
|
+
export function generateLibraryState(
|
|
37
|
+
cryptoObj: ICrypto,
|
|
38
|
+
meta?: Record<string, string>
|
|
39
|
+
): string {
|
|
40
|
+
if (!cryptoObj) {
|
|
41
|
+
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
54
42
|
}
|
|
55
43
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*/
|
|
61
|
-
static generateLibraryState(
|
|
62
|
-
cryptoObj: ICrypto,
|
|
63
|
-
meta?: Record<string, string>
|
|
64
|
-
): string {
|
|
65
|
-
if (!cryptoObj) {
|
|
66
|
-
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
67
|
-
}
|
|
44
|
+
// Create a state object containing a unique id and the timestamp of the request creation
|
|
45
|
+
const stateObj: LibraryStateObject = {
|
|
46
|
+
id: cryptoObj.createNewGuid(),
|
|
47
|
+
};
|
|
68
48
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
49
|
+
if (meta) {
|
|
50
|
+
stateObj.meta = meta;
|
|
51
|
+
}
|
|
73
52
|
|
|
74
|
-
|
|
75
|
-
stateObj.meta = meta;
|
|
76
|
-
}
|
|
53
|
+
const stateString = JSON.stringify(stateObj);
|
|
77
54
|
|
|
78
|
-
|
|
55
|
+
return cryptoObj.base64Encode(stateString);
|
|
56
|
+
}
|
|
79
57
|
|
|
80
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
|
|
60
|
+
* @param base64Decode
|
|
61
|
+
* @param state
|
|
62
|
+
*/
|
|
63
|
+
export function parseRequestState(
|
|
64
|
+
base64Decode: (input: string) => string,
|
|
65
|
+
state: string
|
|
66
|
+
): RequestStateObject {
|
|
67
|
+
if (!base64Decode) {
|
|
68
|
+
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
81
69
|
}
|
|
82
70
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* @param cryptoObj
|
|
87
|
-
*/
|
|
88
|
-
static parseRequestState(
|
|
89
|
-
cryptoObj: ICrypto,
|
|
90
|
-
state: string
|
|
91
|
-
): RequestStateObject {
|
|
92
|
-
if (!cryptoObj) {
|
|
93
|
-
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (!state) {
|
|
97
|
-
throw createClientAuthError(ClientAuthErrorCodes.invalidState);
|
|
98
|
-
}
|
|
71
|
+
if (!state) {
|
|
72
|
+
throw createClientAuthError(ClientAuthErrorCodes.invalidState);
|
|
73
|
+
}
|
|
99
74
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
75
|
+
try {
|
|
76
|
+
// Split the state between library state and user passed state and decode them separately
|
|
77
|
+
const splitState = state.split(RESOURCE_DELIM);
|
|
78
|
+
const libraryState = splitState[0];
|
|
79
|
+
const userState =
|
|
80
|
+
splitState.length > 1
|
|
81
|
+
? splitState.slice(1).join(RESOURCE_DELIM)
|
|
82
|
+
: "";
|
|
83
|
+
const libraryStateString = base64Decode(libraryState);
|
|
84
|
+
const libraryStateObj = JSON.parse(
|
|
85
|
+
libraryStateString
|
|
86
|
+
) as LibraryStateObject;
|
|
87
|
+
return {
|
|
88
|
+
userRequestState: userState || "",
|
|
89
|
+
libraryState: libraryStateObj,
|
|
90
|
+
};
|
|
91
|
+
} catch (e) {
|
|
92
|
+
throw createClientAuthError(ClientAuthErrorCodes.invalidState);
|
|
119
93
|
}
|
|
120
94
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Type which defines library state
|
|
8
|
+
*/
|
|
9
|
+
export type LibraryStateObject = {
|
|
10
|
+
id: string;
|
|
11
|
+
meta?: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type which defines the stringified and encoded state object sent to the service in the authorize request.
|
|
16
|
+
*/
|
|
17
|
+
export type RequestStateObject = {
|
|
18
|
+
userRequestState: string;
|
|
19
|
+
libraryState: LibraryStateObject;
|
|
20
|
+
};
|
package/src/utils/UrlUtils.ts
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
ClientAuthErrorCodes,
|
|
9
9
|
createClientAuthError,
|
|
10
10
|
} from "../error/ClientAuthError.js";
|
|
11
|
-
import { StringDict } from "./MsalTypes.js";
|
|
12
11
|
import { StringUtils } from "./StringUtils.js";
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -92,23 +91,11 @@ export function getDeserializedResponse(
|
|
|
92
91
|
/**
|
|
93
92
|
* Utility to create a URL from the params map
|
|
94
93
|
*/
|
|
95
|
-
export function mapToQueryString(
|
|
96
|
-
parameters: Map<string, string>,
|
|
97
|
-
encodeExtraParams: boolean = true,
|
|
98
|
-
extraQueryParameters?: StringDict
|
|
99
|
-
): string {
|
|
94
|
+
export function mapToQueryString(parameters: Map<string, string>): string {
|
|
100
95
|
const queryParameterArray: Array<string> = new Array<string>();
|
|
101
96
|
|
|
102
97
|
parameters.forEach((value, key) => {
|
|
103
|
-
|
|
104
|
-
!encodeExtraParams &&
|
|
105
|
-
extraQueryParameters &&
|
|
106
|
-
key in extraQueryParameters
|
|
107
|
-
) {
|
|
108
|
-
queryParameterArray.push(`${key}=${value}`);
|
|
109
|
-
} else {
|
|
110
|
-
queryParameterArray.push(`${key}=${encodeURIComponent(value)}`);
|
|
111
|
-
}
|
|
98
|
+
queryParameterArray.push(`${key}=${encodeURIComponent(value)}`);
|
|
112
99
|
});
|
|
113
100
|
|
|
114
101
|
return queryParameterArray.join("&");
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-common v15.13.3 2025-12-04 */
|
|
2
|
-
'use strict';
|
|
3
|
-
import { CacheAccountType } from '../../utils/Constants.mjs';
|
|
4
|
-
import { buildClientInfo } from '../../account/ClientInfo.mjs';
|
|
5
|
-
import { buildTenantProfile } from '../../account/AccountInfo.mjs';
|
|
6
|
-
import { createClientAuthError } from '../../error/ClientAuthError.mjs';
|
|
7
|
-
import { AuthorityType } from '../../authority/AuthorityType.mjs';
|
|
8
|
-
import { getTenantIdFromIdTokenClaims } from '../../account/TokenClaims.mjs';
|
|
9
|
-
import { ProtocolMode } from '../../authority/ProtocolMode.mjs';
|
|
10
|
-
import { invalidCacheEnvironment } from '../../error/ClientAuthErrorCodes.mjs';
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14
|
-
* Licensed under the MIT License.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).
|
|
18
|
-
*
|
|
19
|
-
* Key : Value Schema
|
|
20
|
-
*
|
|
21
|
-
* Key: <home_account_id>-<environment>-<realm*>
|
|
22
|
-
*
|
|
23
|
-
* Value Schema:
|
|
24
|
-
* {
|
|
25
|
-
* homeAccountId: home account identifier for the auth scheme,
|
|
26
|
-
* environment: entity that issued the token, represented as a full host
|
|
27
|
-
* realm: Full tenant or organizational identifier that the account belongs to
|
|
28
|
-
* localAccountId: Original tenant-specific accountID, usually used for legacy cases
|
|
29
|
-
* username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt
|
|
30
|
-
* authorityType: Accounts authority type as a string
|
|
31
|
-
* name: Full name for the account, including given name and family name,
|
|
32
|
-
* lastModificationTime: last time this entity was modified in the cache
|
|
33
|
-
* lastModificationApp:
|
|
34
|
-
* nativeAccountId: Account identifier on the native device
|
|
35
|
-
* tenantProfiles: Array of tenant profile objects for each tenant that the account has authenticated with in the browser
|
|
36
|
-
* }
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
class AccountEntity {
|
|
40
|
-
/**
|
|
41
|
-
* Returns the AccountInfo interface for this account.
|
|
42
|
-
*/
|
|
43
|
-
static getAccountInfo(accountEntity) {
|
|
44
|
-
return {
|
|
45
|
-
homeAccountId: accountEntity.homeAccountId,
|
|
46
|
-
environment: accountEntity.environment,
|
|
47
|
-
tenantId: accountEntity.realm,
|
|
48
|
-
username: accountEntity.username,
|
|
49
|
-
localAccountId: accountEntity.localAccountId,
|
|
50
|
-
loginHint: accountEntity.loginHint,
|
|
51
|
-
name: accountEntity.name,
|
|
52
|
-
nativeAccountId: accountEntity.nativeAccountId,
|
|
53
|
-
authorityType: accountEntity.authorityType,
|
|
54
|
-
// Deserialize tenant profiles array into a Map
|
|
55
|
-
tenantProfiles: new Map((accountEntity.tenantProfiles || []).map((tenantProfile) => {
|
|
56
|
-
return [tenantProfile.tenantId, tenantProfile];
|
|
57
|
-
})),
|
|
58
|
-
dataBoundary: accountEntity.dataBoundary,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Returns true if the account entity is in single tenant format (outdated), false otherwise
|
|
63
|
-
*/
|
|
64
|
-
isSingleTenant() {
|
|
65
|
-
return !this.tenantProfiles;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.
|
|
69
|
-
* @param accountDetails
|
|
70
|
-
*/
|
|
71
|
-
static createAccount(accountDetails, authority, base64Decode) {
|
|
72
|
-
const account = new AccountEntity();
|
|
73
|
-
if (authority.authorityType === AuthorityType.Adfs) {
|
|
74
|
-
account.authorityType = CacheAccountType.ADFS_ACCOUNT_TYPE;
|
|
75
|
-
}
|
|
76
|
-
else if (authority.protocolMode === ProtocolMode.OIDC) {
|
|
77
|
-
account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
|
|
81
|
-
}
|
|
82
|
-
let clientInfo;
|
|
83
|
-
if (accountDetails.clientInfo && base64Decode) {
|
|
84
|
-
clientInfo = buildClientInfo(accountDetails.clientInfo, base64Decode);
|
|
85
|
-
if (clientInfo.xms_tdbr) {
|
|
86
|
-
account.dataBoundary =
|
|
87
|
-
clientInfo.xms_tdbr === "EU" ? "EU" : "None";
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
account.clientInfo = accountDetails.clientInfo;
|
|
91
|
-
account.homeAccountId = accountDetails.homeAccountId;
|
|
92
|
-
account.nativeAccountId = accountDetails.nativeAccountId;
|
|
93
|
-
const env = accountDetails.environment ||
|
|
94
|
-
(authority && authority.getPreferredCache());
|
|
95
|
-
if (!env) {
|
|
96
|
-
throw createClientAuthError(invalidCacheEnvironment);
|
|
97
|
-
}
|
|
98
|
-
account.environment = env;
|
|
99
|
-
// non AAD scenarios can have empty realm
|
|
100
|
-
account.realm =
|
|
101
|
-
clientInfo?.utid ||
|
|
102
|
-
getTenantIdFromIdTokenClaims(accountDetails.idTokenClaims) ||
|
|
103
|
-
"";
|
|
104
|
-
// How do you account for MSA CID here?
|
|
105
|
-
account.localAccountId =
|
|
106
|
-
clientInfo?.uid ||
|
|
107
|
-
accountDetails.idTokenClaims?.oid ||
|
|
108
|
-
accountDetails.idTokenClaims?.sub ||
|
|
109
|
-
"";
|
|
110
|
-
/*
|
|
111
|
-
* In B2C scenarios the emails claim is used instead of preferred_username and it is an array.
|
|
112
|
-
* In most cases it will contain a single email. This field should not be relied upon if a custom
|
|
113
|
-
* policy is configured to return more than 1 email.
|
|
114
|
-
*/
|
|
115
|
-
const preferredUsername = accountDetails.idTokenClaims?.preferred_username ||
|
|
116
|
-
accountDetails.idTokenClaims?.upn;
|
|
117
|
-
const email = accountDetails.idTokenClaims?.emails
|
|
118
|
-
? accountDetails.idTokenClaims.emails[0]
|
|
119
|
-
: null;
|
|
120
|
-
account.username = preferredUsername || email || "";
|
|
121
|
-
account.loginHint = accountDetails.idTokenClaims?.login_hint;
|
|
122
|
-
account.name = accountDetails.idTokenClaims?.name || "";
|
|
123
|
-
account.cloudGraphHostName = accountDetails.cloudGraphHostName;
|
|
124
|
-
account.msGraphHost = accountDetails.msGraphHost;
|
|
125
|
-
if (accountDetails.tenantProfiles) {
|
|
126
|
-
account.tenantProfiles = accountDetails.tenantProfiles;
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
const tenantProfile = buildTenantProfile(accountDetails.homeAccountId, account.localAccountId, account.realm, accountDetails.idTokenClaims);
|
|
130
|
-
account.tenantProfiles = [tenantProfile];
|
|
131
|
-
}
|
|
132
|
-
return account;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Creates an AccountEntity object from AccountInfo
|
|
136
|
-
* @param accountInfo
|
|
137
|
-
* @param cloudGraphHostName
|
|
138
|
-
* @param msGraphHost
|
|
139
|
-
* @returns
|
|
140
|
-
*/
|
|
141
|
-
static createFromAccountInfo(accountInfo, cloudGraphHostName, msGraphHost) {
|
|
142
|
-
const account = new AccountEntity();
|
|
143
|
-
account.authorityType =
|
|
144
|
-
accountInfo.authorityType || CacheAccountType.GENERIC_ACCOUNT_TYPE;
|
|
145
|
-
account.homeAccountId = accountInfo.homeAccountId;
|
|
146
|
-
account.localAccountId = accountInfo.localAccountId;
|
|
147
|
-
account.nativeAccountId = accountInfo.nativeAccountId;
|
|
148
|
-
account.realm = accountInfo.tenantId;
|
|
149
|
-
account.environment = accountInfo.environment;
|
|
150
|
-
account.username = accountInfo.username;
|
|
151
|
-
account.name = accountInfo.name;
|
|
152
|
-
account.loginHint = accountInfo.loginHint;
|
|
153
|
-
account.cloudGraphHostName = cloudGraphHostName;
|
|
154
|
-
account.msGraphHost = msGraphHost;
|
|
155
|
-
// Serialize tenant profiles map into an array
|
|
156
|
-
account.tenantProfiles = Array.from(accountInfo.tenantProfiles?.values() || []);
|
|
157
|
-
account.dataBoundary = accountInfo.dataBoundary;
|
|
158
|
-
return account;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Generate HomeAccountId from server response
|
|
162
|
-
* @param serverClientInfo
|
|
163
|
-
* @param authType
|
|
164
|
-
*/
|
|
165
|
-
static generateHomeAccountId(serverClientInfo, authType, logger, cryptoObj, idTokenClaims) {
|
|
166
|
-
// since ADFS/DSTS do not have tid and does not set client_info
|
|
167
|
-
if (!(authType === AuthorityType.Adfs ||
|
|
168
|
-
authType === AuthorityType.Dsts)) {
|
|
169
|
-
// for cases where there is clientInfo
|
|
170
|
-
if (serverClientInfo) {
|
|
171
|
-
try {
|
|
172
|
-
const clientInfo = buildClientInfo(serverClientInfo, cryptoObj.base64Decode);
|
|
173
|
-
if (clientInfo.uid && clientInfo.utid) {
|
|
174
|
-
return `${clientInfo.uid}.${clientInfo.utid}`;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
catch (e) { }
|
|
178
|
-
}
|
|
179
|
-
logger.warning("No client info in response");
|
|
180
|
-
}
|
|
181
|
-
// default to "sub" claim
|
|
182
|
-
return idTokenClaims?.sub || "";
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Validates an entity: checks for all expected params
|
|
186
|
-
* @param entity
|
|
187
|
-
*/
|
|
188
|
-
static isAccountEntity(entity) {
|
|
189
|
-
if (!entity) {
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
return (entity.hasOwnProperty("homeAccountId") &&
|
|
193
|
-
entity.hasOwnProperty("environment") &&
|
|
194
|
-
entity.hasOwnProperty("realm") &&
|
|
195
|
-
entity.hasOwnProperty("localAccountId") &&
|
|
196
|
-
entity.hasOwnProperty("username") &&
|
|
197
|
-
entity.hasOwnProperty("authorityType"));
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Helper function to determine whether 2 accountInfo objects represent the same account
|
|
201
|
-
* @param accountA
|
|
202
|
-
* @param accountB
|
|
203
|
-
* @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality
|
|
204
|
-
*/
|
|
205
|
-
static accountInfoIsEqual(accountA, accountB, compareClaims) {
|
|
206
|
-
if (!accountA || !accountB) {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false
|
|
210
|
-
if (compareClaims) {
|
|
211
|
-
const accountAClaims = (accountA.idTokenClaims ||
|
|
212
|
-
{});
|
|
213
|
-
const accountBClaims = (accountB.idTokenClaims ||
|
|
214
|
-
{});
|
|
215
|
-
// issued at timestamp and nonce are expected to change each time a new id token is acquired
|
|
216
|
-
claimsMatch =
|
|
217
|
-
accountAClaims.iat === accountBClaims.iat &&
|
|
218
|
-
accountAClaims.nonce === accountBClaims.nonce;
|
|
219
|
-
}
|
|
220
|
-
return (accountA.homeAccountId === accountB.homeAccountId &&
|
|
221
|
-
accountA.localAccountId === accountB.localAccountId &&
|
|
222
|
-
accountA.username === accountB.username &&
|
|
223
|
-
accountA.tenantId === accountB.tenantId &&
|
|
224
|
-
accountA.loginHint === accountB.loginHint &&
|
|
225
|
-
accountA.environment === accountB.environment &&
|
|
226
|
-
accountA.nativeAccountId === accountB.nativeAccountId &&
|
|
227
|
-
claimsMatch);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export { AccountEntity };
|
|
232
|
-
//# sourceMappingURL=AccountEntity.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountEntity.mjs","sources":["../../../src/cache/entities/AccountEntity.ts"],"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AA;AAED,QAAA,QACI,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,aAAa;AACjD,YAAA,QAAQ,CAAC,cAAc,KAAK,QAAQ,CAAC,cAAc;AACnD,YAAA,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ;AACvC,YAAA,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ;AACvC,YAAA,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS;AACzC,YAAA,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW;AAC7C,YAAA,QAAQ,CAAC,eAAe,KAAK,QAAQ,CAAC,eAAe;AACrD,YAAA,WAAW,EACb;KACL;AACJ;;;;"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ClientConfiguration, CommonClientConfiguration } from "../config/ClientConfiguration.js";
|
|
2
|
-
import { INetworkModule, NetworkRequestOptions } from "../network/INetworkModule.js";
|
|
3
|
-
import { NetworkResponse } from "../network/NetworkResponse.js";
|
|
4
|
-
import { ICrypto } from "../crypto/ICrypto.js";
|
|
5
|
-
import { Authority } from "../authority/Authority.js";
|
|
6
|
-
import { Logger } from "../logger/Logger.js";
|
|
7
|
-
import { ServerAuthorizationTokenResponse } from "../response/ServerAuthorizationTokenResponse.js";
|
|
8
|
-
import { CacheManager } from "../cache/CacheManager.js";
|
|
9
|
-
import { ServerTelemetryManager } from "../telemetry/server/ServerTelemetryManager.js";
|
|
10
|
-
import { RequestThumbprint } from "../network/RequestThumbprint.js";
|
|
11
|
-
import { CcsCredential } from "../account/CcsCredential.js";
|
|
12
|
-
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
|
|
13
|
-
import { BaseAuthRequest } from "../request/BaseAuthRequest.js";
|
|
14
|
-
/**
|
|
15
|
-
* Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare abstract class BaseClient {
|
|
19
|
-
logger: Logger;
|
|
20
|
-
protected config: CommonClientConfiguration;
|
|
21
|
-
protected cryptoUtils: ICrypto;
|
|
22
|
-
protected cacheManager: CacheManager;
|
|
23
|
-
protected networkClient: INetworkModule;
|
|
24
|
-
protected serverTelemetryManager: ServerTelemetryManager | null;
|
|
25
|
-
authority: Authority;
|
|
26
|
-
protected performanceClient?: IPerformanceClient;
|
|
27
|
-
protected constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient);
|
|
28
|
-
/**
|
|
29
|
-
* Creates default headers for requests to token endpoint
|
|
30
|
-
*/
|
|
31
|
-
protected createTokenRequestHeaders(ccsCred?: CcsCredential): Record<string, string>;
|
|
32
|
-
/**
|
|
33
|
-
* Http post to token endpoint
|
|
34
|
-
* @param tokenEndpoint
|
|
35
|
-
* @param queryString
|
|
36
|
-
* @param headers
|
|
37
|
-
* @param thumbprint
|
|
38
|
-
*/
|
|
39
|
-
protected executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record<string, string>, thumbprint: RequestThumbprint, correlationId: string, queuedEvent?: string): Promise<NetworkResponse<ServerAuthorizationTokenResponse>>;
|
|
40
|
-
/**
|
|
41
|
-
* Wraps sendPostRequestAsync with necessary preflight and postflight logic
|
|
42
|
-
* @param thumbprint - Request thumbprint for throttling
|
|
43
|
-
* @param tokenEndpoint - Endpoint to make the POST to
|
|
44
|
-
* @param options - Body and Headers to include on the POST request
|
|
45
|
-
* @param correlationId - CorrelationId for telemetry
|
|
46
|
-
*/
|
|
47
|
-
sendPostRequest<T extends ServerAuthorizationTokenResponse>(thumbprint: RequestThumbprint, tokenEndpoint: string, options: NetworkRequestOptions, correlationId: string): Promise<NetworkResponse<T>>;
|
|
48
|
-
/**
|
|
49
|
-
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
50
|
-
* @param updatedAuthority
|
|
51
|
-
*/
|
|
52
|
-
updateAuthority(cloudInstanceHostname: string, correlationId: string): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Creates query string for the /token request
|
|
55
|
-
* @param request
|
|
56
|
-
*/
|
|
57
|
-
createTokenQueryParameters(request: BaseAuthRequest): string;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=BaseClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.d.ts","sourceRoot":"","sources":["../../src/client/BaseClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,mBAAmB,EAEnB,yBAAyB,EAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,cAAc,EACd,qBAAqB,EACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAqB,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAGpF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAYhE;;;GAGG;AACH,8BAAsB,UAAU;IAErB,MAAM,EAAE,MAAM,CAAC;IAGtB,SAAS,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAG5C,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC;IAG/B,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAGrC,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC;IAGxC,SAAS,CAAC,sBAAsB,EAA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