@azure/msal-browser 2.17.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +203 -0
- package/{changelog.md → CHANGELOG.md} +506 -445
- package/LICENSE +21 -21
- package/README.md +14 -6
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +31 -0
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +96 -3
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.d.ts +6 -0
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.js +13 -1
- package/dist/app/IPublicClientApplication.js.map +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +31 -24
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts +46 -0
- package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -0
- package/dist/cache/AsyncMemoryStorage.js +195 -0
- package/dist/cache/AsyncMemoryStorage.js.map +1 -0
- package/dist/cache/BrowserCacheManager.d.ts +9 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +55 -2
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.d.ts +1 -1
- package/dist/cache/BrowserStorage.d.ts.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/BrowserStorage.js.map +1 -1
- package/dist/cache/DatabaseStorage.d.ts +25 -6
- package/dist/cache/DatabaseStorage.d.ts.map +1 -1
- package/dist/cache/DatabaseStorage.js +127 -81
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/IAsyncMemoryStorage.d.ts +28 -0
- package/dist/cache/IAsyncMemoryStorage.d.ts.map +1 -0
- package/dist/cache/IWindowStorage.d.ts +3 -3
- package/dist/cache/IWindowStorage.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.d.ts +3 -3
- package/dist/cache/MemoryStorage.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/MemoryStorage.js.map +1 -1
- package/dist/cache/TokenCache.js +1 -1
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +3 -1
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.js +3 -2
- package/dist/crypto/BrowserCrypto.js.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +16 -5
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +58 -17
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/GuidGenerator.js.map +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js.map +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +6 -2
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/crypto/SignedHttpRequest.js +11 -5
- package/dist/crypto/SignedHttpRequest.js.map +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Decode.js.map +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/encode/Base64Encode.js.map +1 -1
- package/dist/error/BrowserAuthError.d.ts +16 -8
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.js +22 -12
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
- package/dist/event/EventHandler.d.ts +13 -0
- package/dist/event/EventHandler.d.ts.map +1 -1
- package/dist/event/EventHandler.js +66 -1
- package/dist/event/EventHandler.js.map +1 -1
- package/dist/event/EventMessage.d.ts +2 -2
- package/dist/event/EventMessage.d.ts.map +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventMessage.js.map +1 -1
- package/dist/event/EventType.d.ts +5 -0
- package/dist/event/EventType.d.ts.map +1 -1
- package/dist/event/EventType.js +6 -1
- package/dist/event/EventType.js.map +1 -1
- package/dist/index.cjs.js +1465 -520
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts +21 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +77 -3
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +5 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +21 -0
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -0
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.js +47 -37
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +16 -15
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +22 -0
- package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -0
- package/dist/interaction_client/SilentAuthCodeClient.js +82 -0
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -0
- package/dist/interaction_client/SilentCacheClient.d.ts +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +12 -2
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +15 -13
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +10 -7
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts +3 -23
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +51 -105
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +11 -2
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +36 -10
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/PopupHandler.js +1 -1
- package/dist/interaction_handler/PopupHandler.js.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +2 -2
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js.map +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/navigation/NavigationClient.js.map +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/FetchClient.js.map +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/network/XhrClient.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -0
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -0
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/PopupRequest.d.ts +1 -1
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -1
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/SilentRequest.d.ts +1 -1
- package/dist/request/SilentRequest.d.ts.map +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/request/SsoSilentRequest.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.d.ts +4 -0
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +8 -3
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserProtocolUtils.js.map +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js.map +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/BrowserUtils.js.map +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/dist/utils/MathUtils.js.map +1 -1
- package/dist/utils/PopupUtils.js +1 -1
- package/dist/utils/PopupUtils.js.map +1 -1
- package/lib/msal-browser.js +1465 -520
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +30 -30
- package/package.json +9 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentHandler.js","sources":["../../src/interaction_handler/SilentHandler.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"SilentHandler.js","sources":["../../src/interaction_handler/SilentHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UrlString, StringUtils, CommonAuthorizationCodeRequest, AuthorizationCodeClient, Constants, Logger } from \"@azure/msal-common\";\nimport { InteractionHandler } from \"./InteractionHandler\";\nimport { BrowserConstants } from \"../utils/BrowserConstants\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { DEFAULT_IFRAME_TIMEOUT_MS } from \"../config/Configuration\";\n\nexport class SilentHandler extends InteractionHandler {\n\n private navigateFrameWait: number;\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger, navigateFrameWait: number) {\n super(authCodeModule, storageImpl, authCodeRequest, browserRequestLogger);\n this.navigateFrameWait = navigateFrameWait;\n }\n\n /**\n * Creates a hidden iframe to given URL using user-requested scopes as an id.\n * @param urlNavigate\n * @param userRequestScopes\n */\n async initiateAuthRequest(requestUrl: string): Promise<HTMLIFrameElement> {\n if (StringUtils.isEmpty(requestUrl)) {\n // Throw error if request URL is empty.\n this.browserRequestLogger.info(\"Navigate url is empty\");\n throw BrowserAuthError.createEmptyNavigationUriError();\n }\n\n return this.navigateFrameWait ? await this.loadFrame(requestUrl) : this.loadFrameSync(requestUrl);\n }\n\n /**\n * Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.\n * @param iframe\n * @param timeout\n */\n monitorIframeForHash(iframe: HTMLIFrameElement, timeout: number): Promise<string> {\n return new Promise((resolve, reject) => {\n if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {\n this.browserRequestLogger.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${timeout}ms) than the default (${DEFAULT_IFRAME_TIMEOUT_MS}ms). This may result in timeouts.`);\n }\n\n /*\n * Polling for iframes can be purely timing based,\n * since we don't need to account for interaction.\n */\n const nowMark = window.performance.now();\n const timeoutMark = nowMark + timeout;\n\n const intervalId = setInterval(() => {\n if (window.performance.now() > timeoutMark) {\n this.removeHiddenIframe(iframe);\n clearInterval(intervalId);\n reject(BrowserAuthError.createMonitorIframeTimeoutError());\n return;\n }\n\n let href: string = Constants.EMPTY_STRING;\n const contentWindow = iframe.contentWindow;\n try {\n /*\n * Will throw if cross origin,\n * which should be caught and ignored\n * since we need the interval to keep running while on STS UI.\n */\n href = contentWindow ? contentWindow.location.href : Constants.EMPTY_STRING;\n } catch (e) {}\n\n if (StringUtils.isEmpty(href)) {\n return;\n }\n\n const contentHash = contentWindow ? contentWindow.location.hash: Constants.EMPTY_STRING;\n if (UrlString.hashContainsKnownProperties(contentHash)) {\n // Success case\n this.removeHiddenIframe(iframe);\n clearInterval(intervalId);\n resolve(contentHash);\n return;\n }\n }, BrowserConstants.POLL_INTERVAL_MS);\n });\n }\n\n /**\n * @hidden\n * Loads iframe with authorization endpoint URL\n * @ignore\n */\n private loadFrame(urlNavigate: string): Promise<HTMLIFrameElement> {\n /*\n * This trick overcomes iframe navigation in IE\n * IE does not load the page consistently in iframe\n */\n\n return new Promise((resolve, reject) => {\n const frameHandle = this.createHiddenIframe();\n\n setTimeout(() => {\n if (!frameHandle) {\n reject(\"Unable to load iframe\");\n return;\n }\n\n frameHandle.src = urlNavigate;\n\n resolve(frameHandle);\n }, this.navigateFrameWait);\n });\n }\n\n /**\n * @hidden\n * Loads the iframe synchronously when the navigateTimeFrame is set to `0`\n * @param urlNavigate\n * @param frameName\n * @param logger\n */\n private loadFrameSync(urlNavigate: string): HTMLIFrameElement{\n const frameHandle = this.createHiddenIframe();\n\n frameHandle.src = urlNavigate;\n\n return frameHandle;\n }\n\n /**\n * @hidden\n * Creates a new hidden iframe or gets an existing one for silent token renewal.\n * @ignore\n */\n private createHiddenIframe(): HTMLIFrameElement {\n const authFrame = document.createElement(\"iframe\");\n\n authFrame.style.visibility = \"hidden\";\n authFrame.style.position = \"absolute\";\n authFrame.style.width = authFrame.style.height = \"0\";\n authFrame.style.border = \"0\";\n authFrame.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-forms\");\n document.getElementsByTagName(\"body\")[0].appendChild(authFrame);\n\n return authFrame;\n }\n\n /**\n * @hidden\n * Removes a hidden iframe from the page.\n * @ignore\n */\n private removeHiddenIframe(iframe: HTMLIFrameElement): void {\n if (document.body === iframe.parentNode) {\n document.body.removeChild(iframe);\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;IAYmC,iCAAkB;IAGjD,uBAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B,EAAE,iBAAyB;QAA/L,YACI,kBAAM,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,CAAC,SAE5E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;;;;IAOO,0CAAkB,GAA1B;QACI,IAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAEnD,SAAS,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;QACtC,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QACtC,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;QACrD,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC;QAC7B,SAAS,CAAC,YAAY,CAAC,SAAS,EAAE,6CAA6C,CAAC,CAAC;QACjF,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAEhE,OAAO,SAAS,CAAC;KACpB;;;;;;IAOO,0CAAkB,GAA1B,UAA2B,MAAyB;QAChD,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM,CAAC,UAAU,EAAE;YACrC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SACrC;KACJ;IACL,oBAAC;AAAD,CAlJA,CAAmC,kBAAkB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationClient.js","sources":["../../src/navigation/NavigationClient.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"NavigationClient.js","sources":["../../src/navigation/NavigationClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INavigationClient } from \"./INavigationClient\";\nimport { NavigationOptions } from \"./NavigationOptions\";\n\nexport class NavigationClient implements INavigationClient {\n /**\n * Navigates to other pages within the same web application\n * @param url \n * @param options \n */\n navigateInternal(url: string, options: NavigationOptions): Promise<boolean>{\n return NavigationClient.defaultNavigateWindow(url, options);\n }\n\n /**\n * Navigates to other pages outside the web application i.e. the Identity Provider\n * @param url \n * @param options \n */\n navigateExternal(url: string, options: NavigationOptions): Promise<boolean> {\n return NavigationClient.defaultNavigateWindow(url, options);\n }\n\n /**\n * Default navigation implementation invoked by the internal and external functions\n * @param url \n * @param options \n */\n private static defaultNavigateWindow(url: string, options: NavigationOptions): Promise<boolean> {\n if (options.noHistory) {\n window.location.replace(url);\n } else {\n window.location.assign(url);\n }\n\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(true);\n }, options.timeout);\n });\n }\n}\n"],"names":[],"mappings":";;AAAA;;;;;IAQA;KAqCC;;;;;;IA/BG,2CAAgB,GAAhB,UAAiB,GAAW,EAAE,OAA0B;QACpD,OAAO,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAC/D;;;;;;IAOD,2CAAgB,GAAhB,UAAiB,GAAW,EAAE,OAA0B;QACpD,OAAO,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KAC/D;;;;;;IAOc,sCAAqB,GAApC,UAAqC,GAAW,EAAE,OAA0B;QACxE,IAAI,OAAO,CAAC,SAAS,EAAE;YACnB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SAChC;aAAM;YACH,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SAC/B;QAED,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO;YACvB,UAAU,CAAC;gBACP,OAAO,CAAC,IAAI,CAAC,CAAC;aACjB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;SACvB,CAAC,CAAC;KACN;IACL,uBAAC;AAAD,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FetchClient.js","sources":["../../src/network/FetchClient.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"FetchClient.js","sources":["../../src/network/FetchClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule, NetworkRequestOptions, NetworkResponse } from \"@azure/msal-common\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { HTTP_REQUEST_TYPE } from \"../utils/BrowserConstants\";\n\n/**\n * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\n */\nexport class FetchClient implements INetworkModule {\n\n /**\n * Fetch Client for REST endpoints - Get request\n * @param url \n * @param headers \n * @param body \n */\n async sendGetRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.GET,\n headers: this.getFetchHeaders(options)\n });\n } catch (e) {\n if (window.navigator.onLine) {\n throw BrowserAuthError.createGetRequestFailedError(e, url);\n } else {\n throw BrowserAuthError.createNoNetworkConnectivityError();\n }\n }\n\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: await response.json() as T,\n status: response.status\n };\n } catch (e) {\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\n }\n }\n\n /**\n * Fetch Client for REST endpoints - Post request\n * @param url \n * @param headers \n * @param body \n */\n async sendPostRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n const reqBody = (options && options.body) || \"\";\n\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.POST,\n headers: this.getFetchHeaders(options),\n body: reqBody\n });\n } catch (e) {\n if (window.navigator.onLine) {\n throw BrowserAuthError.createPostRequestFailedError(e, url);\n } else {\n throw BrowserAuthError.createNoNetworkConnectivityError();\n }\n }\n\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: await response.json() as T,\n status: response.status\n };\n } catch (e) {\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\n }\n }\n\n /**\n * Get Fetch API Headers object from string map\n * @param inputHeaders \n */\n private getFetchHeaders(options?: NetworkRequestOptions): Headers {\n const headers = new Headers();\n if (!(options && options.headers)) {\n return headers;\n }\n const optionsHeaders = options.headers;\n Object.keys(optionsHeaders).forEach((key) => {\n headers.append(key, optionsHeaders[key]);\n });\n return headers;\n }\n\n private getHeaderDict(headers: Headers): Record<string, string> {\n const headerDict: Record<string, string> = {};\n headers.forEach((value: string, key: string) => {\n headerDict[key] = value;\n });\n return headerDict;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AASA;;;;IAGA;KA4FC;;;;;;;IApFS,yCAAmB,GAAzB,UAA6B,GAAW,EAAE,OAA+B;;;;;;;wBAGtD,qBAAM,KAAK,CAAC,GAAG,EAAE;gCACxB,MAAM,EAAE,iBAAiB,CAAC,GAAG;gCAC7B,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;6BACzC,CAAC,EAAA;;wBAHF,QAAQ,GAAG,SAGT,CAAC;;;;wBAEH,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE;4BACzB,MAAM,gBAAgB,CAAC,2BAA2B,CAAC,GAAC,EAAE,GAAG,CAAC,CAAC;yBAC9D;6BAAM;4BACH,MAAM,gBAAgB,CAAC,gCAAgC,EAAE,CAAC;yBAC7D;;;;4BAKG,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC;;wBACvC,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;4BAF/B,uBAEI,OAAI,IAAE,SAA0B,CAAA;4BAChC,SAAM,GAAE,QAAQ,CAAC,MAAM;iCACzB;;;wBAEF,MAAM,gBAAgB,CAAC,uCAAuC,CAAC,GAAG,CAAC,CAAC;;;;;KAE3E;;;;;;;IAQK,0CAAoB,GAA1B,UAA8B,GAAW,EAAE,OAA+B;;;;;;wBAChE,OAAO,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC;;;;wBAIjC,qBAAM,KAAK,CAAC,GAAG,EAAE;gCACxB,MAAM,EAAE,iBAAiB,CA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C,CAAC;QACH,OAAO,UAAU,CAAC;KACrB;IACL,kBAAC;AAAD,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XhrClient.js","sources":["../../src/network/XhrClient.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"XhrClient.js","sources":["../../src/network/XhrClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule, NetworkRequestOptions, NetworkResponse } from \"@azure/msal-common\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { HTTP_REQUEST_TYPE } from \"../utils/BrowserConstants\";\n\n/**\n * This client implements the XMLHttpRequest class to send GET and POST requests.\n */\nexport class XhrClient implements INetworkModule {\n\n /**\n * XhrClient for REST endpoints - Get request\n * @param url \n * @param headers \n * @param body \n */\n async sendGetRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n return this.sendRequestAsync(url, HTTP_REQUEST_TYPE.GET, options);\n }\n\n /**\n * XhrClient for REST endpoints - Post request\n * @param url \n * @param headers \n * @param body \n */\n async sendPostRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n return this.sendRequestAsync(url, HTTP_REQUEST_TYPE.POST, options);\n }\n\n /**\n * Helper for XhrClient requests.\n * @param url \n * @param method \n * @param options \n */\n private sendRequestAsync<T>(url: string, method: HTTP_REQUEST_TYPE, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n return new Promise<NetworkResponse<T>>((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(method, url, /* async: */ true);\n this.setXhrHeaders(xhr, options);\n xhr.onload = (): void => {\n if (xhr.status < 200 || xhr.status >= 300) {\n if (method === HTTP_REQUEST_TYPE.POST) {\n reject(BrowserAuthError.createPostRequestFailedError(`Failed with status ${xhr.status}`, url));\n } else {\n reject(BrowserAuthError.createGetRequestFailedError(`Failed with status ${xhr.status}`, url));\n }\n }\n try {\n const jsonResponse = JSON.parse(xhr.responseText) as T;\n const networkResponse: NetworkResponse<T> = {\n headers: this.getHeaderDict(xhr),\n body: jsonResponse,\n status: xhr.status\n };\n resolve(networkResponse);\n } catch (e) {\n reject(BrowserAuthError.createFailedToParseNetworkResponseError(url));\n }\n };\n\n xhr.onerror = (): void => {\n if (window.navigator.onLine) {\n if (method === HTTP_REQUEST_TYPE.POST) {\n reject(BrowserAuthError.createPostRequestFailedError(`Failed with status ${xhr.status}`, url));\n } else {\n reject(BrowserAuthError.createGetRequestFailedError(`Failed with status ${xhr.status}`, url));\n }\n } else {\n reject(BrowserAuthError.createNoNetworkConnectivityError());\n }\n };\n\n if (method === HTTP_REQUEST_TYPE.POST && options && options.body) {\n xhr.send(options.body);\n } else if (method === HTTP_REQUEST_TYPE.GET) {\n xhr.send();\n } else {\n throw BrowserAuthError.createHttpMethodNotImplementedError(method);\n }\n });\n }\n\n /**\n * Helper to set XHR headers for request.\n * @param xhr \n * @param options \n */\n private setXhrHeaders(xhr: XMLHttpRequest, options?: NetworkRequestOptions): void {\n if (options && options.headers) {\n const headers = options.headers;\n Object.keys(headers).forEach((key: string) => {\n xhr.setRequestHeader(key, headers[key]);\n });\n }\n }\n\n /**\n * Gets a string map of the headers received in the response.\n * \n * Algorithm comes from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders\n * @param xhr \n */\n private getHeaderDict(xhr: XMLHttpRequest): Record<string, string> {\n const headerString = xhr.getAllResponseHeaders();\n const headerArr = headerString.trim().split(/[\\r\\n]+/);\n const headerDict: Record<string, string> = {};\n headerArr.forEach((value: string) => {\n const parts = value.split(\": \");\n const headerName = parts.shift();\n const headerVal = parts.join(\": \");\n if (headerName && headerVal) {\n headerDict[headerName] = headerVal;\n }\n });\n\n return headerDict;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AASA;;;;IAGA;KA+GC;;;;;;;IAvGS,uCAAmB,GAAzB,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GAAG,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAO,CAAC,GAAG,CAAC,CAAC,CAAC;aAC3C,CAAC,CAAC;SACN;KACJ;;;;;;;IAQO,iCAAa,GAArB,UAAsB,GAAmB;QACrC,IAAM,YAAY,GAAG,GAAG,CAAC,qBAAqB,EAAE,CAAC;QACjD,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACvD,IAAM,UAAU,GAA2B,EAAE,CAAC;QAC9C,SAAS,CAAC,OAAO,CAAC,UAAC,KAAa;YAC5B,IAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChC,IAAM,UAAU,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YACjC,IAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,UAAU,IAAI,SAAS,EAAE;gBACzB,UAAU,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;aACtC;SACJ,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;KACrB;IACL,gBAAC;AAAD,CAAC;;;;"}
|
package/dist/packageMetadata.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.21.0 2022-01-04 */
|
|
2
2
|
'use strict';
|
|
3
3
|
/* eslint-disable header/header */
|
|
4
4
|
var name = "@azure/msal-browser";
|
|
5
|
-
var version = "2.
|
|
5
|
+
var version = "2.21.0";
|
|
6
6
|
|
|
7
7
|
export { name, version };
|
|
8
8
|
//# sourceMappingURL=packageMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-browser\";\nexport const version = \"2.
|
|
1
|
+
{"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-browser\";\nexport const version = \"2.21.0\";\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,sBAAsB;IAC7B,OAAO,GAAG;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommonAuthorizationCodeRequest } from "@azure/msal-common";
|
|
2
|
+
export declare type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "code" | "enableSpaAuthorizationCode" | "requestedClaimsHash">> & {
|
|
3
|
+
code: string;
|
|
4
|
+
cloudGraphHostName?: string;
|
|
5
|
+
msGraphHost?: string;
|
|
6
|
+
cloudInstanceHostName?: string;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=AuthorizationCodeRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorizationCodeRequest.d.ts","sourceRoot":"","sources":["../../src/request/AuthorizationCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,oBAAY,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,MAAM,GAAC,4BAA4B,GAAC,qBAAqB,CAAC,CAAC,GAAG;IAC9I,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
|
|
|
2
2
|
/**
|
|
3
3
|
* This type is deprecated and will be removed on the next major version update
|
|
4
4
|
*/
|
|
5
|
-
export declare type AuthorizationUrlRequest = Omit<CommonAuthorizationUrlRequest, "state" | "nonce"> & {
|
|
5
|
+
export declare type AuthorizationUrlRequest = Omit<CommonAuthorizationUrlRequest, "state" | "nonce" | "requestedClaimsHash"> & {
|
|
6
6
|
state: string;
|
|
7
7
|
nonce: string;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationUrlRequest.d.ts","sourceRoot":"","sources":["../../src/request/AuthorizationUrlRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,oBAAY,uBAAuB,GAAG,IAAI,CAAC,6BAA6B,EAAE,OAAO,GAAC,OAAO,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"AuthorizationUrlRequest.d.ts","sourceRoot":"","sources":["../../src/request/AuthorizationUrlRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,oBAAY,uBAAuB,GAAG,IAAI,CAAC,6BAA6B,EAAE,OAAO,GAAC,OAAO,GAAC,qBAAqB,CAAC,GAAG;IAC/G,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -25,7 +25,7 @@ import { PopupWindowAttributes } from "../utils/PopupUtils";
|
|
|
25
25
|
* - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
|
|
26
26
|
* - popupWindowAttributes - Optional popup window attributes. popupSize with height and width, and popupPosition with top and left can be set.
|
|
27
27
|
*/
|
|
28
|
-
export declare type PopupRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod">> & {
|
|
28
|
+
export declare type PopupRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">> & {
|
|
29
29
|
scopes: Array<string>;
|
|
30
30
|
popupWindowAttributes?: PopupWindowAttributes;
|
|
31
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/PopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oBAAY,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,CAAC,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"PopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/PopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oBAAY,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,CAAC,CAAC,GAAG;IAC3J,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD,CAAC"}
|
|
@@ -25,7 +25,7 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
|
|
|
25
25
|
* - redirectStartPage - The page that should be returned to after loginRedirect or acquireTokenRedirect. This should only be used if this is different from the redirectUri and will default to the page that initiates the request. When the navigateToLoginRequestUrl config option is set to false this parameter will be ignored.
|
|
26
26
|
* - onRedirectNavigate - Callback that will be passed the url that MSAL will navigate to. Returning false in the callback will stop navigation.
|
|
27
27
|
*/
|
|
28
|
-
export declare type RedirectRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod">> & {
|
|
28
|
+
export declare type RedirectRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">> & {
|
|
29
29
|
scopes: Array<string>;
|
|
30
30
|
redirectStartPage?: string;
|
|
31
31
|
onRedirectNavigate?: (url: string) => boolean | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedirectRequest.d.ts","sourceRoot":"","sources":["../../src/request/RedirectRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,CAAC,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"RedirectRequest.d.ts","sourceRoot":"","sources":["../../src/request/RedirectRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,CAAC,CAAC,GAAG;IAC9J,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;CACxD,CAAC"}
|
|
@@ -13,7 +13,7 @@ import { AccountInfo, CommonSilentFlowRequest, StringDict } from "@azure/msal-co
|
|
|
13
13
|
* - tokenQueryParameters - String to string map of custom query parameters added to the /token call. Only used when renewing access tokens.
|
|
14
14
|
* - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal. Only used for cases where refresh token is expired.
|
|
15
15
|
*/
|
|
16
|
-
export declare type SilentRequest = Omit<CommonSilentFlowRequest, "authority" | "correlationId" | "forceRefresh" | "account"> & {
|
|
16
|
+
export declare type SilentRequest = Omit<CommonSilentFlowRequest, "authority" | "correlationId" | "forceRefresh" | "account" | "requestedClaimsHash"> & {
|
|
17
17
|
redirectUri?: string;
|
|
18
18
|
extraQueryParameters?: StringDict;
|
|
19
19
|
authority?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEtF;;;;;;;;;;;;;GAaG;AACH,oBAAY,aAAa,GAAG,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAC,eAAe,GAAC,cAAc,GAAC,SAAS,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"SilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEtF;;;;;;;;;;;;;GAaG;AACH,oBAAY,aAAa,GAAG,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAC,eAAe,GAAC,cAAc,GAAC,SAAS,GAAC,qBAAqB,CAAC,GAAG;IACpI,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -22,5 +22,5 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
|
|
|
22
22
|
* - tokenQueryParameters - String to string map of custom query parameters added to the /token call
|
|
23
23
|
* - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
|
|
24
24
|
*/
|
|
25
|
-
export declare type SsoSilentRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod">>;
|
|
25
|
+
export declare type SsoSilentRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">>;
|
|
26
26
|
//# sourceMappingURL=SsoSilentRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsoSilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SsoSilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,oBAAY,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,eAAe,GAAC,qBAAqB,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"SsoSilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SsoSilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,oBAAY,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,CAAC,CAAC,CAAC"}
|
|
@@ -82,6 +82,7 @@ export declare enum ApiId {
|
|
|
82
82
|
ssoSilent = 863,
|
|
83
83
|
acquireTokenSilent_authCode = 864,
|
|
84
84
|
handleRedirectPromise = 865,
|
|
85
|
+
acquireTokenByCode = 866,
|
|
85
86
|
acquireTokenSilent_silentFlow = 61,
|
|
86
87
|
logout = 961,
|
|
87
88
|
logoutPopup = 962
|
|
@@ -134,4 +135,7 @@ export declare enum WrapperSKU {
|
|
|
134
135
|
React = "@azure/msal-react",
|
|
135
136
|
Angular = "@azure/msal-angular"
|
|
136
137
|
}
|
|
138
|
+
export declare const DB_NAME = "msal.db";
|
|
139
|
+
export declare const DB_VERSION = 1;
|
|
140
|
+
export declare const DB_TABLE_NAME: string;
|
|
137
141
|
//# sourceMappingURL=BrowserConstants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CAAC;AAEF,oBAAY,oBAAoB;IAC5B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,SAAS,cAAc;IACvB,qBAAqB,yBAAyB;IAC9C,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,aAAa,mBAAmB;IAChC,UAAU,mBAAmB;IAC7B,YAAY,uBAAuB;IACnC,QAAQ,YAAY;IACpB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,sBAAsB,uBAAuB;IAC7C,cAAc,mBAAmB;IACjC,cAAc,0BAA0B;CAC3C;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,WAAW,gBAAgB;IAC3B,WAAW,oBAAoB;CAClC;AAED;;;;;GAKG;AACH,oBAAY,KAAK;IACb,oBAAoB,MAAM;IAC1B,iBAAiB,MAAM;IACvB,SAAS,MAAM;IACf,2BAA2B,MAAM;IACjC,qBAAqB,MAAM;IAC3B,6BAA6B,KAAK;IAClC,MAAM,MAAM;IACZ,WAAW,MAAM;CACpB;AAKD,oBAAY,eAAe;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;CACpB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IACzB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,YAAY,iBAAiB;IAC7B;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,IAAI,SAAS;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,eAAe,GAAC,YAE7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAGpC,oBAAY,UAAU;IAClB,KAAK,sBAAsB;IAC3B,OAAO,wBAAwB;CAClC"}
|
|
1
|
+
{"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CAAC;AAEF,oBAAY,oBAAoB;IAC5B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,SAAS,cA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ser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.21.0 2022-01-04 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';
|
|
4
4
|
|
|
@@ -93,6 +93,7 @@ var ApiId;
|
|
|
93
93
|
ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
|
|
94
94
|
ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
|
|
95
95
|
ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
|
|
96
|
+
ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
|
|
96
97
|
ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
|
|
97
98
|
ApiId[ApiId["logout"] = 961] = "logout";
|
|
98
99
|
ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
|
|
@@ -153,7 +154,11 @@ var WrapperSKU;
|
|
|
153
154
|
(function (WrapperSKU) {
|
|
154
155
|
WrapperSKU["React"] = "@azure/msal-react";
|
|
155
156
|
WrapperSKU["Angular"] = "@azure/msal-angular";
|
|
156
|
-
})(WrapperSKU || (WrapperSKU = {}));
|
|
157
|
+
})(WrapperSKU || (WrapperSKU = {}));
|
|
158
|
+
// DatabaseStorage Constants
|
|
159
|
+
var DB_NAME = "msal.db";
|
|
160
|
+
var DB_VERSION = 1;
|
|
161
|
+
var DB_TABLE_NAME = DB_NAME + ".keys";
|
|
157
162
|
|
|
158
|
-
export { ApiId, BrowserCacheLocation, BrowserConstants, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, TemporaryCacheKeys, WrapperSKU };
|
|
163
|
+
export { ApiId, BrowserCacheLocation, BrowserConstants, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, TemporaryCacheKeys, WrapperSKU };
|
|
159
164
|
//# sourceMappingURL=BrowserConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserConstants.js","sources":["../../src/utils/BrowserConstants.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"BrowserConstants.js","sources":["../../src/utils/BrowserConstants.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { OIDC_DEFAULT_SCOPES } from \"@azure/msal-common\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\n\n/**\n * Constants\n */\nexport const BrowserConstants = {\n /**\n * Interaction in progress cache value\n */\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\n /**\n * Invalid grant error code\n */\n INVALID_GRANT_ERROR: \"invalid_grant\",\n /**\n * Default popup window width\n */\n POPUP_WIDTH: 483,\n /**\n * Default popup window height\n */\n POPUP_HEIGHT: 600,\n /**\n * Name of the popup window starts with\n */\n POPUP_NAME_PREFIX: \"msal\",\n /**\n * Default popup monitor poll interval in milliseconds\n */\n POLL_INTERVAL_MS: 50,\n /**\n * Msal-browser SKU\n */\n MSAL_SKU: \"msal.js.browser\",\n};\n\nexport enum BrowserCacheLocation {\n LocalStorage = \"localStorage\",\n SessionStorage = \"sessionStorage\",\n MemoryStorage = \"memoryStorage\"\n}\n\n/**\n * HTTP Request types supported by MSAL.\n */\nexport enum HTTP_REQUEST_TYPE {\n GET = \"GET\",\n POST = \"POST\"\n}\n\n/**\n * Temporary cache keys for MSAL, deleted after any request.\n */\nexport enum TemporaryCacheKeys {\n AUTHORITY = \"authority\",\n ACQUIRE_TOKEN_ACCOUNT = \"acquireToken.account\",\n SESSION_STATE = \"session.state\",\n REQUEST_STATE = \"request.state\",\n NONCE_IDTOKEN = \"nonce.id_token\",\n ORIGIN_URI = \"request.origin\",\n RENEW_STATUS = \"token.renew.status\",\n URL_HASH = \"urlHash\",\n REQUEST_PARAMS = \"request.params\",\n SCOPES = \"scopes\",\n INTERACTION_STATUS_KEY = \"interaction.status\",\n CCS_CREDENTIAL = \"ccs.credential\",\n CORRELATION_ID = \"request.correlationId\"\n}\n\n/**\n * Cache keys stored in-memory\n */\nexport enum InMemoryCacheKeys {\n WRAPPER_SKU = \"wrapper.sku\",\n WRAPPER_VER = \"wrapper.version\"\n}\n\n/**\n * API Codes for Telemetry purposes. \n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\n * 0-99 Silent Flow\n * 800-899 Auth Code Flow\n */\nexport enum ApiId {\n acquireTokenRedirect = 861,\n acquireTokenPopup = 862,\n ssoSilent = 863,\n acquireTokenSilent_authCode = 864,\n handleRedirectPromise = 865,\n acquireTokenByCode = 866,\n acquireTokenSilent_silentFlow = 61,\n logout = 961,\n logoutPopup = 962\n}\n\n/*\n * Interaction type of the API - used for state and telemetry\n */\nexport enum InteractionType {\n Redirect = \"redirect\",\n Popup = \"popup\",\n Silent = \"silent\"\n}\n\n/**\n * Types of interaction currently in progress.\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\n */\nexport enum InteractionStatus {\n /**\n * Initial status before interaction occurs\n */\n Startup = \"startup\",\n /**\n * Status set when all login calls occuring\n */\n Login = \"login\",\n /**\n * Status set when logout call occuring\n */ \n Logout = \"logout\",\n /**\n * Status set for acquireToken calls\n */\n AcquireToken = \"acquireToken\",\n /**\n * Status set for ssoSilent calls\n */\n SsoSilent = \"ssoSilent\",\n /**\n * Status set when handleRedirect in progress\n */\n HandleRedirect = \"handleRedirect\",\n /**\n * Status set when interaction is complete\n */\n None = \"none\"\n}\n\nexport const DEFAULT_REQUEST: RedirectRequest|PopupRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n};\n\n/**\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\n */\nexport const KEY_FORMAT_JWK = \"jwk\";\n\n// Supported wrapper SKUs\nexport enum WrapperSKU {\n React = \"@azure/msal-react\",\n Angular = \"@azure/msal-angular\"\n}\n\n// DatabaseStorage Constants\nexport const DB_NAME = \"msal.db\";\nexport const DB_VERSION = 1;\nexport const DB_TABLE_NAME = `${DB_NAME}.keys`;\n"],"names":[],"mappings":";;;;AAAA;;;;AASA;;;IAGa,gBAAgB,GAAG;;;;IAI5B,6BAA6B,EAAE,yBAAyB;;;;IAIxD,mBAAmB,EAAE,eAAe;;;;IAIpC,WAAW,EAAE,GAAG;;;;IAIhB,YAAY,EAAE,GAAG;;;;IAIjB,iBAAiB,EAAE,MAAM;;;;IAIzB,gBAAgB,EAAE,EAAE;;;;IAIpB,QAAQ,EAAE,iBAAiB;EAC7B;IAEU;AAAZ,WAAY,oBAAoB;IAC5B,qDAA6B,CAAA;IAC7B,yDAAiC,CAAA;IACjC,uDAA+B,CAAA;AACnC,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B;AAED;;;IAGY;AAAZ,WAAY,iBAAiB;IACzB,gCAAW,CAAA;IACX,kCAAa,CAAA;AACjB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED;;;IAGY;AAAZ,WAAY,kBAAkB;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;IAC9C,qDAA+B,CAAA;IAC/B,qDAA+B,CAAA;IAC/B,sDAAgC,CAAA;IAChC,mDAA6B,CAAA;IAC7B,yDAAmC,CAAA;IACnC,0CAAoB,CAAA;IACpB,uDAAiC,CAAA;IACjC,uCAAiB,CAAA;IACjB,mEAA6C,CAAA;IAC7C,uDAAiC,CAAA;IACjC,8DAAwC,CAAA;AAC5C,CAAC,EAdW,kBAAkB,KAAlB,kBAAkB,QAc7B;AAED;;;IAGY;AAAZ,WAAY,iBAAiB;IACzB,gDAA2B,CAAA;IAC3B,oDAA+B,CAAA;AACnC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED;;;;;;IAMY;AAAZ,WAAY,KAAK;IACb,mEAA0B,CAAA;IAC1B,6DAAuB,CAAA;IACvB,6CAAe,CAAA;IACf,iFAAiC,CAAA;IACjC,qEAA2B,CAAA;IAC3B,+DAAwB,CAAA;IACxB,oFAAkC,CAAA;IAClC,uCAAY,CAAA;IACZ,iDAAiB,CAAA;AACrB,CAAC,EAVW,KAAK,KAAL,KAAK,QAUhB;AAED;;;IAGY;AAAZ,WAAY,eAAe;IACvB,wCAAqB,CAAA;IACrB,kCAAe,CAAA;IACf,oCAAiB,CAAA;AACrB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AAED;;;;IAIY;AAAZ,WAAY,iBAAiB;;;;IAIzB,wCAAmB,CAAA;;;;IAInB,oCAAe,CAAA;;;;IAIf,sCAAiB,CAAA;;;;IAIjB,kDAA6B,CAAA;;;;IAI7B,4CAAuB,CAAA;;;;IAIvB,sDAAiC,CAAA;;;;IAIjC,kCAAa,CAAA;AACjB,CAAC,EA7BW,iBAAiB,KAAjB,iBAAiB,QA6B5B;IAEY,eAAe,GAAiC;IACzD,MAAM,EAAE,mBAAmB;EAC7B;AAEF;;;IAGa,cAAc,GAAG,MAAM;AAEpC;IACY;AAAZ,WAAY,UAAU;IAClB,yCAA2B,CAAA;IAC3B,6CAA+B,CAAA;AACnC,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;IACa,OAAO,GAAG,UAAU;IACpB,UAAU,GAAG,EAAE;IACf,aAAa,GAAM,OAAO;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserProtocolUtils.js","sources":["../../src/utils/BrowserProtocolUtils.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"BrowserProtocolUtils.js","sources":["../../src/utils/BrowserProtocolUtils.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { InteractionType } from \"./BrowserConstants\";\nimport { StringUtils, ClientAuthError, ICrypto, RequestStateObject, ProtocolUtils, ServerAuthorizationCodeResponse, UrlString } from \"@azure/msal-common\";\n\nexport type BrowserStateObject = {\n interactionType: InteractionType\n};\n\nexport class BrowserProtocolUtils {\n\n /**\n * Extracts the BrowserStateObject from the state string.\n * @param browserCrypto \n * @param state \n */\n static extractBrowserRequestState(browserCrypto: ICrypto, state: string): BrowserStateObject | null {\n if (StringUtils.isEmpty(state)) {\n return null;\n }\n\n try {\n const requestStateObj: RequestStateObject = ProtocolUtils.parseRequestState(browserCrypto, state);\n return requestStateObj.libraryState.meta as BrowserStateObject;\n } catch (e) {\n throw ClientAuthError.createInvalidStateError(state, e);\n }\n }\n\n /**\n * Parses properties of server response from url hash\n * @param locationHash Hash from url\n */\n static parseServerResponseFromHash(locationHash: string): ServerAuthorizationCodeResponse {\n if (!locationHash) {\n return {};\n }\n \n const hashUrlString = new UrlString(locationHash);\n return UrlString.getDeserializedHash(hashUrlString.getHash());\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;;IAYA;KAgCC;;;;;;IAzBU,+CAA0B,GAAjC,UAAkC,aAAsB,EAAE,KAAa;QACnE,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC;SACf;QAED,IAAI;YACA,IAAM,eAAe,GAAuB,aAAa,CAAC,iBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;YAClG,OAAO,eAAe,CAAC,YAAY,CAAC,IAA0B,CAAC;SAClE;QAAC,OAAO,CAAC,EAAE;YACR,MAAM,eAAe,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC3D;KACJ;;;;;IAMM,gDAA2B,GAAlC,UAAmC,YAAoB;QACnD,IAAI,CAAC,YAAY,EAAE;YACf,OAAO,EAAE,CAAC;SACb;QAED,IAAM,aAAa,GAAG,IAAI,SAAS,CAAC,YAAY,CAAC,CAAC;QAClD,OAAO,SAAS,CAAC,mBAAmB,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC;KACjE;IACL,2BAAC;AAAD,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserStringUtils.js","sources":["../../src/utils/BrowserStringUtils.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"BrowserStringUtils.js","sources":["../../src/utils/BrowserStringUtils.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Utility functions for strings in a browser. See here for implementation details:\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\n */\nexport class BrowserStringUtils {\n\n /**\n * Converts string to Uint8Array\n * @param sDOMStr \n */\n static stringToUtf8Arr (sDOMStr: string): Uint8Array {\n let nChr;\n let nArrLen = 0;\n const nStrLen = sDOMStr.length;\n /* mapping... */\n for (let nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {\n nChr = sDOMStr.charCodeAt(nMapIdx);\n nArrLen += nChr < 0x80 ? 1 : nChr < 0x800 ? 2 : nChr < 0x10000 ? 3 : nChr < 0x200000 ? 4 : nChr < 0x4000000 ? 5 : 6;\n }\n\n const aBytes = new Uint8Array(nArrLen);\n\n /* transcription... */\n\n for (let nIdx = 0, nChrIdx = 0; nIdx < nArrLen; nChrIdx++) {\n nChr = sDOMStr.charCodeAt(nChrIdx);\n if (nChr < 128) {\n /* one byte */\n aBytes[nIdx++] = nChr;\n } else if (nChr < 0x800) {\n /* two bytes */\n aBytes[nIdx++] = 192 + (nChr >>> 6);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x10000) {\n /* three bytes */\n aBytes[nIdx++] = 224 + (nChr >>> 12);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x200000) {\n /* four bytes */\n aBytes[nIdx++] = 240 + (nChr >>> 18);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else if (nChr < 0x4000000) {\n /* five bytes */\n aBytes[nIdx++] = 248 + (nChr >>> 24);\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n } else /* if (nChr <= 0x7fffffff) */ {\n /* six bytes */\n aBytes[nIdx++] = 252 + (nChr >>> 30);\n aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\n aBytes[nIdx++] = 128 + (nChr & 63);\n }\n }\n\n return aBytes; \n }\n\n /**\n * Converst string to ArrayBuffer\n * @param dataString \n */\n static stringToArrayBuffer(dataString: string): ArrayBuffer {\n const data = new ArrayBuffer(dataString.length);\n const dataView = new Uint8Array(data);\n for (let i: number = 0; i < dataString.length; i++) {\n dataView[i] = dataString.charCodeAt(i);\n }\n return data;\n }\n\n /**\n * Converts Uint8Array to a string\n * @param aBytes \n */\n static utf8ArrToString (aBytes: Uint8Array): string {\n let sView = \"\";\n for (let nPart, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\n nPart = aBytes[nIdx];\n sView += String.fromCharCode(\n nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */\n /* (nPart - 252 << 30) may be not so safe in ECMAScript! So...: */\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\n : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\n (nPart - 192 << 6) + aBytes[++nIdx] - 128\n : /* nPart < 127 ? */ /* one byte */\n nPart\n );\n }\n return sView;\n }\n}\n"],"names":[],"mappings":";;AAAA;;;;AAKA;;;;;IAIA;KAoGC;;;;;IA9FU,kCAAe,GAAtB,UAAwB,OAAe;QACnC,IAAI,IAAI,CAAC;QACT,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,IAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;;QAE/B,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE;YAChD,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACnC,OAAO,IAAI,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,GAAG,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC;SACvH;QAED,IAAM,MAAM,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;;QAIvC,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,EAAE,OA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AC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG;sBACpI,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI;wBAC3C,CAAC,KAAK,GAAG,GAAG,IAAI,EAAE,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,IAAI,EAAE,CAAC,IAAI,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG;0BACrG,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI;4BAC3C,CAAC,KAAK,GAAG,GAAG,IAAI,EAAE,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG;8BACtE,KAAK,GAAG,GAAG,IAAI,KAAK,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC,GAAG,IAAI;gCAC3C,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,IAAI,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG;;oCAEzC,KAAK,CAC5B,CAAC;SACL;QACD,OAAO,KAAK,CAAC;KAChB;IACL,yBAAC;AAAD,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserUtils.js","sources":["../../src/utils/BrowserUtils.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"BrowserUtils.js","sources":["../../src/utils/BrowserUtils.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants, INetworkModule, UrlString } from \"@azure/msal-common\";\nimport { FetchClient } from \"../network/FetchClient\";\nimport { XhrClient } from \"../network/XhrClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { InteractionType, BrowserConstants } from \"./BrowserConstants\";\n\n/**\n * Utility class for browser specific functions\n */\nexport class BrowserUtils {\n\n // #region Window Navigation and URL management\n\n /**\n * Clears hash from window url.\n */\n static clearHash(contentWindow: Window): void {\n // Office.js sets history.replaceState to null\n contentWindow.location.hash = Constants.EMPTY_STRING;\n if (typeof contentWindow.history.replaceState === \"function\") {\n // Full removes \"#\" from url\n contentWindow.history.replaceState(null, Constants.EMPTY_STRING, `${contentWindow.location.origin}${contentWindow.location.pathname}${contentWindow.location.search}`);\n }\n }\n\n /**\n * Replaces current hash with hash from provided url\n */\n static replaceHash(url: string): void {\n const urlParts = url.split(\"#\");\n urlParts.shift(); // Remove part before the hash\n window.location.hash = urlParts.length > 0 ? urlParts.join(\"#\") : \"\";\n }\n\n /**\n * Returns boolean of whether the current window is in an iframe or not.\n */\n static isInIframe(): boolean {\n return window.parent !== window;\n }\n\n /**\n * Returns boolean of whether or not the current window is a popup opened by msal\n */\n static isInPopup(): boolean {\n return typeof window !== \"undefined\" && !!window.opener && \n window.opener !== window && \n typeof window.name === \"string\" && \n window.name.indexOf(`${BrowserConstants.POPUP_NAME_PREFIX}.`) === 0;\n }\n\n // #endregion\n\n /**\n * Returns current window URL as redirect uri\n */\n static getCurrentUri(): string {\n return window.location.href.split(\"?\")[0].split(\"#\")[0];\n }\n\n /**\n * Gets the homepage url for the current window location.\n */\n static getHomepage(): string {\n const currentUrl = new UrlString(window.location.href);\n const urlComponents = currentUrl.getUrlComponents();\n return `${urlComponents.Protocol}//${urlComponents.HostNameAndPort}/`;\n }\n\n /**\n * Returns best compatible network client object. \n */\n static getBrowserNetworkClient(): INetworkModule {\n if (window.fetch && window.Headers) {\n return new FetchClient();\n } else {\n return new XhrClient();\n }\n }\n\n /**\n * Throws error if we have completed an auth and are \n * attempting another auth request inside an iframe.\n */\n static blockReloadInHiddenIframes(): void {\n const isResponseHash = UrlString.hashContainsKnownProperties(window.location.hash);\n // return an error if called from the hidden iframe created by the msal js silent calls\n if (isResponseHash && BrowserUtils.isInIframe()) {\n throw BrowserAuthError.createBlockReloadInHiddenIframeError();\n }\n }\n\n /**\n * Block redirect operations in iframes unless explicitly allowed\n * @param interactionType Interaction type for the request\n * @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe\n */\n static blockRedirectInIframe(interactionType: InteractionType, allowRedirectInIframe: boolean): void {\n const isIframedApp = BrowserUtils.isInIframe();\n if (interactionType === InteractionType.Redirect && isIframedApp && !allowRedirectInIframe) {\n // If we are not in top frame, we shouldn't redirect. This is also handled by the service.\n throw BrowserAuthError.createRedirectInIframeError(isIframedApp);\n }\n }\n\n /**\n * Block redirectUri loaded in popup from calling AcquireToken APIs\n */\n static blockAcquireTokenInPopups(): void {\n // Popups opened by msal popup APIs are given a name that starts with \"msal.\"\n if (BrowserUtils.isInPopup()) {\n throw BrowserAuthError.createBlockAcquireTokenInPopupsError();\n }\n }\n\n /**\n * Throws error if token requests are made in non-browser environment\n * @param isBrowserEnvironment Flag indicating if environment is a browser.\n */\n static blockNonBrowserEnvironment(isBrowserEnvironment: boolean): void {\n if (!isBrowserEnvironment) {\n throw BrowserAuthError.createNonBrowserEnvironmentError();\n }\n }\n\n /**\n * Returns boolean of whether current browser is an Internet Explorer or Edge browser.\n */\n static detectIEOrEdge(): boolean {\n const ua = window.navigator.userAgent;\n const msie = ua.indexOf(\"MSIE \");\n const msie11 = ua.indexOf(\"Trident/\");\n const msedge = ua.indexOf(\"Edge/\");\n const isIE = msie > 0 || msie11 > 0;\n const isEdge = msedge > 0;\n return isIE || isEdge;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAWA;;;;IAGA;KAgIC;;;;;IAzHU,sBAAS,GAAhB,UAAiB,aAAqB;;QAElC,aAAa,CAAC,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC;QACrD,IAAI,OAAO,aAAa,CAAC,OAAO,CAAC,YAAY,KAAK,UAAU,EAAE;;YAE1D,a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AAO,CAAC,OAAO,CAAC,CAAC;QACnC,IAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;QACpC,IAAM,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;QAC1B,OAAO,IAAI,IAAI,MAAM,CAAC;KACzB;IACL,mBAAC;AAAD,CAAC;;;;"}
|
package/dist/utils/MathUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MathUtils.js","sources":["../../src/utils/MathUtils.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"MathUtils.js","sources":["../../src/utils/MathUtils.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Utility class for math specific functions in browser.\n */\nexport class MathUtils {\n\n /**\n * Decimal to Hex\n *\n * @param num\n */\n static decimalToHex(num: number): string {\n let hex: string = num.toString(16);\n while (hex.length < 2) {\n hex = \"0\" + hex;\n }\n return hex;\n }\n}\n"],"names":[],"mappings":";;AAAA;;;;AAKA;;;;IAGA;KAcC;;;;;;IAPU,sBAAY,GAAnB,UAAoB,GAAW;QAC3B,IAAI,GAAG,GAAW,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACnC,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;YACnB,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;SACnB;QACD,OAAO,GAAG,CAAC;KACd;IACL,gBAAC;AAAD,CAAC;;;;"}
|
package/dist/utils/PopupUtils.js
CHANGED