@azure/msal-browser 2.18.0 → 2.22.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 (182) hide show
  1. package/CHANGELOG.json +1758 -1548
  2. package/CHANGELOG.md +553 -491
  3. package/LICENSE +21 -21
  4. package/README.md +5 -3
  5. package/dist/_virtual/_tslib.js +1 -1
  6. package/dist/app/ClientApplication.d.ts +30 -1
  7. package/dist/app/ClientApplication.d.ts.map +1 -1
  8. package/dist/app/ClientApplication.js +101 -5
  9. package/dist/app/ClientApplication.js.map +1 -1
  10. package/dist/app/IPublicClientApplication.d.ts +4 -0
  11. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  12. package/dist/app/IPublicClientApplication.js +7 -1
  13. package/dist/app/IPublicClientApplication.js.map +1 -1
  14. package/dist/app/PublicClientApplication.d.ts +2 -2
  15. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  16. package/dist/app/PublicClientApplication.js +31 -24
  17. package/dist/app/PublicClientApplication.js.map +1 -1
  18. package/dist/cache/AsyncMemoryStorage.d.ts +46 -0
  19. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -0
  20. package/dist/cache/AsyncMemoryStorage.js +195 -0
  21. package/dist/cache/AsyncMemoryStorage.js.map +1 -0
  22. package/dist/cache/BrowserCacheManager.d.ts +19 -13
  23. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  24. package/dist/cache/BrowserCacheManager.js +31 -7
  25. package/dist/cache/BrowserCacheManager.js.map +1 -1
  26. package/dist/cache/BrowserStorage.d.ts +1 -1
  27. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  28. package/dist/cache/BrowserStorage.js +1 -1
  29. package/dist/cache/BrowserStorage.js.map +1 -1
  30. package/dist/cache/DatabaseStorage.d.ts +25 -6
  31. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  32. package/dist/cache/DatabaseStorage.js +127 -81
  33. package/dist/cache/DatabaseStorage.js.map +1 -1
  34. package/dist/cache/IAsyncMemoryStorage.d.ts +28 -0
  35. package/dist/cache/IAsyncMemoryStorage.d.ts.map +1 -0
  36. package/dist/cache/IWindowStorage.d.ts +3 -3
  37. package/dist/cache/IWindowStorage.d.ts.map +1 -1
  38. package/dist/cache/MemoryStorage.d.ts +3 -3
  39. package/dist/cache/MemoryStorage.d.ts.map +1 -1
  40. package/dist/cache/MemoryStorage.js +1 -1
  41. package/dist/cache/MemoryStorage.js.map +1 -1
  42. package/dist/cache/TokenCache.d.ts.map +1 -1
  43. package/dist/cache/TokenCache.js +4 -3
  44. package/dist/cache/TokenCache.js.map +1 -1
  45. package/dist/config/Configuration.d.ts +10 -9
  46. package/dist/config/Configuration.d.ts.map +1 -1
  47. package/dist/config/Configuration.js +7 -3
  48. package/dist/config/Configuration.js.map +1 -1
  49. package/dist/crypto/BrowserCrypto.d.ts +3 -1
  50. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  51. package/dist/crypto/BrowserCrypto.js +3 -2
  52. package/dist/crypto/BrowserCrypto.js.map +1 -1
  53. package/dist/crypto/CryptoOps.d.ts +16 -5
  54. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  55. package/dist/crypto/CryptoOps.js +58 -17
  56. package/dist/crypto/CryptoOps.js.map +1 -1
  57. package/dist/crypto/GuidGenerator.js +1 -1
  58. package/dist/crypto/GuidGenerator.js.map +1 -1
  59. package/dist/crypto/PkceGenerator.js +1 -1
  60. package/dist/crypto/PkceGenerator.js.map +1 -1
  61. package/dist/crypto/SignedHttpRequest.d.ts +6 -2
  62. package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
  63. package/dist/crypto/SignedHttpRequest.js +11 -5
  64. package/dist/crypto/SignedHttpRequest.js.map +1 -1
  65. package/dist/encode/Base64Decode.js +1 -1
  66. package/dist/encode/Base64Decode.js.map +1 -1
  67. package/dist/encode/Base64Encode.js +1 -1
  68. package/dist/encode/Base64Encode.js.map +1 -1
  69. package/dist/error/BrowserAuthError.d.ts +16 -0
  70. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  71. package/dist/error/BrowserAuthError.js +22 -2
  72. package/dist/error/BrowserAuthError.js.map +1 -1
  73. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  74. package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
  75. package/dist/event/EventHandler.js +1 -1
  76. package/dist/event/EventHandler.js.map +1 -1
  77. package/dist/event/EventMessage.js +1 -1
  78. package/dist/event/EventMessage.js.map +1 -1
  79. package/dist/event/EventType.d.ts +3 -0
  80. package/dist/event/EventType.d.ts.map +1 -1
  81. package/dist/event/EventType.js +4 -1
  82. package/dist/event/EventType.js.map +1 -1
  83. package/dist/index.cjs.js +1473 -511
  84. package/dist/index.cjs.js.map +1 -1
  85. package/dist/index.d.ts +16 -3
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +14 -3
  88. package/dist/index.js.map +1 -1
  89. package/dist/interaction_client/BaseInteractionClient.d.ts +2 -2
  90. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  91. package/dist/interaction_client/BaseInteractionClient.js +40 -17
  92. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  93. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +5 -0
  94. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -0
  95. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +21 -0
  96. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -0
  97. package/dist/interaction_client/PopupClient.d.ts +4 -3
  98. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  99. package/dist/interaction_client/PopupClient.js +23 -21
  100. package/dist/interaction_client/PopupClient.js.map +1 -1
  101. package/dist/interaction_client/RedirectClient.d.ts +3 -3
  102. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  103. package/dist/interaction_client/RedirectClient.js +22 -20
  104. package/dist/interaction_client/RedirectClient.js.map +1 -1
  105. package/dist/interaction_client/SilentAuthCodeClient.d.ts +22 -0
  106. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -0
  107. package/dist/interaction_client/SilentAuthCodeClient.js +83 -0
  108. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -0
  109. package/dist/interaction_client/SilentCacheClient.d.ts +3 -3
  110. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  111. package/dist/interaction_client/SilentCacheClient.js +15 -5
  112. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  113. package/dist/interaction_client/SilentIframeClient.d.ts +3 -3
  114. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  115. package/dist/interaction_client/SilentIframeClient.js +16 -13
  116. package/dist/interaction_client/SilentIframeClient.js.map +1 -1
  117. package/dist/interaction_client/SilentRefreshClient.d.ts +2 -2
  118. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  119. package/dist/interaction_client/SilentRefreshClient.js +13 -10
  120. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  121. package/dist/interaction_client/StandardInteractionClient.d.ts +11 -11
  122. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  123. package/dist/interaction_client/StandardInteractionClient.js +90 -57
  124. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  125. package/dist/interaction_handler/InteractionHandler.d.ts +11 -2
  126. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  127. package/dist/interaction_handler/InteractionHandler.js +36 -10
  128. package/dist/interaction_handler/InteractionHandler.js.map +1 -1
  129. package/dist/interaction_handler/PopupHandler.d.ts.map +1 -1
  130. package/dist/interaction_handler/PopupHandler.js +1 -3
  131. package/dist/interaction_handler/PopupHandler.js.map +1 -1
  132. package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
  133. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  134. package/dist/interaction_handler/RedirectHandler.js +2 -3
  135. package/dist/interaction_handler/RedirectHandler.js.map +1 -1
  136. package/dist/interaction_handler/SilentHandler.js +1 -1
  137. package/dist/interaction_handler/SilentHandler.js.map +1 -1
  138. package/dist/navigation/NavigationClient.js +1 -1
  139. package/dist/navigation/NavigationClient.js.map +1 -1
  140. package/dist/network/FetchClient.js +1 -1
  141. package/dist/network/FetchClient.js.map +1 -1
  142. package/dist/network/XhrClient.js +1 -1
  143. package/dist/network/XhrClient.js.map +1 -1
  144. package/dist/packageMetadata.d.ts +1 -1
  145. package/dist/packageMetadata.js +2 -2
  146. package/dist/packageMetadata.js.map +1 -1
  147. package/dist/request/AuthorizationCodeRequest.d.ts +8 -0
  148. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -0
  149. package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
  150. package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
  151. package/dist/request/EndSessionPopupRequest.d.ts +1 -0
  152. package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
  153. package/dist/request/EndSessionRequest.d.ts +1 -0
  154. package/dist/request/EndSessionRequest.d.ts.map +1 -1
  155. package/dist/request/PopupRequest.d.ts +1 -1
  156. package/dist/request/PopupRequest.d.ts.map +1 -1
  157. package/dist/request/RedirectRequest.d.ts +1 -1
  158. package/dist/request/RedirectRequest.d.ts.map +1 -1
  159. package/dist/request/SilentRequest.d.ts +1 -1
  160. package/dist/request/SilentRequest.d.ts.map +1 -1
  161. package/dist/request/SsoSilentRequest.d.ts +1 -1
  162. package/dist/request/SsoSilentRequest.d.ts.map +1 -1
  163. package/dist/utils/BrowserConstants.d.ts +6 -1
  164. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  165. package/dist/utils/BrowserConstants.js +9 -3
  166. package/dist/utils/BrowserConstants.js.map +1 -1
  167. package/dist/utils/BrowserProtocolUtils.js +1 -1
  168. package/dist/utils/BrowserProtocolUtils.js.map +1 -1
  169. package/dist/utils/BrowserStringUtils.js +1 -1
  170. package/dist/utils/BrowserStringUtils.js.map +1 -1
  171. package/dist/utils/BrowserUtils.js +1 -1
  172. package/dist/utils/BrowserUtils.js.map +1 -1
  173. package/dist/utils/MathUtils.js +1 -1
  174. package/dist/utils/MathUtils.js.map +1 -1
  175. package/dist/utils/PopupUtils.d.ts +1 -2
  176. package/dist/utils/PopupUtils.d.ts.map +1 -1
  177. package/dist/utils/PopupUtils.js +3 -3
  178. package/dist/utils/PopupUtils.js.map +1 -1
  179. package/lib/msal-browser.js +1473 -511
  180. package/lib/msal-browser.js.map +1 -1
  181. package/lib/msal-browser.min.js +36 -31
  182. package/package.json +96 -94
@@ -1,9 +1,9 @@
1
- /*! @azure/msal-browser v2.18.0 2021-10-05 */
1
+ /*! @azure/msal-browser v2.22.0 2022-02-08 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
- import { AuthError, UrlString } from '@azure/msal-common';
4
+ import { UrlString, AuthError } from '@azure/msal-common';
5
5
  import { StandardInteractionClient } from './StandardInteractionClient.js';
6
- import { InteractionType, ApiId, TemporaryCacheKeys } from '../utils/BrowserConstants.js';
6
+ import { TemporaryCacheKeys, ApiId, InteractionType } from '../utils/BrowserConstants.js';
7
7
  import { RedirectHandler } from '../interaction_handler/RedirectHandler.js';
8
8
  import { BrowserUtils } from '../utils/BrowserUtils.js';
9
9
  import { EventType } from '../event/EventType.js';
@@ -27,22 +27,24 @@ var RedirectClient = /** @class */ (function (_super) {
27
27
  var validRequest, serverTelemetryManager, authCodeRequest, authClient, interactionHandler, navigateUrl, redirectStartPage, e_1;
28
28
  return __generator(this, function (_a) {
29
29
  switch (_a.label) {
30
- case 0:
31
- validRequest = this.preflightInteractiveRequest(request, InteractionType.Redirect);
32
- serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
33
- _a.label = 1;
30
+ case 0: return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Redirect)];
34
31
  case 1:
35
- _a.trys.push([1, 6, , 7]);
36
- return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
32
+ validRequest = _a.sent();
33
+ this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
34
+ serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
35
+ _a.label = 2;
37
36
  case 2:
38
- authCodeRequest = _a.sent();
39
- return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority)];
37
+ _a.trys.push([2, 7, , 8]);
38
+ return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];
40
39
  case 3:
40
+ authCodeRequest = _a.sent();
41
+ return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];
42
+ case 4:
41
43
  authClient = _a.sent();
42
44
  this.logger.verbose("Auth code client created");
43
45
  interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto);
44
46
  return [4 /*yield*/, authClient.getAuthCodeUrl(validRequest)];
45
- case 4:
47
+ case 5:
46
48
  navigateUrl = _a.sent();
47
49
  redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);
48
50
  this.logger.verbosePii("Redirect start page: " + redirectStartPage);
@@ -52,10 +54,10 @@ var RedirectClient = /** @class */ (function (_super) {
52
54
  redirectStartPage: redirectStartPage,
53
55
  onRedirectNavigate: request.onRedirectNavigate
54
56
  })];
55
- case 5:
57
+ case 6:
56
58
  // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.
57
59
  return [2 /*return*/, _a.sent()];
58
- case 6:
60
+ case 7:
59
61
  e_1 = _a.sent();
60
62
  if (e_1 instanceof AuthError) {
61
63
  e_1.setCorrelationId(this.correlationId);
@@ -63,7 +65,7 @@ var RedirectClient = /** @class */ (function (_super) {
63
65
  serverTelemetryManager.cacheFailedRequest(e_1);
64
66
  this.browserStorage.cleanRequestByState(validRequest.state);
65
67
  throw e_1;
66
- case 7: return [2 /*return*/];
68
+ case 8: return [2 /*return*/];
67
69
  }
68
70
  });
69
71
  });
@@ -98,7 +100,6 @@ var RedirectClient = /** @class */ (function (_super) {
98
100
  state = void 0;
99
101
  try {
100
102
  state = this.validateAndExtractStateFromHash(responseHash, InteractionType.Redirect);
101
- BrowserUtils.clearHash(window);
102
103
  this.logger.verbose("State extracted from hash");
103
104
  }
104
105
  catch (e) {
@@ -125,7 +126,7 @@ var RedirectClient = /** @class */ (function (_super) {
125
126
  this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash");
126
127
  return [2 /*return*/, this.handleHash(responseHash, state, serverTelemetryManager)];
127
128
  case 4:
128
- if (!!BrowserUtils.isInIframe()) return [3 /*break*/, 9];
129
+ if (!(!BrowserUtils.isInIframe() || this.config.system.allowRedirectInIframe)) return [3 /*break*/, 9];
129
130
  /*
130
131
  * Returned from authority using redirect - need to perform navigation before processing response
131
132
  * Cache the hash to be retrieved after the next redirect
@@ -182,12 +183,13 @@ var RedirectClient = /** @class */ (function (_super) {
182
183
  this.logger.verbose("getRedirectResponseHash called");
183
184
  // Get current location hash from window or cache.
184
185
  var isResponseHash = UrlString.hashContainsKnownProperties(hash);
185
- var cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);
186
- this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));
187
186
  if (isResponseHash) {
187
+ BrowserUtils.clearHash(window);
188
188
  this.logger.verbose("Hash contains known properties, returning response hash");
189
189
  return hash;
190
190
  }
191
+ var cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);
192
+ this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));
191
193
  this.logger.verbose("Hash does not contain known properties, returning cached hash");
192
194
  return cachedHash;
193
195
  };
@@ -213,7 +215,7 @@ var RedirectClient = /** @class */ (function (_super) {
213
215
  authClient = _a.sent();
214
216
  this.logger.verbose("Auth code client created");
215
217
  interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto);
216
- return [4 /*yield*/, interactionHandler.handleCodeResponse(hash, state, authClient.authority, this.networkClient, this.config.auth.clientId)];
218
+ return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient, this.config.auth.clientId)];
217
219
  case 2: return [2 /*return*/, _a.sent()];
218
220
  }
219
221
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RedirectClient.js","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, UrlString, AuthError, ServerTelemetryManager } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\r\nimport { ApiId, InteractionType, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\r\nimport { RedirectHandler } from \"../interaction_handler/RedirectHandler\";\r\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\r\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\r\nimport { EventType } from \"../event/EventType\";\r\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { RedirectRequest } from \"../request/RedirectRequest\";\r\n\r\nexport class RedirectClient extends StandardInteractionClient { \r\n /**\r\n * Redirects the page to the /authorize endpoint of the IDP\r\n * @param request \r\n */\r\n async acquireToken(request: RedirectRequest): Promise<void> {\r\n const validRequest: AuthorizationUrlRequest = this.preflightInteractiveRequest(request, InteractionType.Redirect);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);\r\n\r\n try {\r\n // Create auth code request and generate PKCE params\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\r\n\r\n // Initialize the client\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create redirect interaction handler.\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto);\r\n\r\n // Create acquire token url.\r\n const navigateUrl = await authClient.getAuthCodeUrl(validRequest);\r\n\r\n const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);\r\n this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);\r\n\r\n // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.\r\n return await interactionHandler.initiateAuthRequest(navigateUrl, {\r\n navigationClient: this.navigationClient,\r\n redirectTimeout: this.config.system.redirectNavigationTimeout,\r\n redirectStartPage: redirectStartPage,\r\n onRedirectNavigate: request.onRedirectNavigate\r\n });\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Checks if navigateToLoginRequestUrl is set, and:\r\n * - if true, performs logic to cache and navigate\r\n * - if false, handles hash string and parses response\r\n * @param hash\r\n */\r\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);\r\n try {\r\n if (!this.browserStorage.isInteractionInProgress(true)) {\r\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\r\n return null;\r\n }\r\n\r\n const responseHash = this.getRedirectResponseHash(hash || window.location.hash);\r\n if (!responseHash) {\r\n // Not a recognized server response hash or hash not associated with a redirect request\r\n this.logger.info(\"handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache.\");\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return null;\r\n }\r\n\r\n let state: string;\r\n try {\r\n state = this.validateAndExtractStateFromHash(responseHash, InteractionType.Redirect);\r\n BrowserUtils.clearHash(window);\r\n this.logger.verbose(\"State extracted from hash\");\r\n } catch (e) {\r\n this.logger.info(`handleRedirectPromise was unable to extract state due to: ${e}`);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return null;\r\n }\r\n\r\n // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated\r\n const loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || \"\";\r\n const loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);\r\n const currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);\r\n\r\n if (loginRequestUrlNormalized === currentUrlNormalized && this.config.auth.navigateToLoginRequestUrl) {\r\n // We are on the page we need to navigate to - handle hash\r\n this.logger.verbose(\"Current page is loginRequestUrl, handling hash\");\r\n const handleHashResult = await this.handleHash(responseHash, state, serverTelemetryManager);\r\n\r\n if (loginRequestUrl.indexOf(\"#\") > -1) {\r\n // Replace current hash with non-msal hash, if present\r\n BrowserUtils.replaceHash(loginRequestUrl);\r\n }\r\n\r\n return handleHashResult;\r\n } else if (!this.config.auth.navigateToLoginRequestUrl) {\r\n this.logger.verbose(\"NavigateToLoginRequestUrl set to false, handling hash\");\r\n return this.handleHash(responseHash, state, serverTelemetryManager);\r\n } else if (!BrowserUtils.isInIframe()) {\r\n /*\r\n * Returned from authority using redirect - need to perform navigation before processing response\r\n * Cache the hash to be retrieved after the next redirect\r\n */\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);\r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.handleRedirectPromise,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: true\r\n };\r\n\r\n /**\r\n * Default behavior is to redirect to the start page and not process the hash now. \r\n * The start page is expected to also call handleRedirectPromise which will process the hash in one of the checks above.\r\n */ \r\n let processHashOnRedirect: boolean = true;\r\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\r\n // Redirect to home page if login request url is null (real null or the string null)\r\n const homepage = BrowserUtils.getHomepage();\r\n // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);\r\n this.logger.warning(\"Unable to get valid login request url from cache, redirecting to home page\");\r\n processHashOnRedirect = await this.navigationClient.navigateInternal(homepage, navigationOptions);\r\n } else {\r\n // Navigate to page that initiated the redirect request\r\n this.logger.verbose(`Navigating to loginRequestUrl: ${loginRequestUrl}`);\r\n processHashOnRedirect = await this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions);\r\n }\r\n\r\n // If navigateInternal implementation returns false, handle the hash now\r\n if (!processHashOnRedirect) {\r\n return this.handleHash(responseHash, state, serverTelemetryManager);\r\n }\r\n }\r\n\r\n return null;\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Gets the response hash for a redirect request\r\n * Returns null if interactionType in the state value is not \"redirect\" or the hash does not contain known properties\r\n * @param hash\r\n */\r\n private getRedirectResponseHash(hash: string): string | null {\r\n this.logger.verbose(\"getRedirectResponseHash called\");\r\n // Get current location hash from window or cache.\r\n const isResponseHash: boolean = UrlString.hashContainsKnownProperties(hash);\r\n const cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);\r\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));\r\n\r\n if (isResponseHash) {\r\n this.logger.verbose(\"Hash contains known properties, returning response hash\");\r\n return hash;\r\n }\r\n\r\n this.logger.verbose(\"Hash does not contain known properties, returning cached hash\");\r\n return cachedHash;\r\n }\r\n\r\n /**\r\n * Checks if hash exists and handles in window.\r\n * @param hash\r\n * @param state\r\n */\r\n private async handleHash(hash: string, state: string, serverTelemetryManager: ServerTelemetryManager): Promise<AuthenticationResult> {\r\n const cachedRequest = this.browserStorage.getCachedRequest(state, this.browserCrypto);\r\n this.logger.verbose(\"handleHash called, retrieved cached request\");\r\n\r\n // Hash contains known properties - handle and return in callback\r\n const currentAuthority = this.browserStorage.getCachedAuthority(state);\r\n if (!currentAuthority) {\r\n throw BrowserAuthError.createNoCachedAuthorityError();\r\n }\r\n\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);\r\n this.logger.verbose(\"Auth code client created\");\r\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto);\r\n return await interactionHandler.handleCodeResponse(hash, state, authClient.authority, this.networkClient, this.config.auth.clientId);\r\n }\r\n\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\r\n this.logger.verbose(\"logoutRedirect called\");\r\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);\r\n\r\n try {\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Redirect, logoutRequest);\r\n \r\n // Clear cache on logout\r\n await this.clearCacheOnLogout(validLogoutRequest.account);\r\n \r\n const navigationOptions: NavigationOptions = {\r\n apiId: ApiId.logout,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create logout string and navigate user window to logout.\r\n const logoutUri: string = authClient.getLogoutUri(validLogoutRequest);\r\n \r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\r\n // Check if onRedirectNavigate is implemented, and invoke it if so\r\n if (logoutRequest && typeof logoutRequest.onRedirectNavigate === \"function\") {\r\n const navigate = logoutRequest.onRedirectNavigate(logoutUri);\r\n\r\n if (navigate !== false) {\r\n this.logger.verbose(\"Logout onRedirectNavigate did not return false, navigating\");\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n } else {\r\n this.logger.verbose(\"Logout onRedirectNavigate returned false, stopping navigation\");\r\n }\r\n } else {\r\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\r\n return;\r\n }\r\n } catch(e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Redirect, null, e);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n throw e;\r\n }\r\n\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n }\r\n\r\n /**\r\n * Use to get the redirectStartPage either from request or use current window\r\n * @param requestStartPage\r\n */\r\n protected getRedirectStartPage(requestStartPage?: string): string {\r\n const redirectStartPage = requestStartPage || window.location.href;\r\n return UrlString.getAbsoluteUrl(redirectStartPage, BrowserUtils.getCurrentUri());\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;IAiBoC,kCAAyB;IAA7D;;KAwPC;;;;;IAnPS,qCAAY,GAAlB,UAAmB,OAAwB;;;;;;wBACjC,YAAY,GAA4B,IAAI,CAAC,2BAA2B,CAAC,OAAO,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;wBAC5G,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;;;;wBAIrC,qBAAM,IAAI,CAAC,kCAAkC,CAAC,YAAY,CAAC,EAAA;;wBAA7G,eAAe,GAAmC,SAA2D;wBAGvE,qBAA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,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAA;;wBAA1E,SAA0E,CAAC;wBAC3E,sBAAO;;wBAEP,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC;;;4BAGzF,qBAAM,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAA;;wBAA1E,SAA0E,CAAC;wBAC3E,sBAAO;;;;wBAGX,IAAI,GAAC,YAAY,SAAS,EAAE;4BACxB,GAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;yBAC1C;wBACD,sBAAsB,CAAC,kBAAkB,CAAC,GAAC,CAAC,CAAC;wBAC7C,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,cAAc,EAAE,eAAe,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAC,CAAC,CAAC;wBACzF,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;wBAC5E,MAAM,GAAC,CAAC;;wBAGZ,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;KAC/E;;;;;IAMS,6CAAoB,GAA9B,UAA+B,gBAAyB;QACpD,IAAM,iBAAiB,GAAG,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QACnE,OAAO,SAAS,CAAC,cAAc,CAAC,iBAAiB,EAAE,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;KACpF;IACL,qBAAC;AAAD,CAxPA,CAAoC,yBAAyB;;;;"}
1
+ {"version":3,"file":"RedirectClient.js","sources":["../../src/interaction_client/RedirectClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, CommonAuthorizationCodeRequest, AuthorizationCodeClient, UrlString, AuthError, ServerTelemetryManager } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { ApiId, InteractionType, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { RedirectHandler } from \"../interaction_handler/RedirectHandler\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { EventType } from \"../event/EventType\";\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\n\nexport class RedirectClient extends StandardInteractionClient {\n /**\n * Redirects the page to the /authorize endpoint of the IDP\n * @param request\n */\n async acquireToken(request: RedirectRequest): Promise<void> {\n const validRequest = await this.initializeAuthorizationRequest(request, InteractionType.Redirect);\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || \"\", validRequest.account || null);\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);\n\n try {\n // Create auth code request and generate PKCE params\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);\n\n // Initialize the client\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);\n this.logger.verbose(\"Auth code client created\");\n\n // Create redirect interaction handler.\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto);\n\n // Create acquire token url.\n const navigateUrl = await authClient.getAuthCodeUrl(validRequest);\n\n const redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);\n this.logger.verbosePii(`Redirect start page: ${redirectStartPage}`);\n\n // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.\n return await interactionHandler.initiateAuthRequest(navigateUrl, {\n navigationClient: this.navigationClient,\n redirectTimeout: this.config.system.redirectNavigationTimeout,\n redirectStartPage: redirectStartPage,\n onRedirectNavigate: request.onRedirectNavigate\n });\n } catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(validRequest.state);\n throw e;\n }\n }\n\n /**\n * Checks if navigateToLoginRequestUrl is set, and:\n * - if true, performs logic to cache and navigate\n * - if false, handles hash string and parses response\n * @param hash\n */\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);\n try {\n if (!this.browserStorage.isInteractionInProgress(true)) {\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\n return null;\n }\n\n const responseHash = this.getRedirectResponseHash(hash || window.location.hash);\n if (!responseHash) {\n // Not a recognized server response hash or hash not associated with a redirect request\n this.logger.info(\"handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache.\");\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\n return null;\n }\n\n let state: string;\n try {\n state = this.validateAndExtractStateFromHash(responseHash, InteractionType.Redirect);\n this.logger.verbose(\"State extracted from hash\");\n } catch (e) {\n this.logger.info(`handleRedirectPromise was unable to extract state due to: ${e}`);\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\n return null;\n }\n\n // If navigateToLoginRequestUrl is true, get the url where the redirect request was initiated\n const loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || \"\";\n const loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);\n const currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);\n\n if (loginRequestUrlNormalized === currentUrlNormalized && this.config.auth.navigateToLoginRequestUrl) {\n // We are on the page we need to navigate to - handle hash\n this.logger.verbose(\"Current page is loginRequestUrl, handling hash\");\n const handleHashResult = await this.handleHash(responseHash, state, serverTelemetryManager);\n\n if (loginRequestUrl.indexOf(\"#\") > -1) {\n // Replace current hash with non-msal hash, if present\n BrowserUtils.replaceHash(loginRequestUrl);\n }\n\n return handleHashResult;\n } else if (!this.config.auth.navigateToLoginRequestUrl) {\n this.logger.verbose(\"NavigateToLoginRequestUrl set to false, handling hash\");\n return this.handleHash(responseHash, state, serverTelemetryManager);\n } else if (!BrowserUtils.isInIframe() || this.config.system.allowRedirectInIframe) {\n /*\n * Returned from authority using redirect - need to perform navigation before processing response\n * Cache the hash to be retrieved after the next redirect\n */\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);\n const navigationOptions: NavigationOptions = {\n apiId: ApiId.handleRedirectPromise,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: true\n };\n\n /**\n * Default behavior is to redirect to the start page and not process the hash now.\n * The start page is expected to also call handleRedirectPromise which will process the hash in one of the checks above.\n */\n let processHashOnRedirect: boolean = true;\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\n // Redirect to home page if login request url is null (real null or the string null)\n const homepage = BrowserUtils.getHomepage();\n // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);\n this.logger.warning(\"Unable to get valid login request url from cache, redirecting to home page\");\n processHashOnRedirect = await this.navigationClient.navigateInternal(homepage, navigationOptions);\n } else {\n // Navigate to page that initiated the redirect request\n this.logger.verbose(`Navigating to loginRequestUrl: ${loginRequestUrl}`);\n processHashOnRedirect = await this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions);\n }\n\n // If navigateInternal implementation returns false, handle the hash now\n if (!processHashOnRedirect) {\n return this.handleHash(responseHash, state, serverTelemetryManager);\n }\n }\n\n return null;\n } catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\n throw e;\n }\n }\n\n /**\n * Gets the response hash for a redirect request\n * Returns null if interactionType in the state value is not \"redirect\" or the hash does not contain known properties\n * @param hash\n */\n protected getRedirectResponseHash(hash: string): string | null {\n this.logger.verbose(\"getRedirectResponseHash called\");\n // Get current location hash from window or cache.\n const isResponseHash: boolean = UrlString.hashContainsKnownProperties(hash);\n\n if (isResponseHash) {\n BrowserUtils.clearHash(window);\n this.logger.verbose(\"Hash contains known properties, returning response hash\");\n return hash;\n }\n\n const cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));\n\n this.logger.verbose(\"Hash does not contain known properties, returning cached hash\");\n return cachedHash;\n }\n\n /**\n * Checks if hash exists and handles in window.\n * @param hash\n * @param state\n */\n protected async handleHash(hash: string, state: string, serverTelemetryManager: ServerTelemetryManager): Promise<AuthenticationResult> {\n const cachedRequest = this.browserStorage.getCachedRequest(state, this.browserCrypto);\n this.logger.verbose(\"handleHash called, retrieved cached request\");\n\n // Hash contains known properties - handle and return in callback\n const currentAuthority = this.browserStorage.getCachedAuthority(state);\n if (!currentAuthority) {\n throw BrowserAuthError.createNoCachedAuthorityError();\n }\n\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);\n this.logger.verbose(\"Auth code client created\");\n const interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto);\n return await interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient, this.config.auth.clientId);\n }\n\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\n this.logger.verbose(\"logoutRedirect called\");\n const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);\n\n try {\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Redirect, logoutRequest);\n\n // Clear cache on logout\n await this.clearCacheOnLogout(validLogoutRequest.account);\n\n const navigationOptions: NavigationOptions = {\n apiId: ApiId.logout,\n timeout: this.config.system.redirectNavigationTimeout,\n noHistory: false\n };\n const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);\n this.logger.verbose(\"Auth code client created\");\n\n // Create logout string and navigate user window to logout.\n const logoutUri: string = authClient.getLogoutUri(validLogoutRequest);\n\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\n // Check if onRedirectNavigate is implemented, and invoke it if so\n if (logoutRequest && typeof logoutRequest.onRedirectNavigate === \"function\") {\n const navigate = logoutRequest.onRedirectNavigate(logoutUri);\n\n if (navigate !== false) {\n this.logger.verbose(\"Logout onRedirectNavigate did not return false, navigating\");\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\n return;\n } else {\n this.logger.verbose(\"Logout onRedirectNavigate returned false, stopping navigation\");\n }\n } else {\n await this.navigationClient.navigateExternal(logoutUri, navigationOptions);\n return;\n }\n } catch(e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Redirect, null, e);\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\n throw e;\n }\n\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\n }\n\n /**\n * Use to get the redirectStartPage either from request or use current window\n * @param requestStartPage\n */\n protected getRedirectStartPage(requestStartPage?: string): string {\n const redirectStartPage = requestStartPage || window.location.href;\n return UrlString.getAbsoluteUrl(redirectStartPage, BrowserUtils.getCurrentUri());\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;IAgBoC,kCAAyB;IAA7D;;KA0PC;;;;;IArPS,qCAAY,GAAlB,UAAmB,OAAwB;;;;;4BAClB,qBAAM,IAAI,CAAC,8B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GAAC,CAAC;;wBAGZ,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;KAC/E;;;;;IAMS,6CAAoB,GAA9B,UAA+B,gBAAyB;QACpD,IAAM,iBAAiB,GAAG,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QACnE,OAAO,SAAS,CAAC,cAAc,CAAC,iBAAiB,EAAE,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;KACpF;IACL,qBAAC;AAAD,CA1PA,CAAoC,yBAAyB;;;;"}
@@ -0,0 +1,22 @@
1
+ import { AuthenticationResult, ICrypto, Logger } from "@azure/msal-common";
2
+ import { StandardInteractionClient } from "./StandardInteractionClient";
3
+ import { BrowserConfiguration } from "../config/Configuration";
4
+ import { BrowserCacheManager } from "../cache/BrowserCacheManager";
5
+ import { EventHandler } from "../event/EventHandler";
6
+ import { INavigationClient } from "../navigation/INavigationClient";
7
+ import { ApiId } from "../utils/BrowserConstants";
8
+ import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
9
+ export declare class SilentAuthCodeClient extends StandardInteractionClient {
10
+ private apiId;
11
+ constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, correlationId?: string);
12
+ /**
13
+ * Acquires a token silently by redeeming an authorization code against the /token endpoint
14
+ * @param request
15
+ */
16
+ acquireToken(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
17
+ /**
18
+ * Currently Unsupported
19
+ */
20
+ logout(): Promise<void>;
21
+ }
22
+ //# sourceMappingURL=SilentAuthCodeClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SilentAuthCodeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAA6C,MAAM,oBAAoB,CAAC;AACtH,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAmB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,qBAAa,oBAAqB,SAAQ,yBAAyB;IAC/D,OAAO,CAAC,KAAK,CAAQ;gBAET,MAAM,EAAE,oBAAoB,EAAE,WAAW,EAAE,mBAAmB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,MAAM;IAKzN;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqDpF;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAI1B"}
@@ -0,0 +1,83 @@
1
+ /*! @azure/msal-browser v2.22.0 2022-02-08 */
2
+ 'use strict';
3
+ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
+ import { AuthError } from '@azure/msal-common';
5
+ import { StandardInteractionClient } from './StandardInteractionClient.js';
6
+ import { BrowserAuthError } from '../error/BrowserAuthError.js';
7
+ import { InteractionType } from '../utils/BrowserConstants.js';
8
+ import { SilentHandler } from '../interaction_handler/SilentHandler.js';
9
+ import { HybridSpaAuthorizationCodeClient } from './HybridSpaAuthorizationCodeClient.js';
10
+
11
+ /*
12
+ * Copyright (c) Microsoft Corporation. All rights reserved.
13
+ * Licensed under the MIT License.
14
+ */
15
+ var SilentAuthCodeClient = /** @class */ (function (_super) {
16
+ __extends(SilentAuthCodeClient, _super);
17
+ function SilentAuthCodeClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, correlationId) {
18
+ var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, correlationId) || this;
19
+ _this.apiId = apiId;
20
+ return _this;
21
+ }
22
+ /**
23
+ * Acquires a token silently by redeeming an authorization code against the /token endpoint
24
+ * @param request
25
+ */
26
+ SilentAuthCodeClient.prototype.acquireToken = function (request) {
27
+ return __awaiter(this, void 0, void 0, function () {
28
+ var silentRequest, serverTelemetryManager, authCodeRequest, clientConfig, authClient, silentHandler, e_1;
29
+ return __generator(this, function (_a) {
30
+ switch (_a.label) {
31
+ case 0:
32
+ this.logger.trace("SilentAuthCodeClient.acquireToken called");
33
+ // Auth code payload is required
34
+ if (!request.code) {
35
+ throw BrowserAuthError.createAuthCodeRequiredError();
36
+ }
37
+ return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Silent)];
38
+ case 1:
39
+ silentRequest = _a.sent();
40
+ this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null);
41
+ serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
42
+ _a.label = 2;
43
+ case 2:
44
+ _a.trys.push([2, 4, , 5]);
45
+ authCodeRequest = __assign(__assign({}, silentRequest), { code: request.code });
46
+ return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, silentRequest.authority)];
47
+ case 3:
48
+ clientConfig = _a.sent();
49
+ authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
50
+ this.logger.verbose("Auth code client created");
51
+ silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system.navigateFrameWait);
52
+ // Handle auth code parameters from request
53
+ return [2 /*return*/, silentHandler.handleCodeResponseFromServer({
54
+ code: request.code,
55
+ msgraph_host: request.msGraphHost,
56
+ cloud_graph_host_name: request.cloudGraphHostName,
57
+ cloud_instance_host_name: request.cloudInstanceHostName
58
+ }, silentRequest.state, authClient.authority, this.networkClient, false)];
59
+ case 4:
60
+ e_1 = _a.sent();
61
+ if (e_1 instanceof AuthError) {
62
+ e_1.setCorrelationId(this.correlationId);
63
+ }
64
+ serverTelemetryManager.cacheFailedRequest(e_1);
65
+ this.browserStorage.cleanRequestByState(silentRequest.state);
66
+ throw e_1;
67
+ case 5: return [2 /*return*/];
68
+ }
69
+ });
70
+ });
71
+ };
72
+ /**
73
+ * Currently Unsupported
74
+ */
75
+ SilentAuthCodeClient.prototype.logout = function () {
76
+ // Synchronous so we must reject
77
+ return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());
78
+ };
79
+ return SilentAuthCodeClient;
80
+ }(StandardInteractionClient));
81
+
82
+ export { SilentAuthCodeClient };
83
+ //# sourceMappingURL=SilentAuthCodeClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SilentAuthCodeClient.js","sources":["../../src/interaction_client/SilentAuthCodeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, ICrypto, Logger, CommonAuthorizationCodeRequest, AuthError } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\nimport { HybridSpaAuthorizationCodeClient } from \"./HybridSpaAuthorizationCodeClient\";\n\nexport class SilentAuthCodeClient extends StandardInteractionClient {\n private apiId: ApiId;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, correlationId);\n this.apiId = apiId;\n }\n \n /**\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\n * @param request \n */\n async acquireToken(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.logger.trace(\"SilentAuthCodeClient.acquireToken called\");\n\n // Auth code payload is required\n if (!request.code) {\n throw BrowserAuthError.createAuthCodeRequiredError();\n }\n\n // Create silent request\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest(request, InteractionType.Silent);\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || \"\", silentRequest.account || null);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n\n try {\n\n // Create auth code request (PKCE not needed)\n const authCodeRequest: CommonAuthorizationCodeRequest = {\n ...silentRequest,\n code: request.code\n };\n\n // Initialize the client\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, silentRequest.authority);\n const authClient: HybridSpaAuthorizationCodeClient = new HybridSpaAuthorizationCodeClient(clientConfig);\n this.logger.verbose(\"Auth code client created\");\n\n // Create silent handler\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system.navigateFrameWait);\n\n // Handle auth code parameters from request\n return silentHandler.handleCodeResponseFromServer(\n {\n code: request.code,\n msgraph_host: request.msGraphHost,\n cloud_graph_host_name: request.cloudGraphHostName,\n cloud_instance_host_name: request.cloudInstanceHostName\n },\n silentRequest.state, \n authClient.authority, \n this.networkClient,\n false\n );\n } catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(silentRequest.state);\n throw e;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;IAkB0C,wCAAyB;IAG/D,8BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,aAAsB;QAAzN,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,CAAC,SAEnG;QADG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;KACtB;;;;;IAMK,2CAAY,GAAlB,UAAmB,OAAiC;;;;;;wBAChD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;;wBAG9D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;4BACf,MAAM,gBAAgB,CAAC,2BAA2B,EAAE,CAAC;yBACxD;wBAG8C,qBAAM,IAAI,CAAC,8BAA8B,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,EAAA;;wBAAnH,aAAa,GAA4B,SAA0E;wBACzH,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;wBAElK,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;;;wBAKvE,eAAe,yBACd,aAAa,KAChB,IAAI,EAAE,OAAO,CAAC,IAAI,GACrB,CAAC;wBAGmB,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,aAAa,CAAC,SAAS,CAAC,EAAA;;wBAAjG,YAAY,GAAG,SAAkF;wBACjG,UAAU,GAAqC,IAAI,gCAAgC,CAAC,YAAY,CAAC,CAAC;wBACxG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;wBAG1C,aAAa,GAAG,IAAI,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;;wBAG7I,sBAAO,aAAa,CAAC,4BAA4B,CAC7C;gCACI,IAAI,EAAE,OAAO,CAAC,IAAI;gCAClB,YAAY,EAAE,OAAO,CAAC,WAAW;gCACjC,qBAAqB,EAAE,OAAO,CAAC,kBAAkB;gCACjD,wBAAwB,EAAE,OAAO,CAAC,qBAAqB;6BAC1D,EACD,aAAa,CAAC,KAAK,EACnB,UAAU,CAAC,SAAS,EACpB,IAAI,CAAC,aAAa,EAClB,KAAK,CACR,EAAC;;;wBAEF,IAAI,GAAC,YAAY,SAAS,EAAE;4BACxB,GAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;yBAC1C;wBACD,sBAAsB,CAAC,kBAAkB,CAAC,GAAC,CAAC,CAAC;wBAC7C,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;wBAC7D,MAAM,GAAC,CAAC;;;;;KAEf;;;;IAKD,qCAAM,GAAN;;QAEI,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC;KAChF;IACL,2BAAC;AAAD,CAxEA,CAA0C,yBAAyB;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { StandardInteractionClient } from "./StandardInteractionClient";
2
- import { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo } from "@azure/msal-common";
2
+ import { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo, AzureCloudOptions } from "@azure/msal-common";
3
3
  import { SilentRequest } from "../request/SilentRequest";
4
4
  export declare class SilentCacheClient extends StandardInteractionClient {
5
5
  /**
@@ -16,7 +16,7 @@ export declare class SilentCacheClient extends StandardInteractionClient {
16
16
  * @param serverTelemetryManager
17
17
  * @param authorityUrl
18
18
  */
19
- protected createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<SilentFlowClient>;
20
- initializeSilentRequest(request: SilentRequest, account: AccountInfo): CommonSilentFlowRequest;
19
+ protected createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<SilentFlowClient>;
20
+ initializeSilentRequest(request: SilentRequest, account: AccountInfo): Promise<CommonSilentFlowRequest>;
21
21
  }
22
22
  //# sourceMappingURL=SilentCacheClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SilentCacheClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentCacheClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1I,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,qBAAa,iBAAkB,SAAQ,yBAAyB;IAC5D;;;OAGG;IACG,YAAY,CAAC,aAAa,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAkBzF;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB;;;;OAIG;cACa,sBAAsB,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMxI,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,uBAAuB;CAQjG"}
1
+ {"version":3,"file":"SilentCacheClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentCacheClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAC5J,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,qBAAa,iBAAkB,SAAQ,yBAAyB;IAC5D;;;OAGG;IACG,YAAY,CAAC,aAAa,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAmBzF;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB;;;;OAIG;cACa,sBAAsB,CAAC,sBAAsB,EAAE,sBAAsB,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMzK,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAQhH"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.18.0 2021-10-05 */
1
+ /*! @azure/msal-browser v2.22.0 2022-02-08 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { StandardInteractionClient } from './StandardInteractionClient.js';
@@ -27,7 +27,7 @@ var SilentCacheClient = /** @class */ (function (_super) {
27
27
  switch (_a.label) {
28
28
  case 0:
29
29
  serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
30
- return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority)];
30
+ return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
31
31
  case 1:
32
32
  silentAuthClient = _a.sent();
33
33
  this.logger.verbose("Silent auth client created");
@@ -62,12 +62,12 @@ var SilentCacheClient = /** @class */ (function (_super) {
62
62
  * @param serverTelemetryManager
63
63
  * @param authorityUrl
64
64
  */
65
- SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl) {
65
+ SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {
66
66
  return __awaiter(this, void 0, void 0, function () {
67
67
  var clientConfig;
68
68
  return __generator(this, function (_a) {
69
69
  switch (_a.label) {
70
- case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl)];
70
+ case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
71
71
  case 1:
72
72
  clientConfig = _a.sent();
73
73
  return [2 /*return*/, new SilentFlowClient(clientConfig)];
@@ -76,7 +76,17 @@ var SilentCacheClient = /** @class */ (function (_super) {
76
76
  });
77
77
  };
78
78
  SilentCacheClient.prototype.initializeSilentRequest = function (request, account) {
79
- return __assign(__assign(__assign({}, request), this.initializeBaseRequest(request)), { account: account, forceRefresh: request.forceRefresh || false });
79
+ return __awaiter(this, void 0, void 0, function () {
80
+ var _a;
81
+ return __generator(this, function (_b) {
82
+ switch (_b.label) {
83
+ case 0:
84
+ _a = [__assign({}, request)];
85
+ return [4 /*yield*/, this.initializeBaseRequest(request)];
86
+ case 1: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];
87
+ }
88
+ });
89
+ });
80
90
  };
81
91
  return SilentCacheClient;
82
92
  }(StandardInteractionClient));
@@ -1 +1 @@
1
- {"version":3,"file":"SilentCacheClient.js","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo } from \"@azure/msal-common\";\r\nimport { SilentRequest } from \"../request/SilentRequest\";\r\nimport { EventType } from \"../event/EventType\";\r\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\r\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\r\n\r\nexport class SilentCacheClient extends StandardInteractionClient {\r\n /**\r\n * Returns unexpired tokens from the cache, if available\r\n * @param silentRequest \r\n */\r\n async acquireToken(silentRequest: CommonSilentFlowRequest): Promise<AuthenticationResult> {\r\n // Telemetry manager only used to increment cacheHits here\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\r\n const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority);\r\n this.logger.verbose(\"Silent auth client created\");\r\n \r\n try {\r\n const cachedToken = await silentAuthClient.acquireCachedToken(silentRequest);\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, cachedToken);\r\n return cachedToken;\r\n } catch (error) {\r\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {\r\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\r\n }\r\n throw error;\r\n }\r\n }\r\n \r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n\r\n /**\r\n * Creates an Silent Flow Client with the given authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param authorityUrl\r\n */\r\n protected async createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<SilentFlowClient> {\r\n // Create auth module.\r\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl);\r\n return new SilentFlowClient(clientConfig);\r\n }\r\n\r\n initializeSilentRequest(request: SilentRequest, account: AccountInfo): CommonSilentFlowRequest {\r\n return {\r\n ...request,\r\n ...this.initializeBaseRequest(request),\r\n account: account,\r\n forceRefresh: request.forceRefresh || false\r\n };\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;IAYuC,qCAAyB;IAAhE;;KAkDC;;;;;IA7CS,wCAAY,GAAlB,UAAmB,aAAsC;;;;;;wBAE/C,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;wBACjF,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,aAAa,CAAC,SAAS,CAAC,EAAA;;wBAArG,gBAAgB,GAAG,SAAkF;wBAC3G,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;;;;wBAG1B,qBAAM,gBAAgB,CAAC,kBAAkB,CAAC,aAAa,CAAC,EAAA;;wBAAtE,WAAW,GAAG,SAAwD;wBAC5E,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,qBAAqB,EAAE,eAAe,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;wBAClG,sBAAO,WAAW,EAAC;;;wBAEnB,IAAI,OAAK,YAAY,gBAAgB,IAAI,OAAK,CAAC,SAAS,KAAK,uBAAuB,CAAC,2BAA2B,CAAC,IAAI,EAAE;4BACnH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sHAAsH,CAAC,CAAC;yBAC/I;wBACD,MAAM,OAAK,CAAC;;;;;KAEnB;;;;IAKD,kCAAM,GAAN;;QAEI,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC;KAChF;;;;;;IAOe,kDAAsB,GAAtC,UAAuC,sBAA8C,EAAE,YAAqB;;;;;4BAEnF,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,YAAY,CAAC,EAAA;;wBAAtF,YAAY,GAAG,SAAuE;wBAC5F,sBAAO,IAAI,gBAAgB,CAAC,YAAY,CAAC,EAAC;;;;KAC7C;IAED,mDAAuB,GAAvB,UAAwB,OAAsB,EAAE,OAAoB;QAChE,sCACO,OAAO,GACP,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,KACtC,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,KAAK,IAC7C;KACL;IACL,wBAAC;AAAD,CAlDA,CAAuC,yBAAyB;;;;"}
1
+ {"version":3,"file":"SilentCacheClient.js","sources":["../../src/interaction_client/SilentCacheClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { CommonSilentFlowRequest, AuthenticationResult, SilentFlowClient, ServerTelemetryManager, AccountInfo, AzureCloudOptions} from \"@azure/msal-common\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { EventType } from \"../event/EventType\";\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\n\nexport class SilentCacheClient extends StandardInteractionClient {\n /**\n * Returns unexpired tokens from the cache, if available\n * @param silentRequest\n */\n async acquireToken(silentRequest: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n // Telemetry manager only used to increment cacheHits here\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\n\n const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Silent auth client created\");\n\n try {\n const cachedToken = await silentAuthClient.acquireCachedToken(silentRequest);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, cachedToken);\n return cachedToken;\n } catch (error) {\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\n }\n throw error;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Creates an Silent Flow Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createSilentFlowClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<SilentFlowClient> {\n // Create auth module.\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);\n return new SilentFlowClient(clientConfig);\n }\n\n async initializeSilentRequest(request: SilentRequest, account: AccountInfo): Promise<CommonSilentFlowRequest> {\n return {\n ...request,\n ...await this.initializeBaseRequest(request),\n account: account,\n forceRefresh: request.forceRefresh || false\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;IAYuC,qCAAyB;IAAhE;;KAmDC;;;;;IA9CS,wCAAY,GAAlB,UAAmB,aAAsC;;;;;;wBAE/C,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;wBAEjF,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,iBAAiB,CAAC,EAAA;;wBAAtI,gBAAgB,GAAG,SAAmH;wBAC5I,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;;;;wBAG1B,qBAAM,gBAAgB,CAAC,kBAAkB,CAAC,aAAa,CAAC,EAAA;;wBAAtE,WAAW,GAAG,SAAwD;wBAC5E,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,qBAAqB,EAAE,eAAe,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;wBAClG,sBAAO,WAAW,EAAC;;;wBAEnB,IAAI,OAAK,YAAY,gBAAgB,IAAI,OAAK,CAAC,SAAS,KAAK,uBAAuB,CAAC,2BAA2B,CAAC,IAAI,EAAE;4BACnH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sHAAsH,CAAC,CAAC;yBAC/I;wBACD,MAAM,OAAK,CAAC;;;;;KAEnB;;;;IAKD,kCAAM,GAAN;;QAEI,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC;KAChF;;;;;;IAOe,kDAAsB,GAAtC,UAAuC,sBAA8C,EAAE,YAAqB,EAAE,iBAAqC;;;;;4BAE1H,qBAAM,IAAI,CAAC,sBAAsB,CAAC,sBAAsB,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAA;;wBAAzG,YAAY,GAAG,SAA0F;wBAC/G,sBAAO,IAAI,gBAAgB,CAAC,YAAY,CAAC,EAAC;;;;KAC7C;IAEK,mDAAuB,GAA7B,UAA8B,OAAsB,EAAE,OAAoB;;;;;;2CAE/D,OAAO;wBACP,qBAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAA;4BAFhD,gFAEO,SAAyC,OAC5C,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,KAAK,MAC7C;;;;KACL;IACL,wBAAC;AAAD,CAnDA,CAAuC,yBAAyB;;;;"}
@@ -1,4 +1,4 @@
1
- import { AuthenticationResult, ICrypto, Logger } from "@azure/msal-common";
1
+ import { AuthenticationResult, ICrypto, Logger, CommonAuthorizationCodeRequest, AuthorizationCodeClient } from "@azure/msal-common";
2
2
  import { StandardInteractionClient } from "./StandardInteractionClient";
3
3
  import { BrowserConfiguration } from "../config/Configuration";
4
4
  import { BrowserCacheManager } from "../cache/BrowserCacheManager";
@@ -7,7 +7,7 @@ import { INavigationClient } from "../navigation/INavigationClient";
7
7
  import { ApiId } from "../utils/BrowserConstants";
8
8
  import { SsoSilentRequest } from "../request/SsoSilentRequest";
9
9
  export declare class SilentIframeClient extends StandardInteractionClient {
10
- private apiId;
10
+ protected apiId: ApiId;
11
11
  constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, correlationId?: string);
12
12
  /**
13
13
  * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none
@@ -24,6 +24,6 @@ export declare class SilentIframeClient extends StandardInteractionClient {
24
24
  * @param navigateUrl
25
25
  * @param userRequestScopes
26
26
  */
27
- private silentTokenHelper;
27
+ protected silentTokenHelper(navigateUrl: string, authCodeRequest: CommonAuthorizationCodeRequest, authClient: AuthorizationCodeClient, browserRequestLogger: Logger): Promise<AuthenticationResult>;
28
28
  }
29
29
  //# sourceMappingURL=SilentIframeClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SilentIframeClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/SilentIframeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAgG,MAAM,oBAAoB,CAAC;AACzK,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAmB,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,qBAAa,kBA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B,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,MAAM;IAKzN;;;OAGG;IACG,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA2C5E;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB;;;;;OAKG;cACa,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,8BAA8B,EAAE,UAAU,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAY5M"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.18.0 2021-10-05 */
1
+ /*! @azure/msal-browser v2.22.0 2022-02-08 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { AuthError, StringUtils, PromptValue } from '@azure/msal-common';
@@ -37,24 +37,27 @@ var SilentIframeClient = /** @class */ (function (_super) {
37
37
  if (request.prompt && request.prompt !== PromptValue.NONE) {
38
38
  throw BrowserAuthError.createSilentPromptValueError(request.prompt);
39
39
  }
40
- silentRequest = this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: PromptValue.NONE }), InteractionType.Silent);
41
- serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
42
- _a.label = 1;
40
+ return [4 /*yield*/, this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: PromptValue.NONE }), InteractionType.Silent)];
43
41
  case 1:
44
- _a.trys.push([1, 6, , 7]);
45
- return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];
42
+ silentRequest = _a.sent();
43
+ this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null);
44
+ serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
45
+ _a.label = 2;
46
46
  case 2:
47
- authCodeRequest = _a.sent();
48
- return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority)];
47
+ _a.trys.push([2, 7, , 8]);
48
+ return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];
49
49
  case 3:
50
+ authCodeRequest = _a.sent();
51
+ return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];
52
+ case 4:
50
53
  authClient = _a.sent();
51
54
  this.logger.verbose("Auth code client created");
52
55
  return [4 /*yield*/, authClient.getAuthCodeUrl(silentRequest)];
53
- case 4:
56
+ case 5:
54
57
  navigateUrl = _a.sent();
55
58
  return [4 /*yield*/, this.silentTokenHelper(navigateUrl, authCodeRequest, authClient, this.logger)];
56
- case 5: return [2 /*return*/, _a.sent()];
57
- case 6:
59
+ case 6: return [2 /*return*/, _a.sent()];
60
+ case 7:
58
61
  e_1 = _a.sent();
59
62
  if (e_1 instanceof AuthError) {
60
63
  e_1.setCorrelationId(this.correlationId);
@@ -62,7 +65,7 @@ var SilentIframeClient = /** @class */ (function (_super) {
62
65
  serverTelemetryManager.cacheFailedRequest(e_1);
63
66
  this.browserStorage.cleanRequestByState(silentRequest.state);
64
67
  throw e_1;
65
- case 7: return [2 /*return*/];
68
+ case 8: return [2 /*return*/];
66
69
  }
67
70
  });
68
71
  });
@@ -95,7 +98,7 @@ var SilentIframeClient = /** @class */ (function (_super) {
95
98
  hash = _a.sent();
96
99
  state = this.validateAndExtractStateFromHash(hash, InteractionType.Silent, authCodeRequest.correlationId);
97
100
  // Handle response from hash string
98
- return [2 /*return*/, silentHandler.handleCodeResponse(hash, state, authClient.authority, this.networkClient)];
101
+ return [2 /*return*/, silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];
99
102
  }
100
103
  });
101
104
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SilentIframeClient.js","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationResult, ICrypto, Logger, StringUtils, PromptValue, CommonAuthorizationCodeRequest, AuthorizationCodeClient, AuthError } from \"@azure/msal-common\";\r\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\r\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\r\nimport { BrowserConfiguration } from \"../config/Configuration\";\r\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\r\nimport { EventHandler } from \"../event/EventHandler\";\r\nimport { INavigationClient } from \"../navigation/INavigationClient\";\r\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\r\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\r\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\r\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\r\n\r\nexport class SilentIframeClient extends StandardInteractionClient {\r\n private apiId: ApiId;\r\n\r\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, correlationId?: string) {\r\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, correlationId);\r\n this.apiId = apiId;\r\n }\r\n \r\n /**\r\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none\r\n * @param request \r\n */\r\n async acquireToken(request: SsoSilentRequest): Promise<AuthenticationResult> {\r\n this.logger.verbose(\"acquireTokenByIframe called\");\r\n // Check that we have some SSO data\r\n if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {\r\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\r\n }\r\n\r\n // Check that prompt is set to none, throw error if it is set to anything else.\r\n if (request.prompt && request.prompt !== PromptValue.NONE) {\r\n throw BrowserAuthError.createSilentPromptValueError(request.prompt);\r\n }\r\n\r\n // Create silent request\r\n const silentRequest: AuthorizationUrlRequest = this.initializeAuthorizationRequest({\r\n ...request,\r\n prompt: PromptValue.NONE\r\n }, InteractionType.Silent);\r\n\r\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n\r\n try {\r\n // Create auth code request and generate PKCE params\r\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);\r\n\r\n // Initialize the client\r\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority);\r\n this.logger.verbose(\"Auth code client created\");\r\n\r\n // Create authorize request url\r\n const navigateUrl = await authClient.getAuthCodeUrl(silentRequest);\r\n\r\n return await this.silentTokenHelper(navigateUrl, authCodeRequest, authClient, this.logger);\r\n } catch (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n this.browserStorage.cleanRequestByState(silentRequest.state);\r\n throw e;\r\n }\r\n }\r\n\r\n /**\r\n * Currently Unsupported\r\n */\r\n logout(): Promise<void> {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n }\r\n\r\n /**\r\n * Helper which acquires an authorization code silently using a hidden iframe from given url\r\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\r\n * @param navigateUrl\r\n * @param userRequestScopes\r\n */\r\n private async silentTokenHelper(navigateUrl: string, authCodeRequest: CommonAuthorizationCodeRequest, authClient: AuthorizationCodeClient, browserRequestLogger: Logger): Promise<AuthenticationResult> {\r\n // Create silent handler\r\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, browserRequestLogger, this.config.system.navigateFrameWait);\r\n // Get the frame handle for the silent request\r\n const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);\r\n const state = this.validateAndExtractStateFromHash(hash, InteractionType.Silent, authCodeRequest.correlationId);\r\n\r\n // Handle response from hash string\r\n return silentHandler.handleCodeResponse(hash, state, authClient.authority, this.networkClient);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;IAiBwC,sCAAyB;IAG7D,4BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,aAAsB;QAAzN,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,CAAC,SAEnG;QADG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;KACtB;;;;;IAMK,yCAAY,GAAlB,UAAmB,OAAyB;;;;;;wBACxC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;;wBAEnD,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;4BACnJ,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,qGAAqG,CAAC,CAAC;yBAC9H;;wBAGD,IAAI,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,CAAC,IAAI,EAAE;4BACvD,MAAM,gBAAgB,CAAC,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;yBACvE;wBAGK,aAAa,GAA4B,IAAI,CAAC,8BAA8B,uBAC3E,OAAO,KACV,MAAM,EAAE,WAAW,CAAC,IAAI,KACzB,eAAe,CAAC,MAAM,CAAC,CAAC;wBAErB,sBAAsB,GAAG,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,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G,SAAoD;wBAEzD,qBAAM,aAAa,CAAC,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAA;;wBAAhG,IAAI,GAAG,SAAyF;wBAChG,KAAK,GAAG,IAAI,CAAC,+BAA+B,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;;wBAGhH,sBAAO,aAAa,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,EAAC;;;;KAClG;IACL,yBAAC;AAAD,CAhFA,CAAwC,yBAAyB;;;;"}
1
+ {"version":3,"file":"SilentIframeClient.js","sources":["../../src/interaction_client/SilentIframeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, ICrypto, Logger, StringUtils, PromptValue, CommonAuthorizationCodeRequest, AuthorizationCodeClient, AuthError } from \"@azure/msal-common\";\nimport { StandardInteractionClient } from \"./StandardInteractionClient\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { SilentHandler } from \"../interaction_handler/SilentHandler\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\n\nexport class SilentIframeClient extends StandardInteractionClient {\n protected apiId: ApiId;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, correlationId);\n this.apiId = apiId;\n }\n\n /**\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none\n * @param request\n */\n async acquireToken(request: SsoSilentRequest): Promise<AuthenticationResult> {\n this.logger.verbose(\"acquireTokenByIframe called\");\n // Check that we have some SSO data\n if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\n }\n\n // Check that prompt is set to none, throw error if it is set to anything else.\n if (request.prompt && request.prompt !== PromptValue.NONE) {\n throw BrowserAuthError.createSilentPromptValueError(request.prompt);\n }\n\n // Create silent request\n const silentRequest: AuthorizationUrlRequest = await this.initializeAuthorizationRequest({\n ...request,\n prompt: PromptValue.NONE\n }, InteractionType.Silent);\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || \"\", silentRequest.account || null);\n\n const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\n\n try {\n // Create auth code request and generate PKCE params\n const authCodeRequest: CommonAuthorizationCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);\n\n // Initialize the client\n const authClient: AuthorizationCodeClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);\n this.logger.verbose(\"Auth code client created\");\n\n // Create authorize request url\n const navigateUrl = await authClient.getAuthCodeUrl(silentRequest);\n\n return await this.silentTokenHelper(navigateUrl, authCodeRequest, authClient, this.logger);\n } catch (e) {\n if (e instanceof AuthError) {\n e.setCorrelationId(this.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n this.browserStorage.cleanRequestByState(silentRequest.state);\n throw e;\n }\n }\n\n /**\n * Currently Unsupported\n */\n logout(): Promise<void> {\n // Synchronous so we must reject\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\n }\n\n /**\n * Helper which acquires an authorization code silently using a hidden iframe from given url\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\n * @param navigateUrl\n * @param userRequestScopes\n */\n protected async silentTokenHelper(navigateUrl: string, authCodeRequest: CommonAuthorizationCodeRequest, authClient: AuthorizationCodeClient, browserRequestLogger: Logger): Promise<AuthenticationResult> {\n // Create silent handler\n const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, browserRequestLogger, this.config.system.navigateFrameWait);\n // Get the frame handle for the silent request\n const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\n const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);\n const state = this.validateAndExtractStateFromHash(hash, InteractionType.Silent, authCodeRequest.correlationId);\n\n // Handle response from hash string\n return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;IAiBwC,sCAAyB;IAG7D,4BAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,KAAY,EAAE,aAAsB;QAAzN,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,CAAC,SAEnG;QADG,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;KACtB;;;;;IAMK,yCAAY,GAAlB,UAAmB,OAAyB;;;;;;wBACxC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;;wBAEnD,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;4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4BACxB,GAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;yBAC1C;wBACD,sBAAsB,CAAC,kBAAkB,CAAC,GAAC,CAAC,CAAC;wBAC7C,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;wBAC7D,MAAM,GAAC,CAAC;;;;;KAEf;;;;IAKD,mCAAM,GAAN;;QAEI,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC;KAChF;;;;;;;IAQe,8CAAiB,GAAjC,UAAkC,WAAmB,EAAE,eAA+C,EAAE,UAAmC,EAAE,oBAA4B;;;;;;wBAE/J,aAAa,GAAG,IAAI,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;wBAEpI,qBAAM,aAAa,CAAC,mBAAmB,CAAC,WAAW,CAAC,EAAA;;wBAAhE,SAAS,GAAG,SAAoD;wBAEzD,qBAAM,aAAa,CAAC,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAA;;wBAAhG,IAAI,GAAG,SAAyF;wBAChG,KAAK,GAAG,IAAI,CAAC,+BAA+B,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;;wBAGhH,sBAAO,aAAa,CAAC,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,EAAC;;;;KAC1G;IACL,yBAAC;AAAD,CAjFA,CAAwC,yBAAyB;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { StandardInteractionClient } from "./StandardInteractionClient";
2
- import { CommonSilentFlowRequest, AuthenticationResult, ServerTelemetryManager, RefreshTokenClient } from "@azure/msal-common";
2
+ import { CommonSilentFlowRequest, AuthenticationResult, ServerTelemetryManager, RefreshTokenClient, AzureCloudOptions } from "@azure/msal-common";
3
3
  export declare class SilentRefreshClient extends StandardInteractionClient {
4
4
  /**
5
5
  * Exchanges the refresh token for new tokens
@@ -15,6 +15,6 @@ export declare class SilentRefreshClient extends StandardInteractionClient {
15
15
  * @param serverTelemetryManager
16
16
  * @param authorityUrl
17
17
  */
18
- protected createRefreshTokenClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<RefreshTokenClient>;
18
+ protected createRefreshTokenClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string, azureCloudOptions?: AzureCloudOptions): Promise<RefreshTokenClient>;
19
19
  }
20
20
  //# sourceMappingURL=SilentRefreshClient.d.ts.map