@azure/msal-common 14.4.1-beta.1 → 14.5.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.
Files changed (288) hide show
  1. package/dist/account/AccountInfo.d.ts +58 -31
  2. package/dist/account/AccountInfo.d.ts.map +1 -1
  3. package/dist/account/AccountInfo.mjs +64 -0
  4. package/dist/account/AccountInfo.mjs.map +1 -0
  5. package/dist/account/AuthToken.d.ts +17 -17
  6. package/dist/account/AuthToken.mjs +58 -58
  7. package/dist/account/AuthToken.mjs.map +1 -1
  8. package/dist/account/CcsCredential.d.ts +9 -9
  9. package/dist/account/CcsCredential.mjs +8 -8
  10. package/dist/account/CcsCredential.mjs.map +1 -1
  11. package/dist/account/ClientCredentials.d.ts +14 -14
  12. package/dist/account/ClientInfo.d.ts +18 -19
  13. package/dist/account/ClientInfo.d.ts.map +1 -1
  14. package/dist/account/ClientInfo.mjs +37 -37
  15. package/dist/account/ClientInfo.mjs.map +1 -1
  16. package/dist/account/TokenClaims.d.ts +83 -65
  17. package/dist/account/TokenClaims.d.ts.map +1 -1
  18. package/dist/account/TokenClaims.mjs +25 -0
  19. package/dist/account/TokenClaims.mjs.map +1 -0
  20. package/dist/authority/Authority.d.ts +253 -249
  21. package/dist/authority/Authority.d.ts.map +1 -1
  22. package/dist/authority/Authority.mjs +812 -789
  23. package/dist/authority/Authority.mjs.map +1 -1
  24. package/dist/authority/AuthorityFactory.d.ts +31 -31
  25. package/dist/authority/AuthorityFactory.mjs +47 -47
  26. package/dist/authority/AuthorityFactory.mjs.map +1 -1
  27. package/dist/authority/AuthorityMetadata.d.ts +503 -503
  28. package/dist/authority/AuthorityMetadata.mjs +603 -603
  29. package/dist/authority/AuthorityMetadata.mjs.map +1 -1
  30. package/dist/authority/AuthorityOptions.d.ts +27 -27
  31. package/dist/authority/AuthorityOptions.mjs +18 -18
  32. package/dist/authority/AuthorityOptions.mjs.map +1 -1
  33. package/dist/authority/AuthorityType.d.ts +10 -10
  34. package/dist/authority/AuthorityType.mjs +13 -13
  35. package/dist/authority/AuthorityType.mjs.map +1 -1
  36. package/dist/authority/AzureRegion.d.ts +1 -1
  37. package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
  38. package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
  39. package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
  40. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +8 -8
  41. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs.map +1 -1
  42. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
  43. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +8 -8
  44. package/dist/authority/CloudInstanceDiscoveryResponse.mjs.map +1 -1
  45. package/dist/authority/ImdsOptions.d.ts +5 -5
  46. package/dist/authority/OIDCOptions.d.ts +8 -8
  47. package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
  48. package/dist/authority/OpenIdConfigResponse.mjs +10 -10
  49. package/dist/authority/OpenIdConfigResponse.mjs.map +1 -1
  50. package/dist/authority/ProtocolMode.d.ts +8 -8
  51. package/dist/authority/ProtocolMode.mjs +11 -11
  52. package/dist/authority/ProtocolMode.mjs.map +1 -1
  53. package/dist/authority/RegionDiscovery.d.ts +32 -32
  54. package/dist/authority/RegionDiscovery.mjs +106 -106
  55. package/dist/authority/RegionDiscovery.mjs.map +1 -1
  56. package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
  57. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
  58. package/dist/cache/CacheManager.d.ts +517 -485
  59. package/dist/cache/CacheManager.d.ts.map +1 -1
  60. package/dist/cache/CacheManager.mjs +1264 -1102
  61. package/dist/cache/CacheManager.mjs.map +1 -1
  62. package/dist/cache/entities/AccessTokenEntity.d.ts +25 -25
  63. package/dist/cache/entities/AccountEntity.d.ts +106 -101
  64. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  65. package/dist/cache/entities/AccountEntity.mjs +247 -219
  66. package/dist/cache/entities/AccountEntity.mjs.map +1 -1
  67. package/dist/cache/entities/AppMetadataEntity.d.ts +39 -39
  68. package/dist/cache/entities/AppMetadataEntity.mjs +66 -66
  69. package/dist/cache/entities/AppMetadataEntity.mjs.map +1 -1
  70. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +48 -48
  71. package/dist/cache/entities/AuthorityMetadataEntity.mjs +78 -78
  72. package/dist/cache/entities/AuthorityMetadataEntity.mjs.map +1 -1
  73. package/dist/cache/entities/CacheRecord.d.ts +14 -14
  74. package/dist/cache/entities/CacheRecord.mjs +14 -14
  75. package/dist/cache/entities/CacheRecord.mjs.map +1 -1
  76. package/dist/cache/entities/CredentialEntity.d.ts +30 -30
  77. package/dist/cache/entities/IdTokenEntity.d.ts +8 -8
  78. package/dist/cache/entities/RefreshTokenEntity.d.ts +5 -7
  79. package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
  80. package/dist/cache/entities/ServerTelemetryEntity.d.ts +5 -5
  81. package/dist/cache/entities/ThrottlingEntity.d.ts +13 -13
  82. package/dist/cache/entities/ThrottlingEntity.mjs +23 -23
  83. package/dist/cache/entities/ThrottlingEntity.mjs.map +1 -1
  84. package/dist/cache/interface/ICacheManager.d.ts +166 -166
  85. package/dist/cache/interface/ICachePlugin.d.ts +5 -5
  86. package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
  87. package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
  88. package/dist/cache/persistence/TokenCacheContext.mjs +25 -25
  89. package/dist/cache/persistence/TokenCacheContext.mjs.map +1 -1
  90. package/dist/cache/utils/CacheHelpers.d.ts +64 -64
  91. package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
  92. package/dist/cache/utils/CacheHelpers.mjs +231 -234
  93. package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
  94. package/dist/cache/utils/CacheTypes.d.ts +69 -67
  95. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  96. package/dist/client/AuthorizationCodeClient.d.ts +74 -74
  97. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  98. package/dist/client/AuthorizationCodeClient.mjs +404 -403
  99. package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
  100. package/dist/client/BaseClient.d.ts +51 -51
  101. package/dist/client/BaseClient.mjs +100 -100
  102. package/dist/client/BaseClient.mjs.map +1 -1
  103. package/dist/client/RefreshTokenClient.d.ts +35 -35
  104. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  105. package/dist/client/RefreshTokenClient.mjs +189 -194
  106. package/dist/client/RefreshTokenClient.mjs.map +1 -1
  107. package/dist/client/SilentFlowClient.d.ts +27 -27
  108. package/dist/client/SilentFlowClient.mjs +118 -118
  109. package/dist/client/SilentFlowClient.mjs.map +1 -1
  110. package/dist/config/AppTokenProvider.d.ts +38 -38
  111. package/dist/config/ClientConfiguration.d.ts +150 -150
  112. package/dist/config/ClientConfiguration.mjs +97 -97
  113. package/dist/config/ClientConfiguration.mjs.map +1 -1
  114. package/dist/constants/AADServerParamKeys.d.ts +52 -0
  115. package/dist/constants/AADServerParamKeys.d.ts.map +1 -0
  116. package/dist/constants/AADServerParamKeys.mjs +60 -0
  117. package/dist/constants/AADServerParamKeys.mjs.map +1 -0
  118. package/dist/crypto/ICrypto.d.ts +58 -58
  119. package/dist/crypto/ICrypto.mjs +30 -30
  120. package/dist/crypto/ICrypto.mjs.map +1 -1
  121. package/dist/crypto/IGuidGenerator.d.ts +4 -4
  122. package/dist/crypto/JoseHeader.d.ts +22 -22
  123. package/dist/crypto/JoseHeader.mjs +37 -37
  124. package/dist/crypto/JoseHeader.mjs.map +1 -1
  125. package/dist/crypto/PopTokenGenerator.d.ts +60 -60
  126. package/dist/crypto/PopTokenGenerator.mjs +82 -82
  127. package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
  128. package/dist/crypto/SignedHttpRequest.d.ts +15 -15
  129. package/dist/error/AuthError.d.ts +44 -44
  130. package/dist/error/AuthError.mjs +46 -46
  131. package/dist/error/AuthError.mjs.map +1 -1
  132. package/dist/error/AuthErrorCodes.d.ts +5 -5
  133. package/dist/error/AuthErrorCodes.mjs +9 -9
  134. package/dist/error/AuthErrorCodes.mjs.map +1 -1
  135. package/dist/error/ClientAuthError.d.ts +237 -237
  136. package/dist/error/ClientAuthError.mjs +249 -249
  137. package/dist/error/ClientAuthError.mjs.map +1 -1
  138. package/dist/error/ClientAuthErrorCodes.d.ts +44 -44
  139. package/dist/error/ClientAuthErrorCodes.mjs +48 -48
  140. package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
  141. package/dist/error/ClientConfigurationError.d.ts +128 -128
  142. package/dist/error/ClientConfigurationError.mjs +135 -135
  143. package/dist/error/ClientConfigurationError.mjs.map +1 -1
  144. package/dist/error/ClientConfigurationErrorCodes.d.ts +22 -22
  145. package/dist/error/ClientConfigurationErrorCodes.mjs +26 -26
  146. package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
  147. package/dist/error/InteractionRequiredAuthError.d.ts +57 -57
  148. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  149. package/dist/error/InteractionRequiredAuthError.mjs +77 -78
  150. package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
  151. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +5 -6
  152. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -1
  153. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +12 -13
  154. package/dist/error/InteractionRequiredAuthErrorCodes.mjs.map +1 -1
  155. package/dist/error/JoseHeaderError.d.ts +15 -15
  156. package/dist/error/JoseHeaderError.mjs +22 -22
  157. package/dist/error/JoseHeaderError.mjs.map +1 -1
  158. package/dist/error/JoseHeaderErrorCodes.d.ts +2 -2
  159. package/dist/error/JoseHeaderErrorCodes.mjs +6 -6
  160. package/dist/error/JoseHeaderErrorCodes.mjs.map +1 -1
  161. package/dist/error/ServerError.d.ts +7 -7
  162. package/dist/error/ServerError.mjs +14 -14
  163. package/dist/error/ServerError.mjs.map +1 -1
  164. package/dist/index.cjs +8645 -8295
  165. package/dist/index.cjs.map +1 -1
  166. package/dist/index.d.ts +99 -98
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.mjs +7 -3
  169. package/dist/index.mjs.map +1 -1
  170. package/dist/logger/Logger.d.ts +95 -95
  171. package/dist/logger/Logger.mjs +188 -188
  172. package/dist/logger/Logger.mjs.map +1 -1
  173. package/dist/network/INetworkModule.d.ts +29 -29
  174. package/dist/network/INetworkModule.mjs +12 -12
  175. package/dist/network/INetworkModule.mjs.map +1 -1
  176. package/dist/network/NetworkManager.d.ts +33 -33
  177. package/dist/network/NetworkManager.mjs +34 -34
  178. package/dist/network/NetworkManager.mjs.map +1 -1
  179. package/dist/network/RequestThumbprint.d.ts +18 -18
  180. package/dist/network/ThrottlingUtils.d.ts +42 -42
  181. package/dist/network/ThrottlingUtils.mjs +95 -95
  182. package/dist/network/ThrottlingUtils.mjs.map +1 -1
  183. package/dist/packageMetadata.d.ts +2 -2
  184. package/dist/packageMetadata.d.ts.map +1 -1
  185. package/dist/packageMetadata.mjs +4 -4
  186. package/dist/packageMetadata.mjs.map +1 -1
  187. package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
  188. package/dist/request/AuthenticationHeaderParser.mjs +55 -55
  189. package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
  190. package/dist/request/BaseAuthRequest.d.ts +43 -43
  191. package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
  192. package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
  193. package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
  194. package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
  195. package/dist/request/CommonEndSessionRequest.d.ts +21 -21
  196. package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
  197. package/dist/request/CommonRefreshTokenRequest.d.ts +22 -23
  198. package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  199. package/dist/request/CommonSilentFlowRequest.d.ts +20 -21
  200. package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
  201. package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
  202. package/dist/request/NativeRequest.d.ts +19 -19
  203. package/dist/request/NativeSignOutRequest.d.ts +5 -5
  204. package/dist/request/RequestParameterBuilder.d.ts +217 -217
  205. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  206. package/dist/request/RequestParameterBuilder.mjs +383 -382
  207. package/dist/request/RequestParameterBuilder.mjs.map +1 -1
  208. package/dist/request/RequestValidator.d.ts +33 -33
  209. package/dist/request/RequestValidator.mjs +81 -81
  210. package/dist/request/RequestValidator.mjs.map +1 -1
  211. package/dist/request/ScopeSet.d.ts +88 -88
  212. package/dist/request/ScopeSet.mjs +197 -197
  213. package/dist/request/ScopeSet.mjs.map +1 -1
  214. package/dist/request/StoreInCache.d.ts +8 -8
  215. package/dist/response/AuthenticationResult.d.ts +41 -41
  216. package/dist/response/AuthorizationCodePayload.d.ts +13 -13
  217. package/dist/response/DeviceCodeResponse.d.ts +25 -25
  218. package/dist/response/ExternalTokenResponse.d.ts +15 -15
  219. package/dist/response/IMDSBadResponse.d.ts +4 -4
  220. package/dist/response/ResponseHandler.d.ts +69 -67
  221. package/dist/response/ResponseHandler.d.ts.map +1 -1
  222. package/dist/response/ResponseHandler.mjs +339 -313
  223. package/dist/response/ResponseHandler.mjs.map +1 -1
  224. package/dist/response/ServerAuthorizationCodeResponse.d.ts +25 -25
  225. package/dist/response/ServerAuthorizationTokenResponse.d.ts +46 -46
  226. package/dist/telemetry/performance/IPerformanceClient.d.ts +51 -51
  227. package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
  228. package/dist/telemetry/performance/PerformanceClient.d.ts +191 -191
  229. package/dist/telemetry/performance/PerformanceClient.mjs +409 -409
  230. package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
  231. package/dist/telemetry/performance/PerformanceEvent.d.ts +464 -464
  232. package/dist/telemetry/performance/PerformanceEvent.mjs +253 -253
  233. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  234. package/dist/telemetry/performance/StubPerformanceClient.d.ts +24 -24
  235. package/dist/telemetry/performance/StubPerformanceClient.mjs +76 -76
  236. package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
  237. package/dist/telemetry/server/ServerTelemetryManager.d.ts +66 -66
  238. package/dist/telemetry/server/ServerTelemetryManager.mjs +201 -201
  239. package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
  240. package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
  241. package/dist/url/IUri.d.ts +12 -12
  242. package/dist/url/UrlString.d.ts +48 -48
  243. package/dist/url/UrlString.mjs +161 -161
  244. package/dist/url/UrlString.mjs.map +1 -1
  245. package/dist/utils/Constants.d.ts +296 -365
  246. package/dist/utils/Constants.d.ts.map +1 -1
  247. package/dist/utils/Constants.mjs +309 -376
  248. package/dist/utils/Constants.mjs.map +1 -1
  249. package/dist/utils/FunctionWrappers.d.ts +27 -27
  250. package/dist/utils/FunctionWrappers.mjs +84 -84
  251. package/dist/utils/FunctionWrappers.mjs.map +1 -1
  252. package/dist/utils/MsalTypes.d.ts +6 -6
  253. package/dist/utils/ProtocolUtils.d.ts +42 -42
  254. package/dist/utils/ProtocolUtils.mjs +69 -69
  255. package/dist/utils/ProtocolUtils.mjs.map +1 -1
  256. package/dist/utils/StringUtils.d.ts +40 -40
  257. package/dist/utils/StringUtils.mjs +95 -95
  258. package/dist/utils/StringUtils.mjs.map +1 -1
  259. package/dist/utils/TimeUtils.d.ts +27 -27
  260. package/dist/utils/TimeUtils.mjs +45 -45
  261. package/dist/utils/TimeUtils.mjs.map +1 -1
  262. package/dist/utils/UrlUtils.d.ts +10 -10
  263. package/dist/utils/UrlUtils.mjs +44 -44
  264. package/dist/utils/UrlUtils.mjs.map +1 -1
  265. package/package.json +93 -92
  266. package/src/account/AccountInfo.ts +96 -0
  267. package/src/account/ClientInfo.ts +2 -3
  268. package/src/account/TokenClaims.ts +28 -0
  269. package/src/authority/Authority.ts +29 -2
  270. package/src/cache/CacheManager.ts +416 -114
  271. package/src/cache/entities/AccountEntity.ts +84 -33
  272. package/src/cache/entities/RefreshTokenEntity.ts +1 -3
  273. package/src/cache/utils/CacheHelpers.ts +1 -6
  274. package/src/cache/utils/CacheTypes.ts +11 -0
  275. package/src/client/AuthorizationCodeClient.ts +4 -5
  276. package/src/client/RefreshTokenClient.ts +3 -15
  277. package/src/client/SilentFlowClient.ts +1 -1
  278. package/src/constants/AADServerParamKeys.ts +56 -0
  279. package/src/crypto/PopTokenGenerator.ts +1 -1
  280. package/src/error/InteractionRequiredAuthError.ts +0 -2
  281. package/src/error/InteractionRequiredAuthErrorCodes.ts +0 -1
  282. package/src/index.ts +17 -5
  283. package/src/packageMetadata.ts +1 -1
  284. package/src/request/CommonRefreshTokenRequest.ts +0 -1
  285. package/src/request/CommonSilentFlowRequest.ts +0 -1
  286. package/src/request/RequestParameterBuilder.ts +7 -5
  287. package/src/response/ResponseHandler.ts +95 -27
  288. package/src/utils/Constants.ts +0 -72
@@ -1,229 +1,257 @@
1
- /*! @azure/msal-common v14.4.1-beta.1 2023-11-14 */
1
+ /*! @azure/msal-common v14.5.0 2023-12-01 */
2
2
  'use strict';
3
- import { Separators, CacheAccountType, Constants } from '../../utils/Constants.mjs';
3
+ import { Separators, CacheAccountType } from '../../utils/Constants.mjs';
4
4
  import { buildClientInfo } from '../../account/ClientInfo.mjs';
5
+ import { buildTenantProfileFromIdTokenClaims } from '../../account/AccountInfo.mjs';
5
6
  import { createClientAuthError } from '../../error/ClientAuthError.mjs';
6
7
  import { AuthorityType } from '../../authority/AuthorityType.mjs';
8
+ import { getTenantIdFromIdTokenClaims } from '../../account/TokenClaims.mjs';
7
9
  import { ProtocolMode } from '../../authority/ProtocolMode.mjs';
8
10
  import { invalidCacheEnvironment } from '../../error/ClientAuthErrorCodes.mjs';
9
11
 
10
- /*
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License.
13
- */
14
- /**
15
- * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).
16
- *
17
- * Key : Value Schema
18
- *
19
- * Key: <home_account_id>-<environment>-<realm*>
20
- *
21
- * Value Schema:
22
- * {
23
- * homeAccountId: home account identifier for the auth scheme,
24
- * environment: entity that issued the token, represented as a full host
25
- * realm: Full tenant or organizational identifier that the account belongs to
26
- * localAccountId: Original tenant-specific accountID, usually used for legacy cases
27
- * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt
28
- * authorityType: Accounts authority type as a string
29
- * name: Full name for the account, including given name and family name,
30
- * lastModificationTime: last time this entity was modified in the cache
31
- * lastModificationApp:
32
- * idTokenClaims: Object containing claims parsed from ID token
33
- * nativeAccountId: Account identifier on the native device
34
- * }
35
- * @internal
36
- */
37
- class AccountEntity {
38
- /**
39
- * Generate Account Id key component as per the schema: <home_account_id>-<environment>
40
- */
41
- generateAccountId() {
42
- const accountId = [this.homeAccountId, this.environment];
43
- return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
44
- }
45
- /**
46
- * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>
47
- */
48
- generateAccountKey() {
49
- return AccountEntity.generateAccountCacheKey({
50
- homeAccountId: this.homeAccountId,
51
- environment: this.environment,
52
- tenantId: this.realm,
53
- username: this.username,
54
- localAccountId: this.localAccountId,
55
- });
56
- }
57
- /**
58
- * Returns the AccountInfo interface for this account.
59
- */
60
- getAccountInfo() {
61
- return {
62
- homeAccountId: this.homeAccountId,
63
- environment: this.environment,
64
- tenantId: this.realm,
65
- username: this.username,
66
- localAccountId: this.localAccountId,
67
- name: this.name,
68
- idTokenClaims: this.idTokenClaims,
69
- nativeAccountId: this.nativeAccountId,
70
- authorityType: this.authorityType,
71
- };
72
- }
73
- /**
74
- * Generates account key from interface
75
- * @param accountInterface
76
- */
77
- static generateAccountCacheKey(accountInterface) {
78
- const accountKey = [
79
- accountInterface.homeAccountId,
80
- accountInterface.environment || Constants.EMPTY_STRING,
81
- accountInterface.tenantId || Constants.EMPTY_STRING,
82
- ];
83
- return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
84
- }
85
- /**
86
- * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.
87
- * @param accountDetails
88
- */
89
- static createAccount(accountDetails, authority) {
90
- const account = new AccountEntity();
91
- if (authority.authorityType === AuthorityType.Adfs) {
92
- account.authorityType = CacheAccountType.ADFS_ACCOUNT_TYPE;
93
- }
94
- else if (authority.protocolMode === ProtocolMode.AAD) {
95
- account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
96
- }
97
- else {
98
- account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;
99
- }
100
- account.clientInfo = accountDetails.clientInfo;
101
- account.homeAccountId = accountDetails.homeAccountId;
102
- account.nativeAccountId = accountDetails.nativeAccountId;
103
- const env = accountDetails.environment ||
104
- (authority && authority.getPreferredCache());
105
- if (!env) {
106
- throw createClientAuthError(invalidCacheEnvironment);
107
- }
108
- account.environment = env;
109
- // non AAD scenarios can have empty realm
110
- account.realm =
111
- accountDetails.idTokenClaims.tid || Constants.EMPTY_STRING;
112
- // How do you account for MSA CID here?
113
- account.localAccountId =
114
- accountDetails.idTokenClaims.oid ||
115
- accountDetails.idTokenClaims.sub ||
116
- Constants.EMPTY_STRING;
117
- /*
118
- * In B2C scenarios the emails claim is used instead of preferred_username and it is an array.
119
- * In most cases it will contain a single email. This field should not be relied upon if a custom
120
- * policy is configured to return more than 1 email.
121
- */
122
- const preferredUsername = accountDetails.idTokenClaims.preferred_username ||
123
- accountDetails.idTokenClaims.upn;
124
- const email = accountDetails.idTokenClaims.emails
125
- ? accountDetails.idTokenClaims.emails[0]
126
- : null;
127
- account.username = preferredUsername || email || Constants.EMPTY_STRING;
128
- account.name = accountDetails.idTokenClaims.name;
129
- account.cloudGraphHostName = accountDetails.cloudGraphHostName;
130
- account.msGraphHost = accountDetails.msGraphHost;
131
- return account;
132
- }
133
- /**
134
- * Creates an AccountEntity object from AccountInfo
135
- * @param accountInfo
136
- * @param cloudGraphHostName
137
- * @param msGraphHost
138
- * @returns
139
- */
140
- static createFromAccountInfo(accountInfo, cloudGraphHostName, msGraphHost) {
141
- const account = new AccountEntity();
142
- account.authorityType =
143
- accountInfo.authorityType || CacheAccountType.GENERIC_ACCOUNT_TYPE;
144
- account.homeAccountId = accountInfo.homeAccountId;
145
- account.localAccountId = accountInfo.localAccountId;
146
- account.nativeAccountId = accountInfo.nativeAccountId;
147
- account.realm = accountInfo.tenantId;
148
- account.environment = accountInfo.environment;
149
- account.username = accountInfo.username;
150
- account.name = accountInfo.name;
151
- account.cloudGraphHostName = cloudGraphHostName;
152
- account.msGraphHost = msGraphHost;
153
- return account;
154
- }
155
- /**
156
- * Generate HomeAccountId from server response
157
- * @param serverClientInfo
158
- * @param authType
159
- */
160
- static generateHomeAccountId(serverClientInfo, authType, logger, cryptoObj, idTokenClaims) {
161
- const accountId = idTokenClaims?.sub
162
- ? idTokenClaims.sub
163
- : Constants.EMPTY_STRING;
164
- // since ADFS does not have tid and does not set client_info
165
- if (authType === AuthorityType.Adfs ||
166
- authType === AuthorityType.Dsts) {
167
- return accountId;
168
- }
169
- // for cases where there is clientInfo
170
- if (serverClientInfo) {
171
- try {
172
- const clientInfo = buildClientInfo(serverClientInfo, cryptoObj);
173
- if (clientInfo.uid && clientInfo.utid) {
174
- return `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`;
175
- }
176
- }
177
- catch (e) { }
178
- }
179
- // default to "sub" claim
180
- logger.verbose("No client info in response");
181
- return accountId;
182
- }
183
- /**
184
- * Validates an entity: checks for all expected params
185
- * @param entity
186
- */
187
- static isAccountEntity(entity) {
188
- if (!entity) {
189
- return false;
190
- }
191
- return (entity.hasOwnProperty("homeAccountId") &&
192
- entity.hasOwnProperty("environment") &&
193
- entity.hasOwnProperty("realm") &&
194
- entity.hasOwnProperty("localAccountId") &&
195
- entity.hasOwnProperty("username") &&
196
- entity.hasOwnProperty("authorityType"));
197
- }
198
- /**
199
- * Helper function to determine whether 2 accountInfo objects represent the same account
200
- * @param accountA
201
- * @param accountB
202
- * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality
203
- */
204
- static accountInfoIsEqual(accountA, accountB, compareClaims) {
205
- if (!accountA || !accountB) {
206
- return false;
207
- }
208
- let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false
209
- if (compareClaims) {
210
- const accountAClaims = (accountA.idTokenClaims ||
211
- {});
212
- const accountBClaims = (accountB.idTokenClaims ||
213
- {});
214
- // issued at timestamp and nonce are expected to change each time a new id token is acquired
215
- claimsMatch =
216
- accountAClaims.iat === accountBClaims.iat &&
217
- accountAClaims.nonce === accountBClaims.nonce;
218
- }
219
- return (accountA.homeAccountId === accountB.homeAccountId &&
220
- accountA.localAccountId === accountB.localAccountId &&
221
- accountA.username === accountB.username &&
222
- accountA.tenantId === accountB.tenantId &&
223
- accountA.environment === accountB.environment &&
224
- accountA.nativeAccountId === accountB.nativeAccountId &&
225
- claimsMatch);
226
- }
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
+ * Generate Account Id key component as per the schema: <home_account_id>-<environment>
42
+ */
43
+ generateAccountId() {
44
+ const accountId = [this.homeAccountId, this.environment];
45
+ return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
46
+ }
47
+ /**
48
+ * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>
49
+ */
50
+ generateAccountKey() {
51
+ return AccountEntity.generateAccountCacheKey({
52
+ homeAccountId: this.homeAccountId,
53
+ environment: this.environment,
54
+ tenantId: this.realm,
55
+ username: this.username,
56
+ localAccountId: this.localAccountId,
57
+ });
58
+ }
59
+ /**
60
+ * Returns the AccountInfo interface for this account.
61
+ */
62
+ getAccountInfo() {
63
+ return {
64
+ homeAccountId: this.homeAccountId,
65
+ environment: this.environment,
66
+ tenantId: this.realm,
67
+ username: this.username,
68
+ localAccountId: this.localAccountId,
69
+ name: this.name,
70
+ nativeAccountId: this.nativeAccountId,
71
+ authorityType: this.authorityType,
72
+ // Deserialize tenant profiles array into a Map
73
+ tenantProfiles: new Map((this.tenantProfiles || []).map((tenantProfile) => {
74
+ return [tenantProfile.tenantId, tenantProfile];
75
+ })),
76
+ };
77
+ }
78
+ /**
79
+ * Returns true if the account entity is in single tenant format (outdated), false otherwise
80
+ */
81
+ isSingleTenant() {
82
+ return !this.tenantProfiles;
83
+ }
84
+ /**
85
+ * Generates account key from interface
86
+ * @param accountInterface
87
+ */
88
+ static generateAccountCacheKey(accountInterface) {
89
+ const homeTenantId = accountInterface.homeAccountId.split(".")[1];
90
+ const accountKey = [
91
+ accountInterface.homeAccountId,
92
+ accountInterface.environment || "",
93
+ homeTenantId || accountInterface.tenantId || "",
94
+ ];
95
+ return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
96
+ }
97
+ /**
98
+ * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.
99
+ * @param accountDetails
100
+ */
101
+ static createAccount(accountDetails, authority, base64Decode) {
102
+ const account = new AccountEntity();
103
+ if (authority.authorityType === AuthorityType.Adfs) {
104
+ account.authorityType = CacheAccountType.ADFS_ACCOUNT_TYPE;
105
+ }
106
+ else if (authority.protocolMode === ProtocolMode.AAD) {
107
+ account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
108
+ }
109
+ else {
110
+ account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;
111
+ }
112
+ let clientInfo;
113
+ if (accountDetails.clientInfo && base64Decode) {
114
+ clientInfo = buildClientInfo(accountDetails.clientInfo, base64Decode);
115
+ }
116
+ account.clientInfo = accountDetails.clientInfo;
117
+ account.homeAccountId = accountDetails.homeAccountId;
118
+ account.nativeAccountId = accountDetails.nativeAccountId;
119
+ const env = accountDetails.environment ||
120
+ (authority && authority.getPreferredCache());
121
+ if (!env) {
122
+ throw createClientAuthError(invalidCacheEnvironment);
123
+ }
124
+ account.environment = env;
125
+ // non AAD scenarios can have empty realm
126
+ account.realm =
127
+ clientInfo?.utid ||
128
+ getTenantIdFromIdTokenClaims(accountDetails.idTokenClaims) ||
129
+ "";
130
+ // How do you account for MSA CID here?
131
+ account.localAccountId =
132
+ clientInfo?.uid ||
133
+ accountDetails.idTokenClaims.oid ||
134
+ accountDetails.idTokenClaims.sub ||
135
+ "";
136
+ /*
137
+ * In B2C scenarios the emails claim is used instead of preferred_username and it is an array.
138
+ * In most cases it will contain a single email. This field should not be relied upon if a custom
139
+ * policy is configured to return more than 1 email.
140
+ */
141
+ const preferredUsername = accountDetails.idTokenClaims.preferred_username ||
142
+ accountDetails.idTokenClaims.upn;
143
+ const email = accountDetails.idTokenClaims.emails
144
+ ? accountDetails.idTokenClaims.emails[0]
145
+ : null;
146
+ account.username = preferredUsername || email || "";
147
+ account.name = accountDetails.idTokenClaims.name;
148
+ account.cloudGraphHostName = accountDetails.cloudGraphHostName;
149
+ account.msGraphHost = accountDetails.msGraphHost;
150
+ if (accountDetails.tenantProfiles) {
151
+ account.tenantProfiles = accountDetails.tenantProfiles;
152
+ }
153
+ else {
154
+ const tenantProfiles = [];
155
+ if (accountDetails.idTokenClaims) {
156
+ const tenantProfile = buildTenantProfileFromIdTokenClaims(accountDetails.homeAccountId, accountDetails.idTokenClaims);
157
+ tenantProfiles.push(tenantProfile);
158
+ }
159
+ account.tenantProfiles = tenantProfiles;
160
+ }
161
+ return account;
162
+ }
163
+ /**
164
+ * Creates an AccountEntity object from AccountInfo
165
+ * @param accountInfo
166
+ * @param cloudGraphHostName
167
+ * @param msGraphHost
168
+ * @returns
169
+ */
170
+ static createFromAccountInfo(accountInfo, cloudGraphHostName, msGraphHost) {
171
+ const account = new AccountEntity();
172
+ account.authorityType =
173
+ accountInfo.authorityType || CacheAccountType.GENERIC_ACCOUNT_TYPE;
174
+ account.homeAccountId = accountInfo.homeAccountId;
175
+ account.localAccountId = accountInfo.localAccountId;
176
+ account.nativeAccountId = accountInfo.nativeAccountId;
177
+ account.realm = accountInfo.tenantId;
178
+ account.environment = accountInfo.environment;
179
+ account.username = accountInfo.username;
180
+ account.name = accountInfo.name;
181
+ account.cloudGraphHostName = cloudGraphHostName;
182
+ account.msGraphHost = msGraphHost;
183
+ // Serialize tenant profiles map into an array
184
+ account.tenantProfiles = Array.from(accountInfo.tenantProfiles?.values() || []);
185
+ return account;
186
+ }
187
+ /**
188
+ * Generate HomeAccountId from server response
189
+ * @param serverClientInfo
190
+ * @param authType
191
+ */
192
+ static generateHomeAccountId(serverClientInfo, authType, logger, cryptoObj, idTokenClaims) {
193
+ // since ADFS/DSTS do not have tid and does not set client_info
194
+ if (!(authType === AuthorityType.Adfs ||
195
+ authType === AuthorityType.Dsts)) {
196
+ // for cases where there is clientInfo
197
+ if (serverClientInfo) {
198
+ try {
199
+ const clientInfo = buildClientInfo(serverClientInfo, cryptoObj.base64Decode);
200
+ if (clientInfo.uid && clientInfo.utid) {
201
+ return `${clientInfo.uid}.${clientInfo.utid}`;
202
+ }
203
+ }
204
+ catch (e) { }
205
+ }
206
+ logger.warning("No client info in response");
207
+ }
208
+ // default to "sub" claim
209
+ return idTokenClaims?.sub || "";
210
+ }
211
+ /**
212
+ * Validates an entity: checks for all expected params
213
+ * @param entity
214
+ */
215
+ static isAccountEntity(entity) {
216
+ if (!entity) {
217
+ return false;
218
+ }
219
+ return (entity.hasOwnProperty("homeAccountId") &&
220
+ entity.hasOwnProperty("environment") &&
221
+ entity.hasOwnProperty("realm") &&
222
+ entity.hasOwnProperty("localAccountId") &&
223
+ entity.hasOwnProperty("username") &&
224
+ entity.hasOwnProperty("authorityType"));
225
+ }
226
+ /**
227
+ * Helper function to determine whether 2 accountInfo objects represent the same account
228
+ * @param accountA
229
+ * @param accountB
230
+ * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality
231
+ */
232
+ static accountInfoIsEqual(accountA, accountB, compareClaims) {
233
+ if (!accountA || !accountB) {
234
+ return false;
235
+ }
236
+ let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false
237
+ if (compareClaims) {
238
+ const accountAClaims = (accountA.idTokenClaims ||
239
+ {});
240
+ const accountBClaims = (accountB.idTokenClaims ||
241
+ {});
242
+ // issued at timestamp and nonce are expected to change each time a new id token is acquired
243
+ claimsMatch =
244
+ accountAClaims.iat === accountBClaims.iat &&
245
+ accountAClaims.nonce === accountBClaims.nonce;
246
+ }
247
+ return (accountA.homeAccountId === accountB.homeAccountId &&
248
+ accountA.localAccountId === accountB.localAccountId &&
249
+ accountA.username === accountB.username &&
250
+ accountA.tenantId === accountB.tenantId &&
251
+ accountA.environment === accountB.environment &&
252
+ accountA.nativeAccountId === accountB.nativeAccountId &&
253
+ claimsMatch);
254
+ }
227
255
  }
228
256
 
229
257
  export { AccountEntity };
@@ -1 +1 @@
1
- {"version":3,"file":"AccountEntity.mjs","sources":["../../../src/cache/entities/AccountEntity.ts"],"sourcesContent":[null],"names":[],"mappings":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A,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AccountEntity.mjs","sources":["../../../src/cache/entities/AccountEntity.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.invalidCacheEnvironment"],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAuBH;;;;;;;;;;;;;;;;;;;;;;AAsBG;MACU,aAAa,CAAA;AAgBtB;;AAEG;IACH,iBAAiB,GAAA;QACb,MAAM,SAAS,GAAkB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACvE;AAED;;AAEG;IACH,kBAAkB,GAAA;QACd,OAAO,aAAa,CAAC,uBAAuB,CAAC;YACzC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;AACtC,SAAA,CAAC,CAAC;KACN;AAED;;AAEG;IACH,cAAc,GAAA;QACV,OAAO;YACH,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,aAAa,EAAE,IAAI,CAAC,aAAa;;AAEjC,YAAA,cAAc,EAAE,IAAI,GAAG,CACnB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schema:
5
- *
6
- * Key: appmetadata-<environment>-<client_id>
7
- *
8
- * Value:
9
- * {
10
- * clientId: client ID of the application
11
- * environment: entity that issued the token, represented as a full host
12
- * familyId: Family ID identifier, '1' represents Microsoft Family
13
- * }
14
- */
15
- export declare class AppMetadataEntity {
16
- clientId: string;
17
- environment: string;
18
- familyId?: string;
19
- /**
20
- * Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>
21
- */
22
- generateAppMetadataKey(): string;
23
- /**
24
- * Generate AppMetadata Cache Key
25
- */
26
- static generateAppMetadataCacheKey(environment: string, clientId: string): string;
27
- /**
28
- * Creates AppMetadataEntity
29
- * @param clientId
30
- * @param environment
31
- * @param familyId
32
- */
33
- static createAppMetadataEntity(clientId: string, environment: string, familyId?: string): AppMetadataEntity;
34
- /**
35
- * Validates an entity: checks for all expected params
36
- * @param entity
37
- */
38
- static isAppMetadataEntity(key: string, entity: object): boolean;
39
- }
1
+ /**
2
+ * APP_METADATA Cache
3
+ *
4
+ * Key:Value Schema:
5
+ *
6
+ * Key: appmetadata-<environment>-<client_id>
7
+ *
8
+ * Value:
9
+ * {
10
+ * clientId: client ID of the application
11
+ * environment: entity that issued the token, represented as a full host
12
+ * familyId: Family ID identifier, '1' represents Microsoft Family
13
+ * }
14
+ */
15
+ export declare class AppMetadataEntity {
16
+ clientId: string;
17
+ environment: string;
18
+ familyId?: string;
19
+ /**
20
+ * Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>
21
+ */
22
+ generateAppMetadataKey(): string;
23
+ /**
24
+ * Generate AppMetadata Cache Key
25
+ */
26
+ static generateAppMetadataCacheKey(environment: string, clientId: string): string;
27
+ /**
28
+ * Creates AppMetadataEntity
29
+ * @param clientId
30
+ * @param environment
31
+ * @param familyId
32
+ */
33
+ static createAppMetadataEntity(clientId: string, environment: string, familyId?: string): AppMetadataEntity;
34
+ /**
35
+ * Validates an entity: checks for all expected params
36
+ * @param entity
37
+ */
38
+ static isAppMetadataEntity(key: string, entity: object): boolean;
39
+ }
40
40
  //# sourceMappingURL=AppMetadataEntity.d.ts.map