@azure/msal-common 14.1.0 → 14.3.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 (149) hide show
  1. package/dist/account/AuthToken.mjs +1 -1
  2. package/dist/account/CcsCredential.mjs +1 -1
  3. package/dist/account/ClientInfo.mjs +1 -1
  4. package/dist/authority/Authority.d.ts +25 -11
  5. package/dist/authority/Authority.d.ts.map +1 -1
  6. package/dist/authority/Authority.mjs +122 -71
  7. package/dist/authority/Authority.mjs.map +1 -1
  8. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  9. package/dist/authority/AuthorityFactory.mjs +3 -3
  10. package/dist/authority/AuthorityMetadata.d.ts +42 -162
  11. package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
  12. package/dist/authority/AuthorityMetadata.mjs +106 -384
  13. package/dist/authority/AuthorityMetadata.mjs.map +1 -1
  14. package/dist/authority/AuthorityOptions.d.ts +6 -0
  15. package/dist/authority/AuthorityOptions.d.ts.map +1 -1
  16. package/dist/authority/AuthorityOptions.mjs +1 -1
  17. package/dist/authority/AuthorityOptions.mjs.map +1 -1
  18. package/dist/authority/AuthorityType.mjs +1 -1
  19. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  20. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  21. package/dist/authority/OpenIdConfigResponse.mjs +1 -1
  22. package/dist/authority/ProtocolMode.mjs +1 -1
  23. package/dist/authority/RegionDiscovery.mjs +1 -1
  24. package/dist/cache/CacheManager.d.ts +17 -1
  25. package/dist/cache/CacheManager.d.ts.map +1 -1
  26. package/dist/cache/CacheManager.mjs +79 -37
  27. package/dist/cache/CacheManager.mjs.map +1 -1
  28. package/dist/cache/entities/AccessTokenEntity.d.ts +12 -43
  29. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  30. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  31. package/dist/cache/entities/AccountEntity.mjs +1 -3
  32. package/dist/cache/entities/AccountEntity.mjs.map +1 -1
  33. package/dist/cache/entities/AppMetadataEntity.mjs +1 -1
  34. package/dist/cache/entities/AuthorityMetadataEntity.mjs +1 -1
  35. package/dist/cache/entities/CacheRecord.mjs +1 -1
  36. package/dist/cache/entities/CredentialEntity.d.ts +15 -73
  37. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  38. package/dist/cache/entities/IdTokenEntity.d.ts +4 -30
  39. package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
  40. package/dist/cache/entities/RefreshTokenEntity.d.ts +2 -33
  41. package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
  42. package/dist/cache/entities/ServerTelemetryEntity.mjs +1 -1
  43. package/dist/cache/entities/ThrottlingEntity.mjs +1 -1
  44. package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
  45. package/dist/cache/utils/CacheHelpers.d.ts +59 -0
  46. package/dist/cache/utils/CacheHelpers.d.ts.map +1 -0
  47. package/dist/cache/utils/CacheHelpers.mjs +226 -0
  48. package/dist/cache/utils/CacheHelpers.mjs.map +1 -0
  49. package/dist/cache/utils/CacheTypes.d.ts +1 -0
  50. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  51. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  52. package/dist/client/AuthorizationCodeClient.mjs +3 -3
  53. package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
  54. package/dist/client/BaseClient.d.ts +2 -2
  55. package/dist/client/BaseClient.d.ts.map +1 -1
  56. package/dist/client/BaseClient.mjs +11 -10
  57. package/dist/client/BaseClient.mjs.map +1 -1
  58. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  59. package/dist/client/RefreshTokenClient.mjs +4 -4
  60. package/dist/client/RefreshTokenClient.mjs.map +1 -1
  61. package/dist/client/SilentFlowClient.d.ts +1 -0
  62. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  63. package/dist/client/SilentFlowClient.mjs +20 -27
  64. package/dist/client/SilentFlowClient.mjs.map +1 -1
  65. package/dist/config/ClientConfiguration.mjs +1 -1
  66. package/dist/crypto/ICrypto.mjs +1 -1
  67. package/dist/crypto/JoseHeader.mjs +1 -1
  68. package/dist/crypto/PopTokenGenerator.mjs +1 -1
  69. package/dist/error/AuthError.mjs +1 -1
  70. package/dist/error/AuthErrorCodes.mjs +1 -1
  71. package/dist/error/ClientAuthError.d.ts +5 -0
  72. package/dist/error/ClientAuthError.d.ts.map +1 -1
  73. package/dist/error/ClientAuthError.mjs +7 -2
  74. package/dist/error/ClientAuthError.mjs.map +1 -1
  75. package/dist/error/ClientAuthErrorCodes.d.ts +1 -0
  76. package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
  77. package/dist/error/ClientAuthErrorCodes.mjs +3 -2
  78. package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
  79. package/dist/error/ClientConfigurationError.mjs +1 -1
  80. package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
  81. package/dist/error/InteractionRequiredAuthError.mjs +1 -1
  82. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
  83. package/dist/error/JoseHeaderError.mjs +1 -1
  84. package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
  85. package/dist/error/ServerError.mjs +1 -1
  86. package/dist/index.cjs +5157 -5476
  87. package/dist/index.cjs.map +1 -1
  88. package/dist/index.d.ts +3 -2
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.mjs +4 -6
  91. package/dist/index.mjs.map +1 -1
  92. package/dist/logger/Logger.mjs +1 -1
  93. package/dist/network/INetworkModule.mjs +1 -1
  94. package/dist/network/NetworkManager.mjs +1 -1
  95. package/dist/network/ThrottlingUtils.mjs +1 -1
  96. package/dist/packageMetadata.d.ts +1 -1
  97. package/dist/packageMetadata.mjs +2 -2
  98. package/dist/request/AuthenticationHeaderParser.mjs +1 -1
  99. package/dist/request/RequestParameterBuilder.mjs +1 -1
  100. package/dist/request/RequestValidator.mjs +1 -1
  101. package/dist/request/ScopeSet.mjs +1 -1
  102. package/dist/response/ResponseHandler.d.ts +2 -2
  103. package/dist/response/ResponseHandler.d.ts.map +1 -1
  104. package/dist/response/ResponseHandler.mjs +30 -32
  105. package/dist/response/ResponseHandler.mjs.map +1 -1
  106. package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
  107. package/dist/telemetry/performance/PerformanceEvent.d.ts +17 -1
  108. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  109. package/dist/telemetry/performance/PerformanceEvent.mjs +9 -2
  110. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  111. package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
  112. package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
  113. package/dist/url/UrlString.mjs +1 -1
  114. package/dist/utils/Constants.mjs +1 -1
  115. package/dist/utils/FunctionWrappers.mjs +1 -1
  116. package/dist/utils/ProtocolUtils.mjs +1 -1
  117. package/dist/utils/StringUtils.mjs +1 -1
  118. package/dist/utils/TimeUtils.mjs +1 -1
  119. package/package.json +1 -1
  120. package/src/authority/Authority.ts +205 -127
  121. package/src/authority/AuthorityFactory.ts +4 -4
  122. package/src/authority/AuthorityMetadata.ts +151 -390
  123. package/src/authority/AuthorityOptions.ts +9 -0
  124. package/src/cache/CacheManager.ts +115 -56
  125. package/src/cache/entities/AccessTokenEntity.ts +13 -149
  126. package/src/cache/entities/AccountEntity.ts +0 -3
  127. package/src/cache/entities/CredentialEntity.ts +16 -200
  128. package/src/cache/entities/IdTokenEntity.ts +4 -64
  129. package/src/cache/entities/RefreshTokenEntity.ts +2 -69
  130. package/src/cache/utils/CacheHelpers.ts +306 -0
  131. package/src/cache/utils/CacheTypes.ts +1 -0
  132. package/src/client/AuthorizationCodeClient.ts +10 -4
  133. package/src/client/BaseClient.ts +29 -15
  134. package/src/client/RefreshTokenClient.ts +17 -7
  135. package/src/client/SilentFlowClient.ts +49 -49
  136. package/src/error/ClientAuthError.ts +8 -0
  137. package/src/error/ClientAuthErrorCodes.ts +1 -0
  138. package/src/index.ts +7 -1
  139. package/src/packageMetadata.ts +1 -1
  140. package/src/response/ResponseHandler.ts +45 -44
  141. package/src/telemetry/performance/PerformanceEvent.ts +24 -2
  142. package/dist/cache/entities/AccessTokenEntity.mjs +0 -121
  143. package/dist/cache/entities/AccessTokenEntity.mjs.map +0 -1
  144. package/dist/cache/entities/CredentialEntity.mjs +0 -145
  145. package/dist/cache/entities/CredentialEntity.mjs.map +0 -1
  146. package/dist/cache/entities/IdTokenEntity.mjs +0 -64
  147. package/dist/cache/entities/IdTokenEntity.mjs.map +0 -1
  148. package/dist/cache/entities/RefreshTokenEntity.mjs +0 -67
  149. package/dist/cache/entities/RefreshTokenEntity.mjs.map +0 -1
@@ -1,121 +0,0 @@
1
- /*! @azure/msal-common v14.1.0 2023-10-05 */
2
- 'use strict';
3
- import { CredentialEntity } from './CredentialEntity.mjs';
4
- import { CredentialType, AuthenticationScheme } from '../../utils/Constants.mjs';
5
- import { TimeUtils } from '../../utils/TimeUtils.mjs';
6
- import { createClientAuthError } from '../../error/ClientAuthError.mjs';
7
- import { extractTokenClaims } from '../../account/AuthToken.mjs';
8
- import { tokenClaimsCnfRequiredForSignedJwt } from '../../error/ClientAuthErrorCodes.mjs';
9
-
10
- /*
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License.
13
- */
14
- /**
15
- * ACCESS_TOKEN Credential Type
16
- *
17
- * Key:Value Schema:
18
- *
19
- * Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read
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
- * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
26
- * clientId: client ID of the application
27
- * secret: Actual credential as a string
28
- * familyId: Family ID identifier, usually only used for refresh tokens
29
- * realm: Full tenant or organizational identifier that the account belongs to
30
- * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
31
- * cachedAt: Absolute device time when entry was created in the cache.
32
- * expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.
33
- * extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.
34
- * keyId: used for POP and SSH tokenTypes
35
- * tokenType: Type of the token issued. Usually "Bearer"
36
- * }
37
- */
38
- class AccessTokenEntity extends CredentialEntity {
39
- /**
40
- * Create AccessTokenEntity
41
- * @param homeAccountId
42
- * @param environment
43
- * @param accessToken
44
- * @param clientId
45
- * @param tenantId
46
- * @param scopes
47
- * @param expiresOn
48
- * @param extExpiresOn
49
- */
50
- static createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {
51
- const atEntity = new AccessTokenEntity();
52
- atEntity.homeAccountId = homeAccountId;
53
- atEntity.credentialType = CredentialType.ACCESS_TOKEN;
54
- atEntity.secret = accessToken;
55
- const currentTime = TimeUtils.nowSeconds();
56
- atEntity.cachedAt = currentTime.toString();
57
- /*
58
- * Token expiry time.
59
- * This value should be  calculated based on the current UTC time measured locally and the value  expires_in Represented as a string in JSON.
60
- */
61
- atEntity.expiresOn = expiresOn.toString();
62
- atEntity.extendedExpiresOn = extExpiresOn.toString();
63
- if (refreshOn) {
64
- atEntity.refreshOn = refreshOn.toString();
65
- }
66
- atEntity.environment = environment;
67
- atEntity.clientId = clientId;
68
- atEntity.realm = tenantId;
69
- atEntity.target = scopes;
70
- atEntity.userAssertionHash = userAssertionHash;
71
- atEntity.tokenType = tokenType || AuthenticationScheme.BEARER;
72
- if (requestedClaims) {
73
- atEntity.requestedClaims = requestedClaims;
74
- atEntity.requestedClaimsHash = requestedClaimsHash;
75
- }
76
- /*
77
- * Create Access Token With Auth Scheme instead of regular access token
78
- * Cast to lower to handle "bearer" from ADFS
79
- */
80
- if (atEntity.tokenType?.toLowerCase() !==
81
- AuthenticationScheme.BEARER.toLowerCase()) {
82
- atEntity.credentialType =
83
- CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
84
- switch (atEntity.tokenType) {
85
- case AuthenticationScheme.POP:
86
- // Make sure keyId is present and add it to credential
87
- const tokenClaims = extractTokenClaims(accessToken, cryptoUtils.base64Decode);
88
- if (!tokenClaims?.cnf?.kid) {
89
- throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
90
- }
91
- atEntity.keyId = tokenClaims.cnf.kid;
92
- break;
93
- case AuthenticationScheme.SSH:
94
- atEntity.keyId = keyId;
95
- }
96
- }
97
- return atEntity;
98
- }
99
- /**
100
- * Validates an entity: checks for all expected params
101
- * @param entity
102
- */
103
- static isAccessTokenEntity(entity) {
104
- if (!entity) {
105
- return false;
106
- }
107
- return (entity.hasOwnProperty("homeAccountId") &&
108
- entity.hasOwnProperty("environment") &&
109
- entity.hasOwnProperty("credentialType") &&
110
- entity.hasOwnProperty("realm") &&
111
- entity.hasOwnProperty("clientId") &&
112
- entity.hasOwnProperty("secret") &&
113
- entity.hasOwnProperty("target") &&
114
- (entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
115
- entity["credentialType"] ===
116
- CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
117
- }
118
- }
119
-
120
- export { AccessTokenEntity };
121
- //# sourceMappingURL=AccessTokenEntity.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccessTokenEntity.mjs","sources":["../../../src/cache/entities/AccessTokenEntity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAKA;AACA;AAEA;AAQA;;;;;;;;;;;;;;;;;;AAuBG;AACH;;;;;;AAMa,MAAA,iBAAU,SAAA,gBAAA,CAAA;;;;;AAMnB;;;;;;;;;;AAUG,QAAA,QAAA,CAAA,cAAA,GAAA,cAAA,CAAA,YAAA,CAAA;AACH,QAAA,QAAO,CAAA,MAAA,GAAA,WACH,CAAA;AAgFJ,QAAA,MAAA,WAAA,GAAA,SAAA,CAAA,UAAA,EAAA,CAAA;;;AAGG;AACH;AAkBH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,145 +0,0 @@
1
- /*! @azure/msal-common v14.1.0 2023-10-05 */
2
- 'use strict';
3
- import { CredentialType, CacheType, Separators, Constants, AuthenticationScheme } from '../../utils/Constants.mjs';
4
- import { createClientAuthError } from '../../error/ClientAuthError.mjs';
5
- import { unexpectedCredentialType } from '../../error/ClientAuthErrorCodes.mjs';
6
-
7
- /*
8
- * Copyright (c) Microsoft Corporation. All rights reserved.
9
- * Licensed under the MIT License.
10
- */
11
- /**
12
- * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc
13
- *
14
- * Key:Value Schema:
15
- *
16
- * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>
17
- *
18
- * Value Schema:
19
- * {
20
- * homeAccountId: home account identifier for the auth scheme,
21
- * environment: entity that issued the token, represented as a full host
22
- * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
23
- * clientId: client ID of the application
24
- * secret: Actual credential as a string
25
- * familyId: Family ID identifier, usually only used for refresh tokens
26
- * realm: Full tenant or organizational identifier that the account belongs to
27
- * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
28
- * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
29
- * requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request
30
- * userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow
31
- * }
32
- */
33
- class CredentialEntity {
34
- /**
35
- * Generate Account Id key component as per the schema: <home_account_id>-<environment>
36
- */
37
- generateAccountId() {
38
- return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);
39
- }
40
- /**
41
- * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>
42
- */
43
- generateCredentialId() {
44
- return CredentialEntity.generateCredentialIdForCacheKey(this.credentialType, this.clientId, this.realm, this.familyId);
45
- }
46
- /**
47
- * Generate target key component as per schema: <target>
48
- */
49
- generateTarget() {
50
- return CredentialEntity.generateTargetForCacheKey(this.target);
51
- }
52
- /**
53
- * generates credential key
54
- */
55
- generateCredentialKey() {
56
- return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType, this.requestedClaimsHash);
57
- }
58
- /**
59
- * returns the type of the cache (in this case credential)
60
- */
61
- generateType() {
62
- switch (this.credentialType) {
63
- case CredentialType.ID_TOKEN:
64
- return CacheType.ID_TOKEN;
65
- case CredentialType.ACCESS_TOKEN:
66
- case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
67
- return CacheType.ACCESS_TOKEN;
68
- case CredentialType.REFRESH_TOKEN:
69
- return CacheType.REFRESH_TOKEN;
70
- default: {
71
- throw createClientAuthError(unexpectedCredentialType);
72
- }
73
- }
74
- }
75
- /**
76
- * generates credential key
77
- * <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
78
- */
79
- static generateCredentialCacheKey(homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType, requestedClaimsHash) {
80
- const credentialKey = [
81
- this.generateAccountIdForCacheKey(homeAccountId, environment),
82
- this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),
83
- this.generateTargetForCacheKey(target),
84
- this.generateClaimsHashForCacheKey(requestedClaimsHash),
85
- this.generateSchemeForCacheKey(tokenType),
86
- ];
87
- return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
88
- }
89
- /**
90
- * generates Account Id for keys
91
- * @param homeAccountId
92
- * @param environment
93
- */
94
- static generateAccountIdForCacheKey(homeAccountId, environment) {
95
- const accountId = [homeAccountId, environment];
96
- return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
97
- }
98
- /**
99
- * Generates Credential Id for keys
100
- * @param credentialType
101
- * @param realm
102
- * @param clientId
103
- * @param familyId
104
- */
105
- static generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId) {
106
- const clientOrFamilyId = credentialType === CredentialType.REFRESH_TOKEN
107
- ? familyId || clientId
108
- : clientId;
109
- const credentialId = [
110
- credentialType,
111
- clientOrFamilyId,
112
- realm || Constants.EMPTY_STRING,
113
- ];
114
- return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
115
- }
116
- /**
117
- * Generate target key component as per schema: <target>
118
- */
119
- static generateTargetForCacheKey(scopes) {
120
- return (scopes || Constants.EMPTY_STRING).toLowerCase();
121
- }
122
- /**
123
- * Generate requested claims key component as per schema: <requestedClaims>
124
- */
125
- static generateClaimsHashForCacheKey(requestedClaimsHash) {
126
- return (requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();
127
- }
128
- /**
129
- * Generate scheme key componenet as per schema: <scheme>
130
- */
131
- static generateSchemeForCacheKey(tokenType) {
132
- /*
133
- * PoP Tokens and SSH certs include scheme in cache key
134
- * Cast to lowercase to handle "bearer" from ADFS
135
- */
136
- return tokenType &&
137
- tokenType.toLowerCase() !==
138
- AuthenticationScheme.BEARER.toLowerCase()
139
- ? tokenType.toLowerCase()
140
- : Constants.EMPTY_STRING;
141
- }
142
- }
143
-
144
- export { CredentialEntity };
145
- //# sourceMappingURL=CredentialEntity.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CredentialEntity.mjs","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.unexpectedCredentialType"],"mappings":";;;;;;AAKA;AAYA;;;;;;;;;;;;;;;;;;;AAqBG;AACH;;;;;AAKU,sBAAS,CAAA;;;;IAIf,iBAAiB,GAAG;QACX,OAAG,gBAAA,CAAA,4BAAqB,CAAA,IAAA,CAAA,aAAA,EAAA,IAAA,CAAA,WAAA,CAAA,CAAA;KAC5B;;AAGL;;AAEG,IAAA,oBAAA,GAAA;AACH,QAAA,OAAA,gBAA2B,CAAA,+BAAA,CAAA,IAAA,CAAA,cAAA,EAAA,IAAA,CAAA,QAAA,EAAA,IAAA,CAAA,KAAA,EAAA,IAAA,CAAA,QAAA,CAAA,CAAA;AAO3B,KAAA;;AAEG;AACH;AASA,IAAA,cAAA,GAAA;;AAEG,KAAA;AACH;AAIA;;AAEG,IAAA,qBAAA,GAAA;AACH,QAAA,OAAA,gBAA+B,CAAA,0BAAA,CAAA,IAAA,CAAA,aAAA,EAAA,IAAA,CAAA,WAAA,EAAA,IAAA,CAAA,cAAA,EAAA,IAAA,CAAA,QAAA,EAAA,IAAA,CAAA,KAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,QAAA,EAAA,IAAA,CAAA,SAAA,EAAA,IAAA,CAAA,mBAAA,CAAA,CAAA;AAc/B,KAAA;;AAEG;AACH;AAiBA,IAAA,YAAA,GAAA;;;AAGG,gBAAA,OAAA,SAAA,CAAA,QAAA,CAAA;4CAEC,CAAA;AA0BJ,YAAA,KAAA,cAAA,CAAA,6BAAA;;;;AAIG,YAAA,SAAA;gBACW,MAA6B,qBAAA,CAAAA,wBAAA,CAAA,CAAA;AAQ3C,aAAA;;;;;;AAMG;IACH,OAAO,0BAAuC,CAAA,aAAA,EAAA,WAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,SAAA,EAAA,mBAAA,EAAA;AAmB9C,QAAA,MAAA,aAAA,GAAA;;AAEG,YAAA,IAAA,CAAA,+BAAA,CAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,QAAA,CAAA;YACK,IAAM,CAAA,yBAA0B,CAAA,MAAA,CAAA;AAIxC,YAAA,IAAA,CAAA,6BAAA,CAAA,mBAAA,CAAA;;AAEG,SAAA,CAAA;QACI,OAAO,aAA8B,CAAA,IAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,CAAA,WAAA,EAAA,CAAA;AAM5C,KAAA;;AAEG;;AAYN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,64 +0,0 @@
1
- /*! @azure/msal-common v14.1.0 2023-10-05 */
2
- 'use strict';
3
- import { CredentialEntity } from './CredentialEntity.mjs';
4
- import { CredentialType } from '../../utils/Constants.mjs';
5
-
6
- /*
7
- * Copyright (c) Microsoft Corporation. All rights reserved.
8
- * Licensed under the MIT License.
9
- */
10
- /**
11
- * ID_TOKEN Cache
12
- *
13
- * Key:Value Schema:
14
- *
15
- * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-
16
- *
17
- * Value Schema:
18
- * {
19
- * homeAccountId: home account identifier for the auth scheme,
20
- * environment: entity that issued the token, represented as a full host
21
- * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
22
- * clientId: client ID of the application
23
- * secret: Actual credential as a string
24
- * realm: Full tenant or organizational identifier that the account belongs to
25
- * }
26
- */
27
- class IdTokenEntity extends CredentialEntity {
28
- /**
29
- * Create IdTokenEntity
30
- * @param homeAccountId
31
- * @param authenticationResult
32
- * @param clientId
33
- * @param authority
34
- */
35
- static createIdTokenEntity(homeAccountId, environment, idToken, clientId, tenantId) {
36
- const idTokenEntity = new IdTokenEntity();
37
- idTokenEntity.credentialType = CredentialType.ID_TOKEN;
38
- idTokenEntity.homeAccountId = homeAccountId;
39
- idTokenEntity.environment = environment;
40
- idTokenEntity.clientId = clientId;
41
- idTokenEntity.secret = idToken;
42
- idTokenEntity.realm = tenantId;
43
- return idTokenEntity;
44
- }
45
- /**
46
- * Validates an entity: checks for all expected params
47
- * @param entity
48
- */
49
- static isIdTokenEntity(entity) {
50
- if (!entity) {
51
- return false;
52
- }
53
- return (entity.hasOwnProperty("homeAccountId") &&
54
- entity.hasOwnProperty("environment") &&
55
- entity.hasOwnProperty("credentialType") &&
56
- entity.hasOwnProperty("realm") &&
57
- entity.hasOwnProperty("clientId") &&
58
- entity.hasOwnProperty("secret") &&
59
- entity["credentialType"] === CredentialType.ID_TOKEN);
60
- }
61
- }
62
-
63
- export { IdTokenEntity };
64
- //# sourceMappingURL=IdTokenEntity.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdTokenEntity.mjs","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;AAGA;;;;;;;;;;;;;;AAgBG;AACH;;AAGI;;;;;;AAMG;;AAoBH;;;AAGG,IAAA,OAAA,mBAAA,CAAA,aAAA,EAAA,WAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA;AACH,QAAA,MAAsB,aAAC,OAAQ,aAAgB,EAAA,CAAA;AAelD,QAAA,aAAA,CAAA,cAAA,GAAA,cAAA,CAAA,QAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,67 +0,0 @@
1
- /*! @azure/msal-common v14.1.0 2023-10-05 */
2
- 'use strict';
3
- import { CredentialEntity } from './CredentialEntity.mjs';
4
- import { CredentialType } from '../../utils/Constants.mjs';
5
-
6
- /*
7
- * Copyright (c) Microsoft Corporation. All rights reserved.
8
- * Licensed under the MIT License.
9
- */
10
- /**
11
- * REFRESH_TOKEN Cache
12
- *
13
- * Key:Value Schema:
14
- *
15
- * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--
16
- *
17
- * Value:
18
- * {
19
- * homeAccountId: home account identifier for the auth scheme,
20
- * environment: entity that issued the token, represented as a full host
21
- * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
22
- * clientId: client ID of the application
23
- * secret: Actual credential as a string
24
- * familyId: Family ID identifier, '1' represents Microsoft Family
25
- * realm: Full tenant or organizational identifier that the account belongs to
26
- * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
27
- * }
28
- */
29
- class RefreshTokenEntity extends CredentialEntity {
30
- /**
31
- * Create RefreshTokenEntity
32
- * @param homeAccountId
33
- * @param authenticationResult
34
- * @param clientId
35
- * @param authority
36
- */
37
- static createRefreshTokenEntity(homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash) {
38
- const rtEntity = new RefreshTokenEntity();
39
- rtEntity.clientId = clientId;
40
- rtEntity.credentialType = CredentialType.REFRESH_TOKEN;
41
- rtEntity.environment = environment;
42
- rtEntity.homeAccountId = homeAccountId;
43
- rtEntity.secret = refreshToken;
44
- rtEntity.userAssertionHash = userAssertionHash;
45
- if (familyId)
46
- rtEntity.familyId = familyId;
47
- return rtEntity;
48
- }
49
- /**
50
- * Validates an entity: checks for all expected params
51
- * @param entity
52
- */
53
- static isRefreshTokenEntity(entity) {
54
- if (!entity) {
55
- return false;
56
- }
57
- return (entity.hasOwnProperty("homeAccountId") &&
58
- entity.hasOwnProperty("environment") &&
59
- entity.hasOwnProperty("credentialType") &&
60
- entity.hasOwnProperty("clientId") &&
61
- entity.hasOwnProperty("secret") &&
62
- entity["credentialType"] === CredentialType.REFRESH_TOKEN);
63
- }
64
- }
65
-
66
- export { RefreshTokenEntity };
67
- //# sourceMappingURL=RefreshTokenEntity.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RefreshTokenEntity.mjs","sources":["../../../src/cache/entities/RefreshTokenEntity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKA;AAGA;;;;;;;;;;;;;;;;AAkBG;AACH;;AAGI;;;;;;AAMG;AACH;AAsBA;;;AAGG,IAAA,OAAA,wBAAA,CAAA,aAAA,EAAA,WAAA,EAAA,YAAA,EAAA,QAAA,EAAA,QAAA,EAAA,iBAAA,EAAA;AACH,QAAA,MAA2B,QAAA,GAAA,IAAA,oBAAkB,CAAO;AAcvD,QAAA,QAAA,CAAA,QAAA,GAAA,QAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}