diff --git a/README.md b/README.md
index 2686ab4428..0890dc3ee6 100644
--- a/README.md
+++ b/README.md
@@ -79,14 +79,14 @@ Via NPM:
Via CDN:
```JavaScript
-
+
```
Note that msal.js is built for ES5, therefore enabling support of Internet Explorer 11. If you want to target Internet Explorer, you'll need to add a reference to promises polyfill. You might want to read more in the [FAQ](../../wiki)
```JavaScript
-
+
```
## Build and running tests
diff --git a/changelog.md b/changelog.md
index eca4d745b0..bcf0b1dc67 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,35 @@
+# 0.1.5
+
+### Breaking Changes
+
+* The constructor function in Msal is no longer asynchronous. To use the instance of userAgentApplication in the callback function passed in the constructor, use "this" in the calback function scope. Please see below:
+```
+ var userAgentApplication = new Msal.UserAgentApplication(applicationConfig.clientID, null, authCallback);
+ function authCallback(errorDesc, token, error, tokenType) {
+ console.log(userAgentApplication) //this will print undefined, use this instead
+ var self = this// self is instance of userAgentApplication
+ }
+```
+
+### New Features
+
+* By default, msal tries to take you back to the loginStartPage after successful authentication. To disable this setting, you can pass navigateToLoginRequestUrl:false
+in the options object in the constructor. In that case, msal will just set the url hash to null and call the provided callback, thereby avoiding an additional reload. Please see snippet below:
+```
+ var userAgentApplication = new Msal.UserAgentApplication(applicationConfig.clientID, null, authCallback, { navigateToLoginRequestUrl:false });
+```
+* The idToken object is now added as a property on user object in msal which can be used to query claims and the User class itself is exported under the global namespace.
+* loadFrameTimout(msec) is now configurable by setting it to a value in the options object passed to the userAgentApplication contructor. The default timeout is 6000 msec. Please see the snippet below to change it:
+```
+ var userAgentApplication = new Msal.UserAgentApplication(applicationConfig.clientID, null, authCallback, { loadFrameTimout:10000 });
+```
+
+# 0.1.4-beta
+
+### Bug fixes
+
+* Test version
+
# 0.1.3
### Bug fixes
diff --git a/devApps/ModuleSample/package.json b/devApps/ModuleSample/package.json
index d0da5471af..79c4d91c53 100644
--- a/devApps/ModuleSample/package.json
+++ b/devApps/ModuleSample/package.json
@@ -1,6 +1,6 @@
{
"name": "msalreact",
- "version": "0.1.3",
+ "version": "0.1.5",
"description": "",
"main": "index.js",
"scripts": {
diff --git a/dist/msal.js b/dist/msal.js
index 08b507d162..7da5ee9371 100644
--- a/dist/msal.js
+++ b/dist/msal.js
@@ -1,4 +1,4 @@
-/*! msal v0.1.3 2018-02-22 */
+/*! msal v0.1.5 2018-02-27 */
'use strict';
(function webpackUniversalModuleDefinition(root, factory) {
@@ -314,7 +314,7 @@ var Utils = /** @class */ (function () {
return hex;
};
Utils.getLibraryVersion = function () {
- return "0.1.3";
+ return "0.1.5";
};
/*
* Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d
diff --git a/dist/msal.js.map b/dist/msal.js.map
index d0674f2963..abcd0b7988 100644
--- a/dist/msal.js.map
+++ b/dist/msal.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 8eb1e34f7cca078cb254","webpack:///./src/Utils.ts","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./src/Logger.ts","webpack:///./src/Authority.ts","webpack:///./src/ErrorMessage.ts","webpack:///./src/Constants.ts","webpack:///./src/User.ts","webpack:///./src/AadAuthority.ts","webpack:///./src/XHRClient.ts","webpack:///./src/index.ts","webpack:///./src/UserAgentApplication.ts","webpack:///./src/AccessTokenKey.ts","webpack:///./src/AccessTokenValue.ts","webpack:///./src/AuthenticationRequestParameters.ts","webpack:///./src/ClientInfo.ts","webpack:///./src/IdToken.ts","webpack:///./src/Storage.ts","webpack:///./src/AccessTokenCacheItem.ts","webpack:///./src/RequestInfo.ts","webpack:///./src/AuthorityFactory.ts","webpack:///./src/B2cAuthority.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;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C,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;YAC9B,MAAM,CAAC,aAAa,CAAC;QACvB,CAAC;QAED,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,+BAA+B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACnF,MAAM,CAAC,aAAa,CAAC;QACvB,CAAC;QAED,MAAM,CAAC,IAAI,OAAO,CAAS,UAAC,OAAO,EAAE,MAAM;YACzC,aAAM,CAAC,2BAAY,CAAC,8BAA8B,CAAC;QAAnD,CAAmD,CAAC,CAAC;IACzD,CAAC;IACH,mBAAC;AAAD,CAAC,CAnCiC,2BAAY,GAmC7C;AAnCY,oCAAY","file":"msal.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Msal\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Msal\"] = factory();\n\telse\n\t\troot[\"Msal\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8eb1e34f7cca078cb254","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { IUri } from \"./IUri\";\r\nimport { User } from \"./User\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Utils {\r\n static compareObjects(u1: User, u2: User): boolean {\r\n if (!u1 || !u2) {\r\n return false;\r\n }\r\n if (u1.userIdentifier && u2.userIdentifier) {\r\n if (u1.userIdentifier === u2.userIdentifier) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static expiresIn(expires: string): number {\r\n // if AAD did not send \"expires_in\" property, use default expiration of 3599 seconds, for some reason AAD sends 3599 as \"expires_in\" value instead of 3600\r\n if (!expires) {\r\n expires = \"3599\";\r\n }\r\n return this.now() + parseInt(expires, 10);\r\n }\r\n\r\n static now(): number {\r\n return Math.round(new Date().getTime() / 1000.0);\r\n }\r\n\r\n static isEmpty(str: string): boolean {\r\n return (typeof str === \"undefined\" || !str || 0 === str.length);\r\n }\r\n\r\n static extractIdToken(encodedIdToken: string): any {\r\n // id token will be decoded to get the username\r\n const decodedToken = this.decodeJwt(encodedIdToken);\r\n if (!decodedToken) {\r\n return null;\r\n }\r\n try {\r\n const base64IdToken = decodedToken.JWSPayload;\r\n const base64Decoded = this.base64DecodeStringUrlSafe(base64IdToken);\r\n if (!base64Decoded) {\r\n //this._requestContext.logger.info(\"The returned id_token could not be base64 url safe decoded.\");\r\n return null;\r\n }\r\n // ECMA script has JSON built-in support\r\n return JSON.parse(base64Decoded);\r\n } catch (err) {\r\n //this._requestContext.logger.error(\"The returned id_token could not be decoded\" + err);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n static base64EncodeStringUrlSafe(input: string): string {\r\n // html5 should support atob function for decoding\r\n if (window.btoa) {\r\n return window.btoa(input);\r\n }\r\n else {\r\n return this.encode(input);\r\n }\r\n }\r\n\r\n static base64DecodeStringUrlSafe(base64IdToken: string): string {\r\n // html5 should support atob function for decoding\r\n base64IdToken = base64IdToken.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n if (window.atob) {\r\n return decodeURIComponent(window.atob(base64IdToken)); // jshint ignore:line\r\n }\r\n else {\r\n return decodeURIComponent(this.decode(base64IdToken));\r\n }\r\n }\r\n\r\n static encode(input: string): string {\r\n const keyStr: string = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n let output = \"\";\r\n let chr1: number, chr2: number, chr3: number, enc1: number, enc2: number, enc3: number, enc4: number;\r\n var i = 0;\r\n\r\n input = this.utf8Encode(input);\r\n\r\n while (i < input.length) {\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n } else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n\r\n output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);\r\n }\r\n\r\n return output.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\r\n }\r\n\r\n static utf8Encode(input: string): string {\r\n input = input.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < input.length; n++) {\r\n var c = input.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n }\r\n\r\n return utftext;\r\n }\r\n\r\n static decode(base64IdToken: string): string {\r\n var codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n base64IdToken = String(base64IdToken).replace(/=+$/, \"\");\r\n var length = base64IdToken.length;\r\n if (length % 4 === 1) {\r\n throw new Error(\"The token to be decoded is not correctly encoded.\");\r\n }\r\n let h1: number, h2: number, h3: number, h4: number, bits: number, c1: number, c2: number, c3: number, decoded = \"\";\r\n for (var i = 0; i < length; i += 4) {\r\n //Every 4 base64 encoded character will be converted to 3 byte string, which is 24 bits\r\n // then 6 bits per base64 encoded character\r\n h1 = codes.indexOf(base64IdToken.charAt(i));\r\n h2 = codes.indexOf(base64IdToken.charAt(i + 1));\r\n h3 = codes.indexOf(base64IdToken.charAt(i + 2));\r\n h4 = codes.indexOf(base64IdToken.charAt(i + 3));\r\n // For padding, if last two are \"=\"\r\n if (i + 2 === length - 1) {\r\n bits = h1 << 18 | h2 << 12 | h3 << 6;\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n decoded += String.fromCharCode(c1, c2);\r\n break;\r\n }\r\n // if last one is \"=\"\r\n else if (i + 1 === length - 1) {\r\n bits = h1 << 18 | h2 << 12;\r\n c1 = bits >> 16 & 255;\r\n decoded += String.fromCharCode(c1);\r\n break;\r\n }\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n // then convert to 3 byte chars\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n c3 = bits & 255;\r\n decoded += String.fromCharCode(c1, c2, c3);\r\n }\r\n return decoded;\r\n }\r\n\r\n static decodeJwt(jwtToken: string): any {\r\n if (this.isEmpty(jwtToken)) {\r\n return null;\r\n }\r\n const idTokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n const matches = idTokenPartsRegex.exec(jwtToken);\r\n if (!matches || matches.length < 4) {\r\n //this._requestContext.logger.warn(\"The returned id_token is not parseable.\");\r\n return null;\r\n }\r\n const crackedToken = {\r\n header: matches[1],\r\n JWSPayload: matches[2],\r\n JWSSig: matches[3]\r\n };\r\n return crackedToken;\r\n }\r\n\r\n static deserialize(query: string): any {\r\n let match: Array; // Regex for replacing addition symbol with a space\r\n const pl = /\\+/g;\r\n const search = /([^&=]+)=([^&]*)/g;\r\n const decode = (s: string) => decodeURIComponent(s.replace(pl, \" \"));\r\n const obj: {} = {};\r\n match = search.exec(query);\r\n while (match) {\r\n obj[decode(match[1])] = decode(match[2]);\r\n match = search.exec(query);\r\n }\r\n return obj;\r\n }\r\n\r\n static isIntersectingScopes(cachedScopes: Array, scopes: Array): boolean {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n for (let i = 0; i < scopes.length; i++) {\r\n if (cachedScopes.indexOf(scopes[i].toLowerCase()) > -1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static containsScope(cachedScopes: Array, scopes: Array): boolean {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n return scopes.every((value: any): boolean => cachedScopes.indexOf(value.toString().toLowerCase()) >= 0);\r\n }\r\n\r\n static convertToLowerCase(scopes: Array): Array {\r\n return scopes.map(scope => scope.toLowerCase());\r\n }\r\n\r\n static removeElement(scopes: Array, scope: string): Array {\r\n return scopes.filter(value => value !== scope);\r\n }\r\n\r\n static decimalToHex(num: number): string {\r\n var hex: string = num.toString(16);\r\n while (hex.length < 2) {\r\n hex = \"0\" + hex;\r\n }\r\n return hex;\r\n }\r\n\r\n static getLibraryVersion(): string {\r\n return \"0.1.3\";\r\n }\r\n\r\n /*\r\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\r\n * @param href The url\r\n * @param tenantId The tenant id to replace\r\n */\r\n static replaceFirstPath(href: string, tenantId: string): string {\r\n var match = href.match(/^(https?\\:)\\/\\/(([^:\\/?#] *)(?:\\:([0-9]+))?)([\\/]{0,1}[^?#] *)(\\?[^#] *|)(#. *|)$/);\r\n if (match) {\r\n var urlObject = Utils.GetUrlComponents(href);\r\n var pathArray = urlObject.PathSegments;\r\n pathArray.shift();\r\n if (pathArray[0] && pathArray[0] === \"common\" || pathArray[0] === \"organizations\") {\r\n pathArray[0] = tenantId;\r\n href = urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + pathArray.join(\"/\");\r\n }\r\n }\r\n return href;\r\n }\r\n\r\n static createNewGuid(): string {\r\n // RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or\r\n // pseudo-random numbers.\r\n // The algorithm is as follows:\r\n // Set the two most significant bits (bits 6 and 7) of the\r\n // clock_seq_hi_and_reserved to zero and one, respectively.\r\n // Set the four most significant bits (bits 12 through 15) of the\r\n // time_hi_and_version field to the 4-bit version number from\r\n // Section 4.1.3. Version4\r\n // Set all the other bits to randomly (or pseudo-randomly) chosen\r\n // values.\r\n // UUID = time-low \"-\" time-mid \"-\"time-high-and-version \"-\"clock-seq-reserved and low(2hexOctet)\"-\" node\r\n // time-low = 4hexOctet\r\n // time-mid = 2hexOctet\r\n // time-high-and-version = 2hexOctet\r\n // clock-seq-and-reserved = hexOctet:\r\n // clock-seq-low = hexOctet\r\n // node = 6hexOctet\r\n // Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\r\n // y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10\r\n // y values are 8, 9, A, B\r\n\r\n const cryptoObj: Crypto = window.crypto; // for IE 11\r\n if (cryptoObj && cryptoObj.getRandomValues) {\r\n const buffer: Uint8Array = new Uint8Array(16);\r\n cryptoObj.getRandomValues(buffer);\r\n\r\n //buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).\r\n buffer[6] |= 0x40; //buffer[6] | 01000000 will set the 6 bit to 1.\r\n buffer[6] &= 0x4f; //buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = \"4\".\r\n\r\n //buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.\r\n buffer[8] |= 0x80; //buffer[8] | 10000000 will set the 7 bit to 1.\r\n buffer[8] &= 0xbf; //buffer[8] & 10111111 will set the 6 bit to 0.\r\n\r\n return Utils.decimalToHex(buffer[0]) + Utils.decimalToHex(buffer[1])\r\n + Utils.decimalToHex(buffer[2]) + Utils.decimalToHex(buffer[3])\r\n + \"-\" + Utils.decimalToHex(buffer[4]) + Utils.decimalToHex(buffer[5])\r\n + \"-\" + Utils.decimalToHex(buffer[6]) + Utils.decimalToHex(buffer[7])\r\n + \"-\" + Utils.decimalToHex(buffer[8]) + Utils.decimalToHex(buffer[9])\r\n + \"-\" + Utils.decimalToHex(buffer[10]) + Utils.decimalToHex(buffer[11])\r\n + Utils.decimalToHex(buffer[12]) + Utils.decimalToHex(buffer[13])\r\n + Utils.decimalToHex(buffer[14]) + Utils.decimalToHex(buffer[15]);\r\n }\r\n else {\r\n const guidHolder: string = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\";\r\n const hex: string = \"0123456789abcdef\";\r\n let r: number = 0;\r\n let guidResponse: string = \"\";\r\n for (let i: number = 0; i < 36; i++) {\r\n if (guidHolder[i] !== \"-\" && guidHolder[i] !== \"4\") {\r\n // each x and y needs to be random\r\n r = Math.random() * 16 | 0;\r\n }\r\n if (guidHolder[i] === \"x\") {\r\n guidResponse += hex[r];\r\n } else if (guidHolder[i] === \"y\") {\r\n // clock-seq-and-reserved first hex is filtered and remaining hex values are random\r\n r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??\r\n r |= 0x8; // set pos 3 to 1 as 1???\r\n guidResponse += hex[r];\r\n } else {\r\n guidResponse += guidHolder[i];\r\n }\r\n }\r\n return guidResponse;\r\n }\r\n }\r\n\r\n /*\r\n * Parses out the components from a url string.\r\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\r\n */\r\n static GetUrlComponents(url: string): IUri {\r\n if (!url) {\r\n throw \"Url required\";\r\n }\r\n\r\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\r\n var regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n\r\n var match = url.match(regEx);\r\n\r\n if (!match || match.length < 6) {\r\n throw \"Valid url required\";\r\n }\r\n\r\n let urlComponents = {\r\n Protocol: match[1],\r\n HostNameAndPort: match[4],\r\n AbsolutePath: match[5]\r\n };\r\n\r\n let pathSegments = urlComponents.AbsolutePath.split(\"/\");\r\n pathSegments = pathSegments.filter((val) => val && val.length > 0); // remove empty elements\r\n urlComponents.PathSegments = pathSegments;\r\n return urlComponents;\r\n }\r\n\r\n /*\r\n * Given a url or path, append a trailing slash if one doesnt exist\r\n */\r\n static CanonicalizeUri(url: string): string {\r\n if (url) {\r\n url = url.toLowerCase();\r\n }\r\n\r\n if (url && !Utils.endsWith(url, \"/\")) {\r\n url += \"/\";\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /*\r\n * Checks to see if the url ends with the suffix\r\n * Required because we are compiling for es5 instead of es6\r\n * @param url\r\n * @param str\r\n */\r\n static endsWith(url: string, suffix: string): boolean {\r\n if (!url || !suffix) {\r\n return false;\r\n }\r\n\r\n return url.indexOf(suffix, url.length - suffix.length) !== -1;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Utils.ts","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/tslib/tslib.es6.js\n// module id = 1\n// module chunks = 0 1","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\nexport interface ILoggerCallback {\r\n (level: LogLevel, message: string, containsPii: boolean): void;\r\n}\r\n\r\nexport enum LogLevel {\r\n Error,\r\n Warning,\r\n Info,\r\n Verbose\r\n}\r\n\r\nexport class Logger {// Singleton Class\r\n\r\n /*\r\n * @hidden\r\n */\r\n private static _instance: Logger;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _correlationId: string;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _level: LogLevel = LogLevel.Info;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _piiLoggingEnabled: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _localCallback: ILoggerCallback;\r\n\r\n constructor(localCallback: ILoggerCallback,\r\n options:\r\n {\r\n correlationId?: string,\r\n level?: LogLevel,\r\n piiLoggingEnabled?: boolean,\r\n } = {}) {\r\n const {\r\n correlationId = \"\",\r\n level = LogLevel.Info,\r\n piiLoggingEnabled = false\r\n } = options;\r\n\r\n this._localCallback = localCallback;\r\n this._correlationId = correlationId;\r\n this._level = level;\r\n this._piiLoggingEnabled = piiLoggingEnabled;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n private logMessage(logLevel: LogLevel, logMessage: string, containsPii: boolean): void {\r\n if ((logLevel > this._level) || (!this._piiLoggingEnabled && containsPii)) {\r\n return;\r\n }\r\n var timestamp = new Date().toUTCString();\r\n var log: string;\r\n if (!Utils.isEmpty(this._correlationId)) {\r\n log = timestamp + \":\" + this._correlationId + \"-\" + Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n else {\r\n log = timestamp + \":\" + Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n this.executeCallback(logLevel, log, containsPii);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n executeCallback(level: LogLevel, message: string, containsPii: boolean) {\r\n if (this._localCallback) {\r\n this._localCallback(level, message, containsPii);\r\n }\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n error(message: string): void {\r\n this.logMessage(LogLevel.Error, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n errorPii(message: string): void {\r\n this.logMessage(LogLevel.Error, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n warning(message: string): void {\r\n this.logMessage(LogLevel.Warning, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n warningPii(message: string): void {\r\n this.logMessage(LogLevel.Warning, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n info(message: string): void {\r\n this.logMessage(LogLevel.Info, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n infoPii(message: string): void {\r\n this.logMessage(LogLevel.Info, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n verbose(message: string): void {\r\n this.logMessage(LogLevel.Verbose, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n verbosePii(message: string): void {\r\n this.logMessage(LogLevel.Verbose, message, true);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Logger.ts","import { IUri } from \"./IUri\";\r\nimport { Utils } from \"./Utils\";\r\nimport { ITenantDiscoveryResponse } from \"./ITenantDiscoveryResponse\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\nimport { XhrClient } from \"./XHRClient\";\r\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport enum AuthorityType {\r\n Aad,\r\n Adfs,\r\n B2C\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport abstract class Authority {\r\n constructor(authority: string, validateAuthority: boolean) {\r\n this.IsValidationEnabled = validateAuthority;\r\n this.CanonicalAuthority = authority;\r\n\r\n this.validateAsUri();\r\n }\r\n\r\n public abstract get AuthorityType(): AuthorityType;\r\n\r\n public IsValidationEnabled: boolean;\r\n\r\n public get Tenant(): string {\r\n return this.CanonicalAuthorityUrlComponents.PathSegments[0];\r\n }\r\n\r\n private tenantDiscoveryResponse: ITenantDiscoveryResponse;\r\n\r\n public get AuthorizationEndpoint(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n public get EndSessionEndpoint(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.EndSessionEndpoint.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n public get SelfSignedJwtAudience(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.Issuer.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n private validateResolved() {\r\n if (!this.tenantDiscoveryResponse) {\r\n throw \"Please call ResolveEndpointsAsync first\";\r\n }\r\n }\r\n\r\n /*\r\n * A URL that is the authority set by the developer\r\n */\r\n public get CanonicalAuthority(): string {\r\n return this.canonicalAuthority;\r\n }\r\n\r\n public set CanonicalAuthority(url: string) {\r\n this.canonicalAuthority = Utils.CanonicalizeUri(url);\r\n this.canonicalAuthorityUrlComponents = null;\r\n }\r\n\r\n private canonicalAuthority: string;\r\n private canonicalAuthorityUrlComponents: IUri;\r\n\r\n public get CanonicalAuthorityUrlComponents(): IUri {\r\n if (!this.canonicalAuthorityUrlComponents) {\r\n this.canonicalAuthorityUrlComponents = Utils.GetUrlComponents(this.CanonicalAuthority);\r\n }\r\n\r\n return this.canonicalAuthorityUrlComponents;\r\n }\r\n\r\n /*\r\n * // http://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\r\n */\r\n protected get DefaultOpenIdConfigurationEndpoint(): string {\r\n return `${this.CanonicalAuthority}v2.0/.well-known/openid-configuration`;\r\n }\r\n\r\n /*\r\n * Given a string, validate that it is of the form https://domain/path\r\n */\r\n private validateAsUri() {\r\n let components;\r\n try {\r\n components = this.CanonicalAuthorityUrlComponents;\r\n } catch (e) {\r\n throw ErrorMessage.invalidAuthorityType;\r\n }\r\n\r\n if (!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\r\n throw ErrorMessage.authorityUriInsecure;\r\n }\r\n\r\n if (!components.PathSegments || components.PathSegments.length < 1) {\r\n throw ErrorMessage.authorityUriInvalidPath;\r\n }\r\n }\r\n\r\n /*\r\n * Calls the OIDC endpoint and returns the response\r\n */\r\n private DiscoverEndpoints(openIdConfigurationEndpoint: string): Promise {\r\n let client = new XhrClient();\r\n return client.sendRequestAsync(openIdConfigurationEndpoint, \"GET\", /*enableCaching: */ true)\r\n .then((response: any) => {\r\n return {\r\n AuthorizationEndpoint: response.authorization_endpoint,\r\n EndSessionEndpoint: response.end_session_endpoint,\r\n Issuer: response.issuer\r\n };\r\n });\r\n }\r\n\r\n /*\r\n * Returns a promise.\r\n * Checks to see if the authority is in the cache\r\n * Discover endpoints via openid-configuration\r\n * If successful, caches the endpoint for later use in OIDC\r\n */\r\n public ResolveEndpointsAsync(): Promise {\r\n let openIdConfigurationEndpoint = \"\";\r\n return this.GetOpenIdConfigurationEndpointAsync().then(openIdConfigurationEndpointResponse => {\r\n openIdConfigurationEndpoint = openIdConfigurationEndpointResponse;\r\n return this.DiscoverEndpoints(openIdConfigurationEndpoint);\r\n }).then((tenantDiscoveryResponse: ITenantDiscoveryResponse) => {\r\n this.tenantDiscoveryResponse = tenantDiscoveryResponse;\r\n return this;\r\n });\r\n }\r\n\r\n /*\r\n * Returns a promise with the TenantDiscoveryEndpoint\r\n */\r\n public abstract GetOpenIdConfigurationEndpointAsync(): Promise;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Authority.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorMessage {\r\n static get authorityUriInvalidPath(): string { return \"AuthorityUriInvalidPath\"; }\r\n static get authorityUriInsecure(): string { return \"AuthorityUriInsecure\"; }\r\n static get invalidAuthorityType(): string { return \"InvalidAuthorityType\"; }\r\n static get unsupportedAuthorityValidation(): string { return \"UnsupportedAuthorityValidation\"; }\r\n static get b2cAuthorityUriInvalidPath(): string { return \"B2cAuthorityUriInvalidPath\"; }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/ErrorMessage.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Constants {\r\n static get errorDescription(): string { return \"error_description\"; }\r\n static get error(): string { return \"error\"; }\r\n static get scope(): string { return \"scope\"; }\r\n static get acquireTokenUser(): string { return \"msal_acquireTokenUser\"; }\r\n static get clientInfo(): string { return \"client_info\"; }\r\n static get clientId(): string { return \"clientId\"; }\r\n static get authority(): string { return \"authority\"; }\r\n static get idToken(): string { return \"id_token\"; }\r\n static get accessToken(): string { return \"access_token\"; }\r\n static get expiresIn(): string { return \"expires_in\"; }\r\n static get sessionState(): string { return \"session_state\"; }\r\n static get msalClientInfo(): string { return \"msal.client.info\"; }\r\n static get msalError(): string { return \"msal.error\"; }\r\n static get msalErrorDescription(): string { return \"msal.error.description\"; }\r\n static get msalSessionState(): string { return \"msal.session.state\"; }\r\n static get tokenKeys(): string { return \"msal.token.keys\"; }\r\n static get accessTokenKey(): string { return \"msal.access.token.key\"; }\r\n static get expirationKey(): string { return \"msal.expiration.key\"; }\r\n static get stateLogin(): string { return \"msal.state.login\"; }\r\n static get stateAcquireToken(): string { return \"msal.state.acquireToken\"; }\r\n static get stateRenew(): string { return \"msal.state.renew\"; }\r\n static get nonceIdToken(): string { return \"msal.nonce.idtoken\"; }\r\n static get userName(): string { return \"msal.username\"; }\r\n static get idTokenKey(): string { return \"msal.idtoken\"; }\r\n static get loginRequest(): string { return \"msal.login.request\"; }\r\n static get loginError(): string { return \"msal.login.error\"; }\r\n static get renewStatus(): string { return \"msal.token.renew.status\"; }\r\n static get msal(): string { return \"msal\"; }\r\n static get resourceDelimeter(): string { return \"|\"; }\r\n static get tokenRenewStatusCancelled(): string { return \"Canceled\"; }\r\n static get tokenRenewStatusCompleted(): string { return \"Completed\"; }\r\n static get tokenRenewStatusInProgress(): string { return \"In Progress\"; }\r\n private static _popUpWidth: number = 483;\r\n static get popUpWidth(): number { return this._popUpWidth; }\r\n static set popUpWidth(width: number) {\r\n this._popUpWidth = width;\r\n }\r\n private static _popUpHeight: number = 600;\r\n static get popUpHeight(): number { return this._popUpHeight; }\r\n static set popUpHeight(height: number) {\r\n this._popUpHeight = height;\r\n }\r\n static get login(): string { return \"LOGIN\"; }\r\n static get renewToken(): string { return \"renewToken\"; }\r\n static get unknown(): string { return \"UNKNOWN\"; }\r\n static get urlHash(): string { return \"msal.urlHash\"; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorCodes {\r\n static get loginProgressError(): string { return \"login_progress_error\"; }\r\n static get acquireTokenProgressError(): string { return \"acquiretoken_progress_error\"; }\r\n static get inputScopesError(): string { return \"input_scopes_error\"; }\r\n static get endpointResolutionError(): string { return \"endpoints_resolution_error\"; }\r\n static get popUpWindowError(): string { return \"popup_window_error\"; }\r\n static get userLoginError(): string { return \"user_login_error\"; }\r\n static get userCancelledError(): string { return \"user_cancelled\"; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorDescription {\r\n static get loginProgressError(): string { return \"Login is in progress\"; }\r\n static get acquireTokenProgressError(): string { return \"Acquire token is in progress\"; }\r\n static get inputScopesError(): string { return \"Invalid value of input scopes provided\"; }\r\n static get endpointResolutionError(): string { return \"Endpoints cannot be resolved\"; }\r\n static get popUpWindowError(): string { return \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"; }\r\n static get userLoginError(): string { return \"User login is required\"; }\r\n static get userCancelledError(): string { return \"User closed the popup window window and cancelled the flow\"; }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Constants.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { Utils } from \"./Utils\";\r\n\r\nexport class User {\r\n\r\n displayableId: string;\r\n name: string;\r\n identityProvider: string;\r\n userIdentifier: string;\r\n idToken: Object\r\n\r\n /*\r\n * @hidden\r\n */\r\n constructor(displayableId: string, name: string, identityProvider: string, userIdentifier: string, idToken:Object) {\r\n this.displayableId = displayableId;\r\n this.name = name;\r\n this.identityProvider = identityProvider;\r\n this.userIdentifier = userIdentifier;\r\n this.idToken = idToken;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n static createUser(idToken: IdToken, clientInfo: ClientInfo, authority: string): User {\r\n let uid: string;\r\n let utid: string;\r\n if (!clientInfo) {\r\n uid = \"\";\r\n utid = \"\";\r\n }\r\n else {\r\n uid = clientInfo.uid;\r\n utid = clientInfo.utid;\r\n }\r\n\r\n const userIdentifier = Utils.base64EncodeStringUrlSafe(uid) + \".\" + Utils.base64EncodeStringUrlSafe(utid);\r\n return new User(idToken.preferredName, idToken.name, idToken.issuer, userIdentifier, idToken.decodedIdToken);\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/User.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Authority, AuthorityType } from \"./Authority\";\r\nimport { XhrClient } from \"./XHRClient\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class AadAuthority extends Authority {\r\n private static readonly AadInstanceDiscoveryEndpoint: string = \"https://login.microsoftonline.com/common/discovery/instance\";\r\n\r\n private get AadInstanceDiscoveryEndpointUrl(): string {\r\n return `${AadAuthority.AadInstanceDiscoveryEndpoint}?api-version=1.0&authorization_endpoint=${this.CanonicalAuthority}oauth2/v2.0/authorize`;\r\n }\r\n\r\n public constructor(authority: string, validateAuthority: boolean) {\r\n super(authority, validateAuthority);\r\n }\r\n\r\n public get AuthorityType(): AuthorityType {\r\n return AuthorityType.Aad;\r\n }\r\n\r\n private static readonly TrustedHostList: any = {\r\n \"login.windows.net\": \"login.windows.net\",\r\n \"login.chinacloudapi.cn\": \"login.chinacloudapi.cn\",\r\n \"login.cloudgovapi.us\": \"login.cloudgovapi.us\",\r\n \"login.microsoftonline.com\": \"login.microsoftonline.com\",\r\n \"login.microsoftonline.de\": \"login.microsoftonline.de\",\r\n \"login.microsoftonline.us\": \"login.microsoftonline.us\"\r\n };\r\n\r\n /**\r\n * Returns a promise which resolves to the OIDC endpoint\r\n * Only responds with the endpoint\r\n */\r\n public GetOpenIdConfigurationEndpointAsync(): Promise {\r\n var resultPromise: Promise = new Promise((resolve, reject) =>\r\n resolve(this.DefaultOpenIdConfigurationEndpoint));\r\n\r\n if (!this.IsValidationEnabled) {\r\n return resultPromise;\r\n }\r\n\r\n let host: string = this.CanonicalAuthorityUrlComponents.HostNameAndPort;\r\n if (this.IsInTrustedHostList(host)) {\r\n return resultPromise;\r\n }\r\n\r\n let client: XhrClient = new XhrClient();\r\n\r\n return client.sendRequestAsync(this.AadInstanceDiscoveryEndpointUrl, \"GET\", true)\r\n .then((response) => {\r\n return response.tenant_discovery_endpoint;\r\n });\r\n }\r\n\r\n /**\r\n * Checks to see if the host is in a list of trusted hosts\r\n * @param {string} The host to look up\r\n */\r\n public IsInTrustedHostList(host: string): boolean {\r\n return AadAuthority.TrustedHostList[host.toLowerCase()];\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AadAuthority.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * XHR client for JSON endpoints\r\n * https://www.npmjs.com/package/async-promise\r\n * @hidden\r\n */\r\nexport class XhrClient {\r\n public sendRequestAsync(url: string, method: string, enableCaching?: boolean): Promise {\r\n return new Promise((resolve, reject) => {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url, /*async: */ true);\r\n if (enableCaching) {\r\n // TODO: (shivb) ensure that this can be cached\r\n // xhr.setRequestHeader(\"Cache-Control\", \"Public\");\r\n }\r\n\r\n xhr.onload = (ev) => {\r\n if (xhr.status < 200 || xhr.status >= 300) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n\r\n try {\r\n var jsonResponse = JSON.parse(xhr.responseText);\r\n } catch (e) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n\r\n resolve(jsonResponse);\r\n };\r\n\r\n xhr.onerror = (ev) => {\r\n reject(xhr.status);\r\n };\r\n\r\n if (method === \"GET\") {\r\n xhr.send();\r\n }\r\n else {\r\n throw \"not implemented\";\r\n }\r\n });\r\n }\r\n\r\n protected handleError(responseText: string): any {\r\n var jsonResponse;\r\n try {\r\n jsonResponse = JSON.parse(responseText);\r\n if (jsonResponse.error) {\r\n return jsonResponse.error;\r\n } else {\r\n throw responseText;\r\n }\r\n } catch (e) {\r\n return responseText;\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/XHRClient.ts","export { UserAgentApplication } from \"./UserAgentApplication\";\r\nexport { Logger } from \"./Logger\";\r\nexport { LogLevel } from \"./Logger\";\r\nexport { User } from \"./User\";\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { AccessTokenCacheItem } from \"./AccessTokenCacheItem\";\r\nimport { AccessTokenKey } from \"./AccessTokenKey\";\r\nimport { AccessTokenValue } from \"./AccessTokenValue\";\r\nimport { AuthenticationRequestParameters } from \"./AuthenticationRequestParameters\";\r\nimport { Authority } from \"./Authority\";\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { Constants, ErrorCodes, ErrorDescription } from \"./Constants\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { Logger } from \"./Logger\";\r\nimport { Storage } from \"./Storage\";\r\nimport { TokenResponse } from \"./RequestInfo\";\r\nimport { User } from \"./User\";\r\nimport { Utils } from \"./Utils\";\r\nimport { AuthorityFactory } from \"./AuthorityFactory\";\r\n\r\ndeclare global {\r\n interface Window {\r\n msal: Object;\r\n callBackMappedToRenewStates: Object;\r\n callBacksMappedToRenewStates: Object; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nlet ResponseTypes = {\r\n id_token: \"id_token\",\r\n token: \"token\",\r\n id_token_token: \"id_token token\"\r\n};\r\n\r\n/*\r\n * @hidden\r\n */\r\ninterface CacheResult {\r\n errorDesc: string;\r\n token: string;\r\n error: string;\r\n}\r\n\r\n/*\r\n * A type alias of for a tokenReceivedCallback function.\r\n * @param tokenReceivedCallback.errorDesc error description returned from the STS if API call fails.\r\n * @param tokenReceivedCallback.token token returned from STS if token request is successful.\r\n * @param tokenReceivedCallback.error error code returned from the STS if API call fails.\r\n * @param tokenReceivedCallback.tokenType tokenType returned from the STS if API call is successful. Possible values are: id_token OR access_token.\r\n */\r\nexport type tokenReceivedCallback = (errorDesc: string, token: string, error: string, tokenType: string) => void;\r\nconst resolveTokenOnlyIfOutOfIframe = (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n const tokenAcquisitionMethod = descriptor.value;\r\n descriptor.value = function (...args: any[]) {\r\n return this.isInIframe()\r\n ? new Promise(() => { })\r\n : tokenAcquisitionMethod.apply(this, args);\r\n };\r\n return descriptor;\r\n};\r\nexport class UserAgentApplication {\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheLocations = {\r\n localStorage: \"localStorage\",\r\n sessionStorage: \"sessionStorage\"\r\n };\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheLocation: string;\r\n\r\n /*\r\n * Used to get the cache location\r\n */\r\n get cacheLocation(): string {\r\n return this._cacheLocation;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _logger: Logger;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _loginInProgress: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _acquireTokenInProgress: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _renewStates: Array;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _activeRenewals: Object;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _clockSkew = 300;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheStorage: Storage;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _tokenReceivedCallback: tokenReceivedCallback = null;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _user: User;\r\n\r\n /*\r\n * Client ID assigned to your app by Azure Active Directory.\r\n */\r\n clientId: string;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private authorityInstance: Authority;\r\n\r\n /*\r\n * Used to set the authority.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n */\r\n public set authority(val) {\r\n this.authorityInstance = AuthorityFactory.CreateInstance(val, this.validateAuthority);\r\n }\r\n\r\n /*\r\n * Used to get the authority.\r\n */\r\n public get authority(): string {\r\n return this.authorityInstance.CanonicalAuthority;\r\n }\r\n\r\n /*\r\n * Used to turn authority validation on/off.\r\n * When set to true (default), MSAL will compare the application\"s authority against well-known URLs templates representing well-formed authorities. It is useful when the authority is obtained at run time to prevent MSAL from displaying authentication prompts from malicious pages.\r\n */\r\n validateAuthority: boolean;\r\n\r\n /*\r\n * The redirect URI of the application, this should be same as the value in the application registration portal.\r\n * Defaults to `window.location.href`.\r\n */\r\n private _redirectUri: string;\r\n\r\n /*\r\n * Used to redirect the user to this location after logout.\r\n * Defaults to `window.location.href`.\r\n */\r\n private _postLogoutredirectUri: string;\r\n\r\n /*\r\n * Used to keep track of opened popup windows.\r\n */\r\n private _openedWindows: Array;\r\n\r\n /*\r\n * Used to track the authentication request.\r\n */\r\n private _requestType: string;\r\n\r\n loadFrameTimeout: number;\r\n\r\n private _navigateToLoginRequestUrl: boolean;\r\n\r\n /*\r\n * Initialize a UserAgentApplication with a given clientId and authority.\r\n * @constructor\r\n * @param {string} clientId - The clientID of your application, you should get this from the application registration portal.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<instance>/<tenant>,\\ where <instance> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenantId>/<policyName>/\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param _tokenReceivedCallback - The function that will get the call back once this API is completed (either successfully or with a failure).\r\n * @param {boolean} validateAuthority - boolean to turn authority validation on/off.\r\n */\r\n constructor(\r\n clientId: string,\r\n authority: string | null,\r\n tokenReceivedCallback: tokenReceivedCallback,\r\n options:\r\n {\r\n validateAuthority?: boolean,\r\n cacheLocation?: string,\r\n redirectUri?: string,\r\n postLogoutRedirectUri?: string,\r\n logger?: Logger,\r\n loadFrameTimeout?: number,\r\n navigateToLoginRequestUrl?: boolean,\r\n } = {}) {\r\n const {\r\n validateAuthority = true,\r\n cacheLocation = \"sessionStorage\",\r\n redirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0],\r\n postLogoutRedirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0],\r\n logger = new Logger(null),\r\n loadFrameTimeout = 6000,\r\n navigateToLoginRequestUrl = true\r\n } = options;\r\n\r\n this.loadFrameTimeout = loadFrameTimeout;\r\n this.clientId = clientId;\r\n this.validateAuthority = validateAuthority;\r\n this.authority = authority || \"https://login.microsoftonline.com/common\";\r\n this._tokenReceivedCallback = tokenReceivedCallback;\r\n this._redirectUri = redirectUri;\r\n this._postLogoutredirectUri = postLogoutRedirectUri;\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n this._renewStates = [];\r\n this._activeRenewals = {};\r\n this._cacheLocation = cacheLocation;\r\n this._navigateToLoginRequestUrl = navigateToLoginRequestUrl;\r\n if (!this._cacheLocations[cacheLocation]) {\r\n throw new Error(\"Cache Location is not valid. Provided value:\" + this._cacheLocation + \".Possible values are: \" + this._cacheLocations.localStorage + \", \" + this._cacheLocations.sessionStorage);\r\n }\r\n\r\n this._cacheStorage = new Storage(this._cacheLocation); //cache keys msal\r\n this._logger = logger;\r\n this._openedWindows = [];\r\n window.msal = this;\r\n window.callBackMappedToRenewStates = {};\r\n window.callBacksMappedToRenewStates = {};\r\n var urlHash = window.location.hash;\r\n var isCallback = this.isCallback(urlHash);\r\n \r\n if (isCallback) {\r\n this.handleAuthenticationResponse.call(this, urlHash);\r\n }\r\n else {\r\n var pendingCallback = this._cacheStorage.getItem(Constants.urlHash);\r\n if (pendingCallback) {\r\n this.processCallBack(pendingCallback);\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * Used to call the constructor callback with the token/error\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n * @hidden\r\n */\r\n private processCallBack(hash: string): void {\r\n this._logger.info('Processing the callback from redirect response');\r\n const requestInfo = this.getRequestInfo(hash);\r\n this.saveTokenFromHash(requestInfo);\r\n const token = requestInfo.parameters[Constants.accessToken] || requestInfo.parameters[Constants.idToken];\r\n const errorDesc = requestInfo.parameters[Constants.errorDescription];\r\n const error = requestInfo.parameters[Constants.error];\r\n var tokenType: string;\r\n\r\n if (requestInfo.parameters[Constants.accessToken]) {\r\n tokenType = Constants.accessToken;\r\n }\r\n else {\r\n tokenType = Constants.idToken;\r\n }\r\n\r\n this._cacheStorage.removeItem(Constants.urlHash);\r\n\r\n try {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback.call(this, errorDesc, token, error, tokenType);\r\n }\r\n\r\n } catch (err) {\r\n this._logger.error(\"Error occurred in token received callback function: \" + err);\r\n }\r\n }\r\n\r\n \r\n /*\r\n * Initiate the login process by redirecting the user to the STS authorization endpoint.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the authentication server during the interactive authentication flow.\r\n */\r\n loginRedirect(scopes?: Array, extraQueryParameters?: string): void {\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n if (this._loginInProgress) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(\"Login is in progress\", null, null, Constants.idToken);\r\n return;\r\n }\r\n }\r\n\r\n if (scopes) {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(isValidScope, null, null, Constants.idToken);\r\n return;\r\n }\r\n }\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n this.authorityInstance.ResolveEndpointsAsync()\r\n .then(() => {\r\n const authenticationRequest = new AuthenticationRequestParameters(this.authorityInstance, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.loginRequest, window.location.href);\r\n this._cacheStorage.setItem(Constants.loginError, \"\");\r\n this._cacheStorage.setItem(Constants.stateLogin, authenticationRequest.state);\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, this.authority);\r\n }\r\n\r\n const urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n this._loginInProgress = true;\r\n this._requestType = Constants.login;\r\n this.promptUser(urlNavigate);\r\n });\r\n }\r\n\r\n /*\r\n * Initiate the login process by opening a popup window.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the interactive authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the token or error.\r\n */\r\n loginPopup(scopes: Array, extraQueryParameters?: string): Promise {\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n return new Promise((resolve, reject) => {\r\n if (this._loginInProgress) {\r\n reject(ErrorCodes.loginProgressError + \":\" + ErrorDescription.loginProgressError);\r\n return;\r\n }\r\n\r\n if (scopes) {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n reject(ErrorCodes.inputScopesError + \":\" + ErrorDescription.inputScopesError);\r\n return;\r\n }\r\n\r\n scopes = this.filterScopes(scopes);\r\n }\r\n else {\r\n scopes = [this.clientId];\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n var popUpWindow = this.openWindow(\"about:blank\", \"_blank\", 1, this, resolve, reject);\r\n if (!popUpWindow) {\r\n return;\r\n }\r\n\r\n this.authorityInstance.ResolveEndpointsAsync().then(() => {\r\n const authenticationRequest = new AuthenticationRequestParameters(this.authorityInstance, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.loginRequest, window.location.href);\r\n this._cacheStorage.setItem(Constants.loginError, \"\");\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, this.authority);\r\n }\r\n\r\n const urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._requestType = Constants.login;\r\n this._loginInProgress = true;\r\n if (popUpWindow) {\r\n this._logger.infoPii(\"Navigated Popup window to:\" + urlNavigate);\r\n popUpWindow.location.href = urlNavigate;\r\n }\r\n\r\n }, () => {\r\n this._logger.info(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.endpointResolutionError);\r\n if (reject) {\r\n reject(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n }\r\n\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n });\r\n });\r\n }\r\n\r\n /*\r\n * Used to redirect the browser to the STS authorization endpoint\r\n * @param {string} urlNavigate - URL of the authorization endpoint\r\n * @hidden\r\n */\r\n private promptUser(urlNavigate: string) {\r\n if (urlNavigate && !Utils.isEmpty(urlNavigate)) {\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n window.location.replace(urlNavigate);\r\n } else {\r\n this._logger.info(\"Navigate url is empty\");\r\n }\r\n }\r\n\r\n /*\r\n * Used to send the user to the redirect_uri after authentication is complete. The user\"s bearer token is attached to the URI fragment as an id_token/access_token field.\r\n * This function also closes the popup window after redirection.\r\n * @hidden\r\n * @ignore\r\n */\r\n private openWindow(urlNavigate: string, title: string, interval: number, instance: this, resolve?: Function, reject?: Function): Window {\r\n var popupWindow = this.openPopup(urlNavigate, title, Constants.popUpWidth, Constants.popUpHeight);\r\n if (popupWindow == null) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n this._logger.info(ErrorCodes.popUpWindowError + \":\" + ErrorDescription.popUpWindowError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.popUpWindowError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.popUpWindowError);\r\n if (reject) {\r\n reject(ErrorCodes.popUpWindowError + \":\" + ErrorDescription.popUpWindowError);\r\n }\r\n return null;\r\n }\r\n\r\n this._openedWindows.push(popupWindow);\r\n var pollTimer = window.setInterval(() => {\r\n if (popupWindow && popupWindow.closed && instance._loginInProgress) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n if (reject) {\r\n reject(ErrorCodes.userCancelledError + \":\" + ErrorDescription.userCancelledError);\r\n }\r\n window.clearInterval(pollTimer);\r\n }\r\n\r\n try {\r\n var popUpWindowLocation = popupWindow.location;\r\n if (popUpWindowLocation.href.indexOf(this._redirectUri) !== -1) {\r\n window.clearInterval(pollTimer);\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n this._logger.info(\"Closing popup window\");\r\n }\r\n } catch (e) {\r\n //Cross Domain url check error. Will be thrown until AAD redirects the user back to the app\"s root page with the token. No need to log or throw this error as it will create unnecessary traffic.\r\n }\r\n },\r\n interval);\r\n\r\n return popupWindow;\r\n }\r\n\r\n /*\r\n * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Defaults behaviour is to redirect the user to `window.location.href`.\r\n */\r\n logout(): void {\r\n this.clearCache();\r\n this._user = null;\r\n let logout = \"\";\r\n if (this._postLogoutredirectUri) {\r\n logout = \"post_logout_redirect_uri=\" + encodeURIComponent(this._postLogoutredirectUri);\r\n }\r\n\r\n const urlNavigate = this.authority + \"/oauth2/v2.0/logout?\" + logout;\r\n this.promptUser(urlNavigate);\r\n }\r\n\r\n /*\r\n * Used to configure the popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n private clearCache(): void {\r\n this._renewStates = [];\r\n const accessTokenItems = this._cacheStorage.getAllAccessTokens(Constants.clientId, Constants.authority);\r\n for (let i = 0; i < accessTokenItems.length; i++) {\r\n this._cacheStorage.removeItem(JSON.stringify(accessTokenItems[i].key));\r\n }\r\n\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.acquireTokenUser, Constants.renewStatus);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.authority + Constants.resourceDelimeter, Constants.renewStatus);\r\n this._cacheStorage.resetCacheItems();\r\n }\r\n\r\n /*\r\n * Configures popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n private openPopup(urlNavigate: string, title: string, popUpWidth: number, popUpHeight: number) {\r\n try {\r\n /*\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n const winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /*\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n const height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n const left = ((width / 2) - (popUpWidth / 2)) + winLeft;\r\n const top = ((height / 2) - (popUpHeight / 2)) + winTop;\r\n\r\n const popupWindow = window.open(urlNavigate, title, \"width=\" + popUpWidth + \", height=\" + popUpHeight + \", top=\" + top + \", left=\" + left);\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n\r\n return popupWindow;\r\n } catch (e) {\r\n this._logger.error(\"error opening popup \" + e.message);\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n return null;\r\n }\r\n }\r\n\r\n /*\r\n * Used to validate the scopes input parameter requested by the developer.\r\n * @param {Array} scopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @ignore\r\n * @hidden\r\n */\r\n private validateInputScope(scopes: Array): string {\r\n if (!scopes || scopes.length < 1) {\r\n return \"Scopes cannot be passed as an empty array\";\r\n }\r\n\r\n if (!Array.isArray(scopes)) {\r\n throw new Error(\"API does not accept non-array scopes\");\r\n }\r\n\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n if (scopes.length > 1) {\r\n return \"ClientId can only be provided as a single scope\";\r\n }\r\n }\r\n return \"\";\r\n }\r\n\r\n /*\r\n * Used to remove openid and profile from the list of scopes passed by the developer.These scopes are added by default\r\n * @hidden\r\n */\r\n private filterScopes(scopes: Array): Array {\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"openid\";\r\n });\r\n\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"profile\";\r\n });\r\n\r\n return scopes;\r\n }\r\n /*\r\n * Used to add the developer requested callback to the array of callbacks for the specified scopes. The updated array is stored on the window object\r\n * @param {string} scope - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} expectedState - Unique state identifier (guid).\r\n * @param {Function} resolve - The resolve function of the promise object.\r\n * @param {Function} reject - The reject function of the promise object.\r\n * @ignore\r\n * @hidden\r\n */\r\n private registerCallback(expectedState: string, scope: string, resolve: Function, reject: Function): void {\r\n this._activeRenewals[scope] = expectedState;\r\n if (!window.callBacksMappedToRenewStates[expectedState]) {\r\n window.callBacksMappedToRenewStates[expectedState] = [];\r\n }\r\n window.callBacksMappedToRenewStates[expectedState].push({ resolve: resolve, reject: reject });\r\n if (!window.callBackMappedToRenewStates[expectedState]) {\r\n window.callBackMappedToRenewStates[expectedState] =\r\n (errorDesc: string, token: string, error: string, tokenType: string) => {\r\n this._activeRenewals[scope] = null;\r\n for (let i = 0; i < window.callBacksMappedToRenewStates[expectedState].length; ++i) {\r\n try {\r\n if (errorDesc || error) {\r\n window.callBacksMappedToRenewStates[expectedState][i].reject(errorDesc + \": \" + error);\r\n }\r\n else if (token) {\r\n window.callBacksMappedToRenewStates[expectedState][i].resolve(token);\r\n }\r\n } catch (e) {\r\n this._logger.warning(e);\r\n }\r\n }\r\n window.callBacksMappedToRenewStates[expectedState] = null;\r\n window.callBackMappedToRenewStates[expectedState] = null;\r\n };\r\n }\r\n }\r\n\r\n /*\r\n * Used to get token for the specified set of scopes from the cache\r\n * @param {AuthenticationRequestParameters} authenticationRequest - Request sent to the STS to obtain an id_token/access_token\r\n * @param {User} user - User for which the scopes were requested\r\n * @hidden\r\n */\r\n private getCachedToken(authenticationRequest: AuthenticationRequestParameters, user: User): CacheResult {\r\n let accessTokenCacheItem: AccessTokenCacheItem = null;\r\n const scopes = authenticationRequest.scopes;\r\n const tokenCacheItems = this._cacheStorage.getAllAccessTokens(this.clientId, user.userIdentifier); //filter by clientId and user\r\n if (tokenCacheItems.length === 0) { // No match found after initial filtering\r\n return null;\r\n }\r\n\r\n const filteredItems: Array = [];\r\n //if no authority passed\r\n if (!authenticationRequest.authority) {\r\n //filter by scope\r\n for (let i = 0; i < tokenCacheItems.length; i++) {\r\n const cacheItem = tokenCacheItems[i];\r\n const cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils.containsScope(cachedScopes, scopes)) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n\r\n //if only one cached token found\r\n if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n\r\n authenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(accessTokenCacheItem.key.authority, this.validateAuthority);\r\n }\r\n else if (filteredItems.length > 1) {\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n else {\r\n //no match found. check if there was a single authority used\r\n const authorityList = this.getUniqueAuthority(tokenCacheItems, \"authority\");\r\n if (authorityList.length > 1) {\r\n return {\r\n errorDesc: \"Multiple authorities found in the cache. Pass authority in the API overload.\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n\r\n authenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(authorityList[0], this.validateAuthority);\r\n }\r\n }\r\n else {\r\n //authority was passed in the API, filter by authority and scope\r\n for (let i = 0; i < tokenCacheItems.length; i++) {\r\n const cacheItem = tokenCacheItems[i];\r\n const cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils.containsScope(cachedScopes, scopes) && cacheItem.key.authority === authenticationRequest.authority) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n\r\n //no match\r\n if (filteredItems.length === 0) {\r\n return null;\r\n }\r\n //only one cachedToken Found\r\n else if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n }\r\n else {\r\n //more than one match found.\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements.Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n }\r\n\r\n if (accessTokenCacheItem != null) {\r\n const expired = Number(accessTokenCacheItem.value.expiresIn);\r\n // If expiration is within offset, it will force renew\r\n const offset = this._clockSkew || 300;\r\n if (expired && (expired > Utils.now() + offset)) {\r\n return {\r\n errorDesc: null,\r\n token: accessTokenCacheItem.value.accessToken,\r\n error: null\r\n };\r\n } else {\r\n this._cacheStorage.removeItem(JSON.stringify(filteredItems[0].key));\r\n return null;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n /*\r\n * Used to filter all cached items and return a list of unique users based on userIdentifier.\r\n * @param {Array} Users - users saved in the cache.\r\n */\r\n getAllUsers(): Array {\r\n const users: Array = [];\r\n const accessTokenCacheItems = this._cacheStorage.getAllAccessTokens(Constants.clientId, Constants.authority);\r\n for (let i = 0; i < accessTokenCacheItems.length; i++) {\r\n const idToken = new IdToken(accessTokenCacheItems[i].value.idToken);\r\n const clientInfo = new ClientInfo(accessTokenCacheItems[i].value.clientInfo);\r\n const user = User.createUser(idToken, clientInfo, this.authority);\r\n users.push(user);\r\n }\r\n\r\n return this.getUniqueUsers(users);\r\n }\r\n\r\n /*\r\n * Used to filter users based on userIdentifier\r\n * @param {Array} Users - users saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n private getUniqueUsers(users: Array): Array {\r\n if (!users || users.length <= 1) {\r\n return users;\r\n }\r\n\r\n const flags: Array = [];\r\n const uniqueUsers: Array = [];\r\n for (let index = 0; index < users.length; ++index) {\r\n if (users[index].userIdentifier && flags.indexOf(users[index].userIdentifier) === -1) {\r\n flags.push(users[index].userIdentifier);\r\n uniqueUsers.push(users[index]);\r\n }\r\n }\r\n\r\n return uniqueUsers;\r\n }\r\n\r\n /*\r\n * Used to get a unique list of authoritues from the cache\r\n * @param {Array} accessTokenCacheItems - accessTokenCacheItems saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n private getUniqueAuthority(accessTokenCacheItems: Array, property: string): Array {\r\n const authorityList: Array = [];\r\n const flags: Array = [];\r\n accessTokenCacheItems.forEach(element => {\r\n if (element.key.hasOwnProperty(property) && (flags.indexOf(element.key[property]) === -1)) {\r\n flags.push(element.key[property]);\r\n authorityList.push(element.key[property]);\r\n }\r\n });\r\n return authorityList;\r\n }\r\n\r\n /*\r\n * Adds login_hint to authorization URL which is used to pre-fill the username field of sign in page for the user if known ahead of time\r\n * domain_hint can be one of users/organisations which when added skips the email based discovery process of the user\r\n * domain_req utid received as part of the clientInfo\r\n * login_req uid received as part of clientInfo\r\n * @param {string} urlNavigate - Authentication request url\r\n * @param {User} user - User for which the token is requested\r\n * @ignore\r\n * @hidden\r\n */\r\n private addHintParameters(urlNavigate: string, user: User): string {\r\n const userObject = user ? user : this.getUser();\r\n const decodedClientInfo = userObject.userIdentifier.split(\".\");\r\n const uid = Utils.base64DecodeStringUrlSafe(decodedClientInfo[0]);\r\n const utid = Utils.base64DecodeStringUrlSafe(decodedClientInfo[1]);\r\n if (!this.urlContainsQueryStringParameter(\"login_hint\", urlNavigate) && userObject.displayableId && !Utils.isEmpty(userObject.displayableId)) {\r\n urlNavigate += \"&login_hint=\" + encodeURIComponent(user.displayableId);\r\n }\r\n\r\n if (!Utils.isEmpty(uid) && !Utils.isEmpty(utid)) {\r\n if (!this.urlContainsQueryStringParameter(\"domain_req\", urlNavigate) && !Utils.isEmpty(utid)) {\r\n urlNavigate += \"&domain_req=\" + encodeURIComponent(utid);\r\n }\r\n\r\n if (!this.urlContainsQueryStringParameter(\"login_req\", urlNavigate) && !Utils.isEmpty(uid)) {\r\n urlNavigate += \"&login_req=\" + encodeURIComponent(uid);\r\n }\r\n\r\n if (!this.urlContainsQueryStringParameter(\"domain_hint\", urlNavigate) && !Utils.isEmpty(utid)) {\r\n if (utid === \"9188040d-6c67-4c5b-b112-36a304b66dad\") {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"consumers\");\r\n } else {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"organizations\");\r\n }\r\n }\r\n }\r\n\r\n return urlNavigate;\r\n }\r\n\r\n /*\r\n * Checks if the authorization endpoint URL contains query string parameters\r\n * @ignore\r\n * @hidden\r\n */\r\n private urlContainsQueryStringParameter(name: string, url: string): boolean {\r\n // regex to detect pattern of a ? or & followed by the name parameter and an equals character\r\n const regex = new RegExp(\"[\\\\?&]\" + name + \"=\");\r\n return regex.test(url);\r\n }\r\n\r\n /*\r\n * Used to obtain an access_token by redirecting the user to the authorization endpoint.\r\n * To renew idToken, clientId should be passed as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://{instance}/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://{instance}/tfp/<tenant>/\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n */\r\n acquireTokenRedirect(scopes: Array): void;\r\n acquireTokenRedirect(scopes: Array, authority: string): void;\r\n acquireTokenRedirect(scopes: Array, authority: string, user: User): void;\r\n acquireTokenRedirect(scopes: Array, authority: string, user: User, extraQueryParameters: string): void;\r\n acquireTokenRedirect(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string): void {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(isValidScope, null, null, Constants.accessToken);\r\n return;\r\n }\r\n }\r\n\r\n if (scopes) {\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n const userObject = user ? user : this.getUser();\r\n if (this._acquireTokenInProgress) {\r\n return;\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n if (!userObject) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(ErrorDescription.userLoginError, null, ErrorCodes.userLoginError, Constants.accessToken);\r\n return;\r\n }\r\n }\r\n\r\n this._acquireTokenInProgress = true;\r\n let authenticationRequest: AuthenticationRequestParameters;\r\n let acquireTokenAuthority = authority ? AuthorityFactory.CreateInstance(authority, this.validateAuthority) : this.authorityInstance;\r\n\r\n acquireTokenAuthority.ResolveEndpointsAsync().then(() => {\r\n if (Utils.compareObjects(userObject, this.getUser())) {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.token, this._redirectUri);\r\n } else {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.id_token_token, this._redirectUri);\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + userObject.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(userObject));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, acquireTokenAuthority.CanonicalAuthority);\r\n }\r\n\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n urlNavigate = this.addHintParameters(urlNavigate, userObject);\r\n if (urlNavigate) {\r\n this._cacheStorage.setItem(Constants.stateAcquireToken, authenticationRequest.state);\r\n this._requestType = Constants.renewToken;\r\n window.location.replace(urlNavigate);\r\n }\r\n });\r\n }\r\n\r\n /*\r\n * Used to acquire an access token for a new user using interactive authentication via a popup Window.\r\n * To request an id_token, pass the clientId as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\".\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the token or error.\r\n */\r\n acquireTokenPopup(scopes: Array): Promise;\r\n acquireTokenPopup(scopes: Array, authority: string): Promise;\r\n acquireTokenPopup(scopes: Array, authority: string, user: User): Promise;\r\n acquireTokenPopup(scopes: Array, authority: string, user: User, extraQueryParameters: string): Promise;\r\n acquireTokenPopup(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string): Promise {\r\n return new Promise((resolve, reject) => {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n reject(ErrorCodes.inputScopesError + \":\" + isValidScope);\r\n }\r\n\r\n if (scopes) {\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n const userObject = user ? user : this.getUser();\r\n if (this._acquireTokenInProgress) {\r\n reject(ErrorCodes.acquireTokenProgressError + \":\" + ErrorDescription.acquireTokenProgressError);\r\n return;\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n if (!userObject) {\r\n reject(ErrorCodes.userLoginError + \":\" + ErrorDescription.userLoginError);\r\n return;\r\n }\r\n\r\n this._acquireTokenInProgress = true;\r\n let authenticationRequest: AuthenticationRequestParameters;\r\n let acquireTokenAuthority = authority ? AuthorityFactory.CreateInstance(authority, this.validateAuthority) : this.authorityInstance;\r\n var popUpWindow = this.openWindow(\"about:blank\", \"_blank\", 1, this, resolve, reject);\r\n if (!popUpWindow) {\r\n return;\r\n }\r\n\r\n acquireTokenAuthority.ResolveEndpointsAsync().then(() => {\r\n if (Utils.compareObjects(userObject, this.getUser())) {\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n }\r\n else {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.token, this._redirectUri);\r\n }\r\n } else {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.id_token_token, this._redirectUri);\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n authenticationRequest.state = authenticationRequest.state;\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + userObject.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(userObject));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, acquireTokenAuthority.CanonicalAuthority);\r\n }\r\n\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n urlNavigate = this.addHintParameters(urlNavigate, userObject);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._requestType = Constants.renewToken;\r\n if (popUpWindow) {\r\n popUpWindow.location.href = urlNavigate;\r\n }\r\n\r\n }, () => {\r\n this._logger.info(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.endpointResolutionError);\r\n if (reject) {\r\n reject(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n }\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n });\r\n });\r\n }\r\n\r\n /*\r\n * Used to get the token from cache.\r\n * MSAL will return the cached token if it is not expired.\r\n * Or it will send a request to the STS to obtain an access_token using a hidden iframe. To renew idToken, clientId should be passed as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Resolved with token or rejected with error.\r\n */\r\n @resolveTokenOnlyIfOutOfIframe\r\n acquireTokenSilent(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string): Promise {\r\n return new Promise((resolve, reject) => {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n reject(ErrorCodes.inputScopesError + \":\" + isValidScope);\r\n } else {\r\n if (scopes) {\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n const userObject = user ? user : this.getUser();\r\n if (!userObject) {\r\n reject(ErrorCodes.userLoginError + \":\" + ErrorDescription.userLoginError);\r\n return;\r\n }\r\n\r\n let authenticationRequest: AuthenticationRequestParameters;\r\n let newAuthority = authority ? AuthorityFactory.CreateInstance(authority, this.validateAuthority) : this.authorityInstance;\r\n if (Utils.compareObjects(userObject, this.getUser())) {\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n authenticationRequest = new AuthenticationRequestParameters(newAuthority, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n }\r\n else {\r\n authenticationRequest = new AuthenticationRequestParameters(newAuthority, this.clientId, scopes, ResponseTypes.token, this._redirectUri);\r\n }\r\n } else {\r\n authenticationRequest = new AuthenticationRequestParameters(newAuthority, this.clientId, scopes, ResponseTypes.id_token_token, this._redirectUri);\r\n }\r\n\r\n const cacheResult = this.getCachedToken(authenticationRequest, userObject);\r\n if (cacheResult) {\r\n if (cacheResult.token) {\r\n this._logger.info(\"Token is already in cache for scope:\" + scope);\r\n resolve(cacheResult.token);\r\n return;\r\n }\r\n else if (cacheResult.errorDesc || cacheResult.error) {\r\n this._logger.infoPii(cacheResult.errorDesc + \":\" + cacheResult.error);\r\n reject(cacheResult.errorDesc + \": \" + cacheResult.error);\r\n return;\r\n }\r\n }\r\n\r\n this._requestType = Constants.renewToken;\r\n // cache miss\r\n return this.authorityInstance.ResolveEndpointsAsync()\r\n .then(() => {\r\n // refresh attept with iframe\r\n //Already renewing for this scope, callback when we get the token.\r\n if (this._activeRenewals[scope]) {\r\n this._logger.verbose(\"Renew token for scope: \" + scope + \" is in progress. Registering callback\");\r\n //Active renewals contains the state for each renewal.\r\n this.registerCallback(this._activeRenewals[scope], scope, resolve, reject);\r\n }\r\n else {\r\n if (scopes && scopes.indexOf(this.clientId) > -1 && scopes.length === 1) {\r\n // App uses idToken to send to api endpoints\r\n // Default scope is tracked as clientId to store this token\r\n this._logger.verbose(\"renewing idToken\");\r\n this.renewIdToken(scopes, resolve, reject, userObject, authenticationRequest, extraQueryParameters);\r\n } else {\r\n this._logger.verbose(\"renewing accesstoken\");\r\n this.renewToken(scopes, resolve, reject, userObject, authenticationRequest, extraQueryParameters);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /*\r\n * Calling _loadFrame but with a timeout to signal failure in loadframeStatus. Callbacks are left.\r\n * registered when network errors occur and subsequent token requests for same resource are registered to the pending request.\r\n * @ignore\r\n * @hidden\r\n */\r\n private loadIframeTimeout(urlNavigate: string, frameName: string, scope: string): void {\r\n //set iframe session to pending\r\n this._logger.verbose(\"Set loading state to pending for: \" + scope);\r\n this._cacheStorage.setItem(Constants.renewStatus + scope, Constants.tokenRenewStatusInProgress);\r\n this.loadFrame(urlNavigate, frameName);\r\n setTimeout(() => {\r\n if (this._cacheStorage.getItem(Constants.renewStatus + scope) === Constants.tokenRenewStatusInProgress) {\r\n // fail the iframe session if it\"s in pending state\r\n this._logger.verbose(\"Loading frame has timed out after: \" + (this.loadFrameTimeout / 1000) + \" seconds for scope \" + scope);\r\n const expectedState = this._activeRenewals[scope];\r\n if (expectedState && window.callBackMappedToRenewStates[expectedState]) {\r\n window.callBackMappedToRenewStates[expectedState](\"Token renewal operation failed due to timeout\", null, \"Token Renewal Failed\", Constants.accessToken);\r\n }\r\n \r\n this._cacheStorage.setItem(Constants.renewStatus + scope, Constants.tokenRenewStatusCancelled);\r\n }\r\n }, this.loadFrameTimeout);\r\n }\r\n\r\n /*\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n * @hidden\r\n */\r\n private loadFrame(urlNavigate: string, frameName: string): void {\r\n // This trick overcomes iframe navigation in IE\r\n // IE does not load the page consistently in iframe\r\n this._logger.info(\"LoadFrame: \" + frameName);\r\n var frameCheck = frameName;\r\n setTimeout(() => {\r\n var frameHandle = this.addAdalFrame(frameCheck);\r\n if (frameHandle.src === \"\" || frameHandle.src === \"about:blank\") {\r\n frameHandle.src = urlNavigate;\r\n this._logger.infoPii(\"Frame Name : \" + frameName + \" Navigated to: \" + urlNavigate);\r\n }\r\n },\r\n 500);\r\n }\r\n\r\n /*\r\n * Adds the hidden iframe for silent token renewal.\r\n * @ignore\r\n * @hidden\r\n */\r\n private addAdalFrame(iframeId: string): HTMLIFrameElement {\r\n if (typeof iframeId === \"undefined\") {\r\n return null;\r\n }\r\n\r\n this._logger.info(\"Add msal frame to document:\" + iframeId);\r\n let adalFrame = document.getElementById(iframeId) as HTMLIFrameElement;\r\n if (!adalFrame) {\r\n if (document.createElement &&\r\n document.documentElement &&\r\n (window.navigator.userAgent.indexOf(\"MSIE 5.0\") === -1)) {\r\n const ifr = document.createElement(\"iframe\");\r\n ifr.setAttribute(\"id\", iframeId);\r\n ifr.style.visibility = \"hidden\";\r\n ifr.style.position = \"absolute\";\r\n ifr.style.width = ifr.style.height = \"0\";\r\n ifr.style.border = \"0\";\r\n adalFrame = (document.getElementsByTagName(\"body\")[0].appendChild(ifr) as HTMLIFrameElement);\r\n } else if (document.body && document.body.insertAdjacentHTML) {\r\n document.body.insertAdjacentHTML('beforeend', '');\r\n }\r\n\r\n if (window.frames && window.frames[iframeId]) {\r\n adalFrame = window.frames[iframeId];\r\n }\r\n }\r\n\r\n return adalFrame;\r\n }\r\n\r\n /*\r\n * Acquires access token using a hidden iframe.\r\n * @ignore\r\n * @hidden\r\n */\r\n private renewToken(scopes: Array, resolve: Function, reject: Function, user: User, authenticationRequest: AuthenticationRequestParameters, extraQueryParameters?: string): void {\r\n const scope = scopes.join(\" \").toLowerCase();\r\n this._logger.verbose(\"renewToken is called for scope:\" + scope);\r\n const frameHandle = this.addAdalFrame(\"msalRenewFrame\" + scope);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + user.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(user));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, authenticationRequest.authority);\r\n }\r\n\r\n // renew happens in iframe, so it keeps javascript context\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._logger.verbose(\"Renew token Expected state: \" + authenticationRequest.state);\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=none\";\r\n urlNavigate = this.addHintParameters(urlNavigate, user);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n frameHandle.src = \"about:blank\";\r\n this.loadIframeTimeout(urlNavigate, \"msalRenewFrame\" + scope, scope);\r\n }\r\n\r\n /*\r\n * Renews idtoken for app\"s own backend when clientId is passed as a single scope in the scopes array.\r\n * @ignore\r\n * @hidden\r\n */\r\n private renewIdToken(scopes: Array, resolve: Function, reject: Function, user: User, authenticationRequest: AuthenticationRequestParameters, extraQueryParameters?: string): void {\r\n const scope = scopes.join(\" \").toLowerCase();\r\n this._logger.info(\"renewidToken is called\");\r\n const frameHandle = this.addAdalFrame(\"msalIdTokenFrame\");\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + user.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(user));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, authenticationRequest.authority);\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._logger.verbose(\"Renew Idtoken Expected state: \" + authenticationRequest.state);\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=none\";\r\n urlNavigate = this.addHintParameters(urlNavigate, user);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, this.clientId, resolve, reject);\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n frameHandle.src = \"about:blank\";\r\n this.loadIframeTimeout(urlNavigate, \"msalIdTokenFrame\", this.clientId);\r\n }\r\n\r\n /*\r\n * Returns the signed in user (received from a user object created at the time of login) or null.\r\n */\r\n getUser(): User {\r\n // idToken is first call\r\n if (this._user) {\r\n return this._user;\r\n }\r\n\r\n // frame is used to get idToken\r\n const rawIdToken = this._cacheStorage.getItem(Constants.idTokenKey);\r\n const rawClientInfo = this._cacheStorage.getItem(Constants.msalClientInfo);\r\n if (!Utils.isEmpty(rawIdToken) && !Utils.isEmpty(rawClientInfo)) {\r\n const idToken = new IdToken(rawIdToken);\r\n const clientInfo = new ClientInfo(rawClientInfo);\r\n this._user = User.createUser(idToken, clientInfo, this.authority);\r\n return this._user;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /*\r\n * This method must be called for processing the response received from the STS. It extracts the hash, processes the token or error information and saves it in the cache. It then\r\n * calls the registered callbacks in case of redirect or resolves the promises with the result.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n * @hidden\r\n */\r\n private handleAuthenticationResponse(hash: string): void {\r\n if (hash == null) {\r\n hash = window.location.hash;\r\n }\r\n\r\n var self = null;\r\n var isPopup: boolean = false;\r\n var isWindowOpenerMsal = false;\r\n\r\n try {\r\n isWindowOpenerMsal = window.opener && window.opener.msal && window.opener.msal !== window.msal;\r\n } catch (err) {\r\n // err = SecurityError: Blocked a frame with origin \"[url]\" from accessing a cross-origin frame.\r\n isWindowOpenerMsal = false;\r\n }\r\n\r\n if (isWindowOpenerMsal) {\r\n self = window.opener.msal;\r\n isPopup = true;\r\n }\r\n else if (window.parent && window.parent.msal) {\r\n self = window.parent.msal;\r\n }\r\n\r\n const requestInfo = self.getRequestInfo(hash);\r\n let token: string = null, tokenReceivedCallback: (errorDesc: string, token: string, error: string, tokenType: string) => void = null, tokenType: string, saveToken:boolean = true;\r\n \r\n self._logger.info(\"Returned from redirect url\");\r\n \r\n if (window.parent !== window && window.parent.callBackMappedToRenewStates[requestInfo.stateResponse]) {\r\n tokenReceivedCallback = window.parent.callBackMappedToRenewStates[requestInfo.stateResponse];\r\n }\r\n else if (window.opener && window.opener.msal && window.opener.callBackMappedToRenewStates[requestInfo.stateResponse]) {\r\n tokenReceivedCallback = window.opener.callBackMappedToRenewStates[requestInfo.stateResponse];\r\n }\r\n else {\r\n if (self._navigateToLoginRequestUrl) {\r\n tokenReceivedCallback = null;\r\n self._cacheStorage.setItem(Constants.urlHash, hash);\r\n saveToken = false;\r\n if (window.parent === window && !isPopup) {\r\n window.location.href = self._cacheStorage.getItem(Constants.loginRequest);\r\n }\r\n return;\r\n }\r\n else {\r\n tokenReceivedCallback = self._tokenReceivedCallback;\r\n window.location.hash = '';\r\n }\r\n\r\n }\r\n\r\n self.saveTokenFromHash(requestInfo);\r\n\r\n if ((requestInfo.requestType === Constants.renewToken) && window.parent) {\r\n if (window.parent!==window) {\r\n self._logger.verbose(\"Window is in iframe, acquiring token silently\");\r\n } else {\r\n self._logger.verbose(\"acquiring token interactive in progress\");\r\n }\r\n\r\n token = requestInfo.parameters[Constants.accessToken] || requestInfo.parameters[Constants.idToken];\r\n tokenType = Constants.accessToken;\r\n } else if (requestInfo.requestType === Constants.login) {\r\n token = requestInfo.parameters[Constants.idToken];\r\n tokenType = Constants.idToken;\r\n }\r\n\r\n var errorDesc = requestInfo.parameters[Constants.errorDescription];\r\n var error = requestInfo.parameters[Constants.error];\r\n \r\n try {\r\n if (tokenReceivedCallback) {\r\n tokenReceivedCallback.call(self, errorDesc, token, error, tokenType);\r\n }\r\n\r\n } catch (err) {\r\n self._logger.error(\"Error occurred in token received callback function: \" + err);\r\n }\r\n \r\n for (var i = 0; i < self._openedWindows.length; i++) {\r\n self._openedWindows[i].close();\r\n }\r\n\r\n }\r\n\r\n /*\r\n * This method must be called for processing the response received from AAD. It extracts the hash, processes the token or error, saves it in the cache and calls the registered callbacks with the result.\r\n * @param {string} authority authority received in the redirect response from AAD.\r\n * @param {TokenResponse} requestInfo an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n * @param {User} user user object for which scopes are consented for. The default user is the logged in user.\r\n * @param {ClientInfo} clientInfo clientInfo received as part of the response comprising of fields uid and utid.\r\n * @param {IdToken} idToken idToken received as part of the response.\r\n * @ignore\r\n * @private\r\n * @hidden\r\n */\r\n private saveAccessToken(authority: string, tokenResponse: TokenResponse, user: User, clientInfo: string, idToken: IdToken): void {\r\n let scope: string;\r\n let clientObj: ClientInfo = new ClientInfo(clientInfo);\r\n if (tokenResponse.parameters.hasOwnProperty(\"scope\")) {\r\n scope = tokenResponse.parameters[\"scope\"];\r\n const consentedScopes = scope.split(\" \");\r\n const accessTokenCacheItems =\r\n this._cacheStorage.getAllAccessTokens(this.clientId, authority);\r\n for (let i = 0; i < accessTokenCacheItems.length; i++) {\r\n const accessTokenCacheItem = accessTokenCacheItems[i];\r\n if (accessTokenCacheItem.key.userIdentifier === user.userIdentifier) {\r\n const cachedScopes = accessTokenCacheItem.key.scopes.split(\" \");\r\n if (Utils.isIntersectingScopes(cachedScopes, consentedScopes)) {\r\n this._cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n }\r\n }\r\n }\r\n const accessTokenKey = new AccessTokenKey(authority, this.clientId, scope, clientObj.uid, clientObj.utid);\r\n const accessTokenValue = new AccessTokenValue(tokenResponse.parameters[Constants.accessToken], idToken.rawIdToken, Utils.expiresIn(tokenResponse.parameters[Constants.expiresIn]).toString(), clientInfo);\r\n this._cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n } else {\r\n scope = this.clientId;\r\n const accessTokenKey = new AccessTokenKey(authority, this.clientId, scope, clientObj.uid, clientObj.utid);\r\n const accessTokenValue = new AccessTokenValue(tokenResponse.parameters[Constants.idToken], tokenResponse.parameters[Constants.idToken], idToken.expiration, clientInfo);\r\n this._cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n }\r\n }\r\n\r\n /*\r\n * Saves token or error received in the response from AAD in the cache. In case of id_token, it also creates the user object.\r\n * @ignore\r\n * @hidden\r\n */\r\n private saveTokenFromHash(tokenResponse: TokenResponse): void {\r\n this._logger.info(\"State status:\" + tokenResponse.stateMatch + \"; Request type:\" + tokenResponse.requestType);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n var scope: string = \"\";\r\n if (tokenResponse.parameters.hasOwnProperty(\"scope\")) {\r\n scope = tokenResponse.parameters[\"scope\"];\r\n }\r\n else {\r\n scope = this.clientId;\r\n }\r\n\r\n // Record error\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.errorDescription) || tokenResponse.parameters.hasOwnProperty(Constants.error)) {\r\n this._logger.infoPii(\"Error :\" + tokenResponse.parameters[Constants.error] + \"; Error description:\" + tokenResponse.parameters[Constants.errorDescription]);\r\n this._cacheStorage.setItem(Constants.msalError, tokenResponse.parameters[\"error\"]);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, tokenResponse.parameters[Constants.errorDescription]);\r\n if (tokenResponse.requestType === Constants.login) {\r\n this._loginInProgress = false;\r\n this._cacheStorage.setItem(Constants.loginError, tokenResponse.parameters[Constants.errorDescription] + \":\" + tokenResponse.parameters[Constants.error]);\r\n }\r\n\r\n if (tokenResponse.requestType === Constants.renewToken) {\r\n this._acquireTokenInProgress = false;\r\n }\r\n } else {\r\n // It must verify the state from redirect\r\n if (tokenResponse.stateMatch) {\r\n // record tokens to storage if exists\r\n this._logger.info(\"State is right\");\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.sessionState)) {\r\n this._cacheStorage.setItem(Constants.msalSessionState, tokenResponse.parameters[Constants.sessionState]);\r\n }\r\n \r\n var idToken: IdToken;\r\n var clientInfo: string = \"\";\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.accessToken)) {\r\n this._logger.info(\"Fragment has access token\");\r\n this._acquireTokenInProgress = false;\r\n let user: User;\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.idToken)) {\r\n idToken = new IdToken(tokenResponse.parameters[Constants.idToken]);\r\n } else {\r\n idToken = new IdToken(this._cacheStorage.getItem(Constants.idTokenKey));\r\n }\r\n\r\n let authorityKey = Constants.authority + Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n let authority: string;\r\n if (!Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n authority = this._cacheStorage.getItem(authorityKey);\r\n authority = Utils.replaceFirstPath(authority, idToken.tenantId);\r\n }\r\n\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.clientInfo)) {\r\n clientInfo = tokenResponse.parameters[Constants.clientInfo];\r\n user = User.createUser(idToken, new ClientInfo(clientInfo), authority);\r\n } else {\r\n this._logger.warning(\"ClientInfo not received in the response from AAD\");\r\n user = User.createUser(idToken, new ClientInfo(clientInfo), authority);\r\n }\r\n\r\n let acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + user.userIdentifier + Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n let acquireTokenUser: User;\r\n if (!Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n acquireTokenUser = JSON.parse(this._cacheStorage.getItem(acquireTokenUserKey));\r\n if (user && acquireTokenUser && Utils.compareObjects(user, acquireTokenUser)) {\r\n this.saveAccessToken(authority, tokenResponse, user, clientInfo, idToken);\r\n this._logger.info(\r\n \"The user object received in the response is the same as the one passed in the acquireToken request\");\r\n } else {\r\n this._logger.warning(\r\n \"The user object created from the response is not the same as the one passed in the acquireToken request\");\r\n }\r\n }\r\n }\r\n\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.idToken)) {\r\n if (scope.indexOf(this.clientId) > -1) {\r\n this._logger.info(\"Fragment has id token\");\r\n this._loginInProgress = false;\r\n idToken = new IdToken(tokenResponse.parameters[Constants.idToken]);\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.clientInfo)) {\r\n clientInfo = tokenResponse.parameters[Constants.clientInfo];\r\n } else {\r\n this._logger.warning(\"ClientInfo not received in the response from AAD\");\r\n }\r\n\r\n let authorityKey = Constants.authority + Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n let authority: string;\r\n if (!Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n authority = this._cacheStorage.getItem(authorityKey);\r\n authority = Utils.replaceFirstPath(authority, idToken.tenantId);\r\n }\r\n\r\n this._user = User.createUser(idToken, new ClientInfo(clientInfo), authority);\r\n if (idToken && idToken.nonce) {\r\n if (idToken.nonce !== this._cacheStorage.getItem(Constants.nonceIdToken)) {\r\n this._user = null;\r\n this._cacheStorage.setItem(Constants.loginError, \"Nonce Mismatch. Expected Nonce: \" + this._cacheStorage.getItem(Constants.nonceIdToken) + \",\" + \"Actual Nonce: \" + idToken.nonce);\r\n this._logger.error(\"Nonce Mismatch.Expected Nonce: \" + this._cacheStorage.getItem(Constants.nonceIdToken) + \",\" + \"Actual Nonce: \" + idToken.nonce);\r\n } else {\r\n this._cacheStorage.setItem(Constants.idTokenKey, tokenResponse.parameters[Constants.idToken]);\r\n this._cacheStorage.setItem(Constants.msalClientInfo, clientInfo);\r\n\r\n // Save idToken as access token for app itself\r\n this.saveAccessToken(authority, tokenResponse, this._user, clientInfo, idToken);\r\n }\r\n } else {\r\n this._logger.error(\"Invalid id_token received in the response\");\r\n this._cacheStorage.setItem(Constants.msalError, \"invalid idToken\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"Invalid idToken. idToken: \" + tokenResponse.parameters[Constants.idToken]);\r\n }\r\n }\r\n }\r\n } else {\r\n this._logger.error(\"State Mismatch.Expected State: \" + this._cacheStorage.getItem(Constants.stateLogin) + \",\" + \"Actual State: \" + tokenResponse.stateResponse);\r\n this._cacheStorage.setItem(Constants.msalError, \"Invalid_state\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"Invalid_state. state: \" + tokenResponse.stateResponse);\r\n }\r\n }\r\n this._cacheStorage.setItem(Constants.renewStatus + scope, Constants.tokenRenewStatusCompleted);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.acquireTokenUser, Constants.renewStatus);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.authority + Constants.resourceDelimeter, Constants.renewStatus);\r\n }\r\n\r\n /*\r\n * Checks if the redirect response is received from the STS. In case of redirect, the url fragment has either id_token, access_token or error.\r\n * @param {string} hash - Hash passed from redirect page.\r\n * @returns {Boolean} - true if response contains id_token, access_token or error, false otherwise.\r\n * @hidden\r\n */\r\n isCallback(hash: string): boolean {\r\n hash = this.getHash(hash);\r\n const parameters = Utils.deserialize(hash);\r\n return (\r\n parameters.hasOwnProperty(Constants.errorDescription) ||\r\n parameters.hasOwnProperty(Constants.error) ||\r\n parameters.hasOwnProperty(Constants.accessToken) ||\r\n parameters.hasOwnProperty(Constants.idToken)\r\n\r\n );\r\n }\r\n\r\n /*\r\n * Returns the anchor part(#) of the URL\r\n * @ignore\r\n * @hidden\r\n */\r\n private getHash(hash: string): string {\r\n if (hash.indexOf(\"#/\") > -1) {\r\n hash = hash.substring(hash.indexOf(\"#/\") + 2);\r\n } else if (hash.indexOf(\"#\") > -1) {\r\n hash = hash.substring(1);\r\n }\r\n\r\n return hash;\r\n }\r\n\r\n /*\r\n * Creates a requestInfo object from the URL fragment and returns it.\r\n * @param {string} hash - Hash passed from redirect page\r\n * @returns {TokenResponse} an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n * @ignore\r\n * @hidden\r\n */\r\n private getRequestInfo(hash: string): TokenResponse {\r\n hash = this.getHash(hash);\r\n const parameters = Utils.deserialize(hash);\r\n const tokenResponse = new TokenResponse();\r\n if (parameters) {\r\n tokenResponse.parameters = parameters;\r\n if (parameters.hasOwnProperty(Constants.errorDescription) ||\r\n parameters.hasOwnProperty(Constants.error) ||\r\n parameters.hasOwnProperty(Constants.accessToken) ||\r\n parameters.hasOwnProperty(Constants.idToken)) {\r\n tokenResponse.valid = true;\r\n // which call\r\n let stateResponse: string;\r\n if (parameters.hasOwnProperty(\"state\")) {\r\n stateResponse = parameters.state;\r\n } else {\r\n return tokenResponse;\r\n }\r\n\r\n tokenResponse.stateResponse = stateResponse;\r\n // async calls can fire iframe and login request at the same time if developer does not use the API as expected\r\n // incoming callback needs to be looked up to find the request type\r\n if (stateResponse === this._cacheStorage.getItem(Constants.stateLogin)) { // loginRedirect\r\n tokenResponse.requestType = Constants.login;\r\n tokenResponse.stateMatch = true;\r\n return tokenResponse;\r\n } else if (stateResponse === this._cacheStorage.getItem(Constants.stateAcquireToken)) { //acquireTokenRedirect\r\n tokenResponse.requestType = Constants.renewToken;\r\n tokenResponse.stateMatch = true;\r\n return tokenResponse;\r\n }\r\n\r\n // external api requests may have many renewtoken requests for different resource\r\n if (!tokenResponse.stateMatch) {\r\n if (window.parent && window.parent !== window) {\r\n tokenResponse.requestType = Constants.renewToken;\r\n }\r\n else {\r\n tokenResponse.requestType = this._requestType;\r\n }\r\n const statesInParentContext = this._renewStates;\r\n for (let i = 0; i < statesInParentContext.length; i++) {\r\n if (statesInParentContext[i] === tokenResponse.stateResponse) {\r\n tokenResponse.stateMatch = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return tokenResponse;\r\n }\r\n\r\n /*\r\n * Extracts scope value from the state sent with the authentication request.\r\n * @returns {string} scope.\r\n * @ignore\r\n * @hidden\r\n */\r\n private getScopeFromState(state: string): string {\r\n if (state) {\r\n const splitIndex = state.indexOf(\"|\");\r\n if (splitIndex > -1 && splitIndex + 1 < state.length) {\r\n return state.substring(splitIndex + 1);\r\n }\r\n }\r\n return \"\";\r\n }\r\n\r\n /*\r\n * Returns whether current window is in ifram for token renewal\r\n * @ignore\r\n * @hidden\r\n */\r\n private isInIframe() {\r\n return window.parent !== window;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/UserAgentApplication.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AccessTokenKey {\r\n\r\n authority: string;\r\n clientId: string;\r\n userIdentifier: string;\r\n scopes: string;\r\n\r\n constructor(authority: string, clientId: string, scopes: string, uid: string, utid: string) {\r\n this.authority = authority;\r\n this.clientId = clientId;\r\n this.scopes = scopes;\r\n this.userIdentifier = Utils.base64EncodeStringUrlSafe(uid) + \".\" + Utils.base64EncodeStringUrlSafe(utid);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AccessTokenKey.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AccessTokenValue {\r\n\r\n accessToken: string;\r\n idToken: string;\r\n expiresIn: string;\r\n clientInfo: string;\r\n\r\n constructor(accessToken: string, idToken: string, expiresIn: string, clientInfo: string) {\r\n this.accessToken = accessToken;\r\n this.idToken = idToken;\r\n this.expiresIn = expiresIn;\r\n this.clientInfo = clientInfo;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AccessTokenValue.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Authority } from \"./Authority\";\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AuthenticationRequestParameters {\r\n authorityInstance: Authority;\r\n clientId: string;\r\n nonce: string;\r\n state: string;\r\n correlationId: string;\r\n xClientVer: string;\r\n xClientSku: string;\r\n scopes: Array;\r\n responseType: string;\r\n promptValue: string;\r\n extraQueryParameters: string;\r\n loginHint: string;\r\n domainHint: string;\r\n redirectUri: string;\r\n public get authority(): string {\r\n return this.authorityInstance.CanonicalAuthority;\r\n }\r\n\r\n constructor(authority: Authority, clientId: string, scope: Array, responseType: string, redirectUri: string) {\r\n this.authorityInstance = authority;\r\n this.clientId = clientId;\r\n this.scopes = scope;\r\n this.responseType = responseType;\r\n this.redirectUri = redirectUri;\r\n // randomly generated values\r\n this.correlationId = Utils.createNewGuid();\r\n this.state = Utils.createNewGuid();\r\n this.nonce = Utils.createNewGuid();\r\n // telemetry information\r\n this.xClientSku = \"MSAL.JS\";\r\n this.xClientVer = Utils.getLibraryVersion();\r\n }\r\n\r\n createNavigateUrl(scopes: Array): string {\r\n if (!scopes) {\r\n scopes = [this.clientId];\r\n }\r\n\r\n if (scopes.indexOf(this.clientId) === -1) {\r\n scopes.push(this.clientId);\r\n }\r\n\r\n const str: Array = [];\r\n str.push(\"response_type=\" + this.responseType);\r\n this.translateclientIdUsedInScope(scopes);\r\n str.push(\"scope=\" + encodeURIComponent(this.parseScope(scopes)));\r\n str.push(\"client_id=\" + encodeURIComponent(this.clientId));\r\n str.push(\"redirect_uri=\" + encodeURIComponent(this.redirectUri));\r\n str.push(\"state=\" + encodeURIComponent(this.state));\r\n str.push(\"nonce=\" + encodeURIComponent(this.nonce));\r\n str.push(\"client_info=1\");\r\n str.push(`x-client-SKU=${this.xClientSku}`);\r\n str.push(`x-client-Ver=${this.xClientVer}`);\r\n\r\n if (this.extraQueryParameters) {\r\n str.push(this.extraQueryParameters);\r\n }\r\n\r\n str.push(\"client-request-id=\" + encodeURIComponent(this.correlationId));\r\n let authEndpoint: string = this.authorityInstance.AuthorizationEndpoint;\r\n\r\n // if the endpoint already has queryparams, lets add to it, otherwise add the first one\r\n if (authEndpoint.indexOf(\"?\") < 0) {\r\n authEndpoint += \"?\";\r\n } else {\r\n authEndpoint += \"&\";\r\n }\r\n\r\n let requestUrl: string = `${authEndpoint}${str.join(\"&\")}`;\r\n return requestUrl;\r\n }\r\n\r\n translateclientIdUsedInScope(scopes: Array): void {\r\n const clientIdIndex: number = scopes.indexOf(this.clientId);\r\n if (clientIdIndex >= 0) {\r\n scopes.splice(clientIdIndex, 1);\r\n if (scopes.indexOf(\"openid\") === -1) {\r\n scopes.push(\"openid\");\r\n }\r\n if (scopes.indexOf(\"profile\") === -1) {\r\n scopes.push(\"profile\");\r\n }\r\n }\r\n }\r\n\r\n parseScope(scopes: Array): string {\r\n let scopeList: string = \"\";\r\n if (scopes) {\r\n for (let i: number = 0; i < scopes.length; ++i) {\r\n scopeList += (i !== scopes.length - 1) ? scopes[i] + \" \" : scopes[i];\r\n }\r\n }\r\n\r\n return scopeList;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationRequestParameters.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ClientInfo {\r\n\r\n private _uid: string;\r\n get uid(): string {\r\n return this._uid ? this._uid : \"\";\r\n }\r\n\r\n set uid(uid: string) {\r\n this._uid = uid;\r\n }\r\n\r\n private _utid: string;\r\n get utid(): string {\r\n return this._utid ? this._utid : \"\";\r\n }\r\n\r\n set utid(utid: string) {\r\n this._utid = utid;\r\n }\r\n\r\n constructor(rawClientInfo: string) {\r\n if (!rawClientInfo || Utils.isEmpty(rawClientInfo)) {\r\n this.uid = \"\";\r\n this.utid = \"\";\r\n return;\r\n }\r\n\r\n try {\r\n const decodedClientInfo: string = Utils.base64DecodeStringUrlSafe(rawClientInfo);\r\n const clientInfo: ClientInfo = JSON.parse(decodedClientInfo);\r\n if (clientInfo) {\r\n if (clientInfo.hasOwnProperty(\"uid\")) {\r\n this.uid = clientInfo.uid;\r\n }\r\n\r\n if (clientInfo.hasOwnProperty(\"utid\")) {\r\n this.utid = clientInfo.utid;\r\n }\r\n }\r\n } catch (e) {\r\n throw new Error(e);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/ClientInfo.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class IdToken {\r\n\r\n issuer: string;\r\n objectId: string;\r\n subject: string;\r\n tenantId: string;\r\n version: string;\r\n preferredName: string;\r\n name: string;\r\n homeObjectId: string;\r\n nonce: string;\r\n expiration: string;\r\n rawIdToken: string;\r\n decodedIdToken: Object\r\n\r\n constructor(rawIdToken: string) {\r\n if (Utils.isEmpty(rawIdToken)) {\r\n throw new Error(\"null or empty raw idtoken\");\r\n }\r\n try {\r\n this.rawIdToken = rawIdToken;\r\n this.decodedIdToken = Utils.extractIdToken(rawIdToken);\r\n if (this.decodedIdToken) {\r\n if (this.decodedIdToken.hasOwnProperty(\"iss\")) {\r\n this.issuer = this.decodedIdToken[\"iss\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"oid\")) {\r\n this.objectId = this.decodedIdToken['oid'];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"sub\")) {\r\n this.subject = this.decodedIdToken[\"sub\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"tid\")) {\r\n this.tenantId = this.decodedIdToken[\"tid\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"ver\")) {\r\n this.version = this.decodedIdToken[\"ver\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"preferred_username\")) {\r\n this.preferredName = this.decodedIdToken[\"preferred_username\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"name\")) {\r\n this.name = this.decodedIdToken[\"name\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"nonce\")) {\r\n this.nonce = this.decodedIdToken[\"nonce\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"exp\")) {\r\n this.expiration = this.decodedIdToken[\"exp\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"home_oid\")) {\r\n this.homeObjectId = this.decodedIdToken[\"home_oid\"];\r\n }\r\n }\r\n } catch (e) {\r\n throw new Error(\"Failed to parse the returned id token\");\r\n }\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/IdToken.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Constants } from \"./Constants\";\r\nimport { AccessTokenCacheItem } from \"./AccessTokenCacheItem\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Storage {// Singleton\r\n\r\n private static _instance: Storage;\r\n private _localStorageSupported: boolean;\r\n private _sessionStorageSupported: boolean;\r\n private _cacheLocation: string;\r\n\r\n constructor(cacheLocation: string) {\r\n if (Storage._instance) {\r\n return Storage._instance;\r\n }\r\n\r\n this._cacheLocation = cacheLocation;\r\n this._localStorageSupported = typeof window[this._cacheLocation] !== \"undefined\" && window[this._cacheLocation] != null;\r\n this._sessionStorageSupported = typeof window[cacheLocation] !== \"undefined\" && window[cacheLocation] != null;\r\n Storage._instance = this;\r\n if (!this._localStorageSupported && !this._sessionStorageSupported) {\r\n throw new Error(\"localStorage and sessionStorage not supported\");\r\n }\r\n\r\n return Storage._instance;\r\n }\r\n\r\n // add value to storage\r\n setItem(key: string, value: string): void {\r\n if (window[this._cacheLocation]) {\r\n window[this._cacheLocation].setItem(key, value);\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n // get one item by key from storage\r\n getItem(key: string): string {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].getItem(key);\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n // remove value from storage\r\n removeItem(key: string): void {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].removeItem(key);\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n // clear storage (remove all items from it)\r\n clear(): void {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].clear();\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n getAllAccessTokens(clientId: string, userIdentifier: string): Array {\r\n const results: Array = [];\r\n let accessTokenCacheItem: AccessTokenCacheItem;\r\n const storage = window[this._cacheLocation];\r\n if (storage) {\r\n let key: string;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key)) {\r\n if (key.match(clientId) && key.match(userIdentifier)) {\r\n let value = this.getItem(key);\r\n if (value) {\r\n accessTokenCacheItem = new AccessTokenCacheItem(JSON.parse(key), JSON.parse(value));\r\n results.push(accessTokenCacheItem);\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n\r\n return results;\r\n }\r\n\r\n removeAcquireTokenEntries(acquireTokenUser: string, acquireTokenStatus: string): void {\r\n const storage = window[this._cacheLocation];\r\n if (storage) {\r\n let key: string;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key)) {\r\n if ((key.indexOf(acquireTokenUser) > -1) || (key.indexOf(acquireTokenStatus) > -1)) {\r\n this.removeItem(key);\r\n }\r\n }\r\n }\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n resetCacheItems(): void {\r\n const storage = window[this._cacheLocation];\r\n if (storage) {\r\n let key: string;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key) && key.indexOf(Constants.msal) !== -1) {\r\n storage[key] = \"\";\r\n }\r\n }\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Storage.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { AccessTokenKey } from \"./AccessTokenKey\";\r\nimport { AccessTokenValue } from \"./AccessTokenValue\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AccessTokenCacheItem {\r\n\r\n key: AccessTokenKey;\r\n value: AccessTokenValue;\r\n\r\n constructor(key: AccessTokenKey, value: AccessTokenValue) {\r\n this.key = key;\r\n this.value = value;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AccessTokenCacheItem.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class TokenResponse {\r\n valid: boolean;\r\n parameters: Object;\r\n stateMatch: boolean;\r\n stateResponse: string;\r\n requestType: string;\r\n\r\n constructor() {\r\n this.valid = false;\r\n this.parameters = {};\r\n this.stateMatch = false;\r\n this.stateResponse = \"\";\r\n this.requestType = \"unknown\";\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/RequestInfo.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nimport { Utils } from \"./Utils\";\r\nimport { AadAuthority } from \"./AadAuthority\";\r\nimport { B2cAuthority } from \"./B2cAuthority\";\r\nimport { Authority, AuthorityType } from \"./Authority\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\n\r\nexport class AuthorityFactory {\r\n /*\r\n * Parse the url and determine the type of authority\r\n */\r\n private static DetectAuthorityFromUrl(authorityUrl: string): AuthorityType {\r\n authorityUrl = Utils.CanonicalizeUri(authorityUrl);\r\n let components = Utils.GetUrlComponents(authorityUrl);\r\n let pathSegments = components.PathSegments;\r\n switch (pathSegments[0]) {\r\n case \"tfp\":\r\n return AuthorityType.B2C;\r\n case \"adfs\":\r\n return AuthorityType.Adfs;\r\n default:\r\n return AuthorityType.Aad;\r\n }\r\n }\r\n\r\n /*\r\n * Create an authority object of the correct type based on the url\r\n * Performs basic authority validation - checks to see if the authority is of a valid type (eg aad, b2c)\r\n */\r\n public static CreateInstance(authorityUrl: string, validateAuthority: boolean): Authority {\r\n let type = AuthorityFactory.DetectAuthorityFromUrl(authorityUrl);\r\n // Depending on above detection, create the right type.\r\n switch (type) {\r\n case AuthorityType.B2C:\r\n return new B2cAuthority(authorityUrl, validateAuthority);\r\n case AuthorityType.Aad:\r\n return new AadAuthority(authorityUrl, validateAuthority);\r\n default:\r\n throw ErrorMessage.invalidAuthorityType;\r\n }\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthorityFactory.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { AadAuthority } from \"./AadAuthority\";\r\nimport { Authority, AuthorityType } from \"./Authority\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class B2cAuthority extends AadAuthority {\r\n public constructor(authority: string, validateAuthority: boolean) {\r\n super(authority, validateAuthority);\r\n let urlComponents = Utils.GetUrlComponents(authority);\r\n\r\n let pathSegments = urlComponents.PathSegments;\r\n if (pathSegments.length < 3) {\r\n throw ErrorMessage.b2cAuthorityUriInvalidPath;\r\n }\r\n\r\n this.CanonicalAuthority = `https://${urlComponents.HostNameAndPort}/${pathSegments[0]}/${pathSegments[1]}/${pathSegments[2]}/`;\r\n }\r\n\r\n public get AuthorityType(): AuthorityType {\r\n return AuthorityType.B2C;\r\n }\r\n\r\n /*\r\n * Returns a promise with the TenantDiscoveryEndpoint\r\n */\r\n public GetOpenIdConfigurationEndpointAsync(): Promise {\r\n var resultPromise = new Promise((resolve, reject) =>\r\n resolve(this.DefaultOpenIdConfigurationEndpoint));\r\n\r\n if (!this.IsValidationEnabled) {\r\n return resultPromise;\r\n }\r\n\r\n if (this.IsInTrustedHostList(this.CanonicalAuthorityUrlComponents.HostNameAndPort)) {\r\n return resultPromise;\r\n }\r\n\r\n return new Promise((resolve, reject) =>\r\n reject(ErrorMessage.unsupportedAuthorityValidation));\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/B2cAuthority.ts"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap d90aed15687c4c619583","webpack:///./src/Utils.ts","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./src/Logger.ts","webpack:///./src/Authority.ts","webpack:///./src/ErrorMessage.ts","webpack:///./src/Constants.ts","webpack:///./src/User.ts","webpack:///./src/AadAuthority.ts","webpack:///./src/XHRClient.ts","webpack:///./src/index.ts","webpack:///./src/UserAgentApplication.ts","webpack:///./src/AccessTokenKey.ts","webpack:///./src/AccessTokenValue.ts","webpack:///./src/AuthenticationRequestParameters.ts","webpack:///./src/ClientInfo.ts","webpack:///./src/IdToken.ts","webpack:///./src/Storage.ts","webpack:///./src/AccessTokenCacheItem.ts","webpack:///./src/RequestInfo.ts","webpack:///./src/AuthorityFactory.ts","webpack:///./src/B2cAuthority.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;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C;QACvB,CAAC;QAED,MAAM,CAAC,IAAI,OAAO,CAAS,UAAC,OAAO,EAAE,MAAM;YACzC,aAAM,CAAC,2BAAY,CAAC,8BAA8B,CAAC;QAAnD,CAAmD,CAAC,CAAC;IACzD,CAAC;IACH,mBAAC;AAAD,CAAC,CAnCiC,2BAAY,GAmC7C;AAnCY,oCAAY","file":"msal.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Msal\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Msal\"] = factory();\n\telse\n\t\troot[\"Msal\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d90aed15687c4c619583","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { IUri } from \"./IUri\";\r\nimport { User } from \"./User\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Utils {\r\n static compareObjects(u1: User, u2: User): boolean {\r\n if (!u1 || !u2) {\r\n return false;\r\n }\r\n if (u1.userIdentifier && u2.userIdentifier) {\r\n if (u1.userIdentifier === u2.userIdentifier) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static expiresIn(expires: string): number {\r\n // if AAD did not send \"expires_in\" property, use default expiration of 3599 seconds, for some reason AAD sends 3599 as \"expires_in\" value instead of 3600\r\n if (!expires) {\r\n expires = \"3599\";\r\n }\r\n return this.now() + parseInt(expires, 10);\r\n }\r\n\r\n static now(): number {\r\n return Math.round(new Date().getTime() / 1000.0);\r\n }\r\n\r\n static isEmpty(str: string): boolean {\r\n return (typeof str === \"undefined\" || !str || 0 === str.length);\r\n }\r\n\r\n static extractIdToken(encodedIdToken: string): any {\r\n // id token will be decoded to get the username\r\n const decodedToken = this.decodeJwt(encodedIdToken);\r\n if (!decodedToken) {\r\n return null;\r\n }\r\n try {\r\n const base64IdToken = decodedToken.JWSPayload;\r\n const base64Decoded = this.base64DecodeStringUrlSafe(base64IdToken);\r\n if (!base64Decoded) {\r\n //this._requestContext.logger.info(\"The returned id_token could not be base64 url safe decoded.\");\r\n return null;\r\n }\r\n // ECMA script has JSON built-in support\r\n return JSON.parse(base64Decoded);\r\n } catch (err) {\r\n //this._requestContext.logger.error(\"The returned id_token could not be decoded\" + err);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n static base64EncodeStringUrlSafe(input: string): string {\r\n // html5 should support atob function for decoding\r\n if (window.btoa) {\r\n return window.btoa(input);\r\n }\r\n else {\r\n return this.encode(input);\r\n }\r\n }\r\n\r\n static base64DecodeStringUrlSafe(base64IdToken: string): string {\r\n // html5 should support atob function for decoding\r\n base64IdToken = base64IdToken.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n if (window.atob) {\r\n return decodeURIComponent(window.atob(base64IdToken)); // jshint ignore:line\r\n }\r\n else {\r\n return decodeURIComponent(this.decode(base64IdToken));\r\n }\r\n }\r\n\r\n static encode(input: string): string {\r\n const keyStr: string = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n let output = \"\";\r\n let chr1: number, chr2: number, chr3: number, enc1: number, enc2: number, enc3: number, enc4: number;\r\n var i = 0;\r\n\r\n input = this.utf8Encode(input);\r\n\r\n while (i < input.length) {\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n } else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n\r\n output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);\r\n }\r\n\r\n return output.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\r\n }\r\n\r\n static utf8Encode(input: string): string {\r\n input = input.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < input.length; n++) {\r\n var c = input.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n }\r\n\r\n return utftext;\r\n }\r\n\r\n static decode(base64IdToken: string): string {\r\n var codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n base64IdToken = String(base64IdToken).replace(/=+$/, \"\");\r\n var length = base64IdToken.length;\r\n if (length % 4 === 1) {\r\n throw new Error(\"The token to be decoded is not correctly encoded.\");\r\n }\r\n let h1: number, h2: number, h3: number, h4: number, bits: number, c1: number, c2: number, c3: number, decoded = \"\";\r\n for (var i = 0; i < length; i += 4) {\r\n //Every 4 base64 encoded character will be converted to 3 byte string, which is 24 bits\r\n // then 6 bits per base64 encoded character\r\n h1 = codes.indexOf(base64IdToken.charAt(i));\r\n h2 = codes.indexOf(base64IdToken.charAt(i + 1));\r\n h3 = codes.indexOf(base64IdToken.charAt(i + 2));\r\n h4 = codes.indexOf(base64IdToken.charAt(i + 3));\r\n // For padding, if last two are \"=\"\r\n if (i + 2 === length - 1) {\r\n bits = h1 << 18 | h2 << 12 | h3 << 6;\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n decoded += String.fromCharCode(c1, c2);\r\n break;\r\n }\r\n // if last one is \"=\"\r\n else if (i + 1 === length - 1) {\r\n bits = h1 << 18 | h2 << 12;\r\n c1 = bits >> 16 & 255;\r\n decoded += String.fromCharCode(c1);\r\n break;\r\n }\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n // then convert to 3 byte chars\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n c3 = bits & 255;\r\n decoded += String.fromCharCode(c1, c2, c3);\r\n }\r\n return decoded;\r\n }\r\n\r\n static decodeJwt(jwtToken: string): any {\r\n if (this.isEmpty(jwtToken)) {\r\n return null;\r\n }\r\n const idTokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n const matches = idTokenPartsRegex.exec(jwtToken);\r\n if (!matches || matches.length < 4) {\r\n //this._requestContext.logger.warn(\"The returned id_token is not parseable.\");\r\n return null;\r\n }\r\n const crackedToken = {\r\n header: matches[1],\r\n JWSPayload: matches[2],\r\n JWSSig: matches[3]\r\n };\r\n return crackedToken;\r\n }\r\n\r\n static deserialize(query: string): any {\r\n let match: Array; // Regex for replacing addition symbol with a space\r\n const pl = /\\+/g;\r\n const search = /([^&=]+)=([^&]*)/g;\r\n const decode = (s: string) => decodeURIComponent(s.replace(pl, \" \"));\r\n const obj: {} = {};\r\n match = search.exec(query);\r\n while (match) {\r\n obj[decode(match[1])] = decode(match[2]);\r\n match = search.exec(query);\r\n }\r\n return obj;\r\n }\r\n\r\n static isIntersectingScopes(cachedScopes: Array, scopes: Array): boolean {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n for (let i = 0; i < scopes.length; i++) {\r\n if (cachedScopes.indexOf(scopes[i].toLowerCase()) > -1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static containsScope(cachedScopes: Array, scopes: Array): boolean {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n return scopes.every((value: any): boolean => cachedScopes.indexOf(value.toString().toLowerCase()) >= 0);\r\n }\r\n\r\n static convertToLowerCase(scopes: Array): Array {\r\n return scopes.map(scope => scope.toLowerCase());\r\n }\r\n\r\n static removeElement(scopes: Array, scope: string): Array {\r\n return scopes.filter(value => value !== scope);\r\n }\r\n\r\n static decimalToHex(num: number): string {\r\n var hex: string = num.toString(16);\r\n while (hex.length < 2) {\r\n hex = \"0\" + hex;\r\n }\r\n return hex;\r\n }\r\n\r\n static getLibraryVersion(): string {\r\n return \"0.1.5\";\r\n }\r\n\r\n /*\r\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\r\n * @param href The url\r\n * @param tenantId The tenant id to replace\r\n */\r\n static replaceFirstPath(href: string, tenantId: string): string {\r\n var match = href.match(/^(https?\\:)\\/\\/(([^:\\/?#] *)(?:\\:([0-9]+))?)([\\/]{0,1}[^?#] *)(\\?[^#] *|)(#. *|)$/);\r\n if (match) {\r\n var urlObject = Utils.GetUrlComponents(href);\r\n var pathArray = urlObject.PathSegments;\r\n pathArray.shift();\r\n if (pathArray[0] && pathArray[0] === \"common\" || pathArray[0] === \"organizations\") {\r\n pathArray[0] = tenantId;\r\n href = urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + pathArray.join(\"/\");\r\n }\r\n }\r\n return href;\r\n }\r\n\r\n static createNewGuid(): string {\r\n // RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or\r\n // pseudo-random numbers.\r\n // The algorithm is as follows:\r\n // Set the two most significant bits (bits 6 and 7) of the\r\n // clock_seq_hi_and_reserved to zero and one, respectively.\r\n // Set the four most significant bits (bits 12 through 15) of the\r\n // time_hi_and_version field to the 4-bit version number from\r\n // Section 4.1.3. Version4\r\n // Set all the other bits to randomly (or pseudo-randomly) chosen\r\n // values.\r\n // UUID = time-low \"-\" time-mid \"-\"time-high-and-version \"-\"clock-seq-reserved and low(2hexOctet)\"-\" node\r\n // time-low = 4hexOctet\r\n // time-mid = 2hexOctet\r\n // time-high-and-version = 2hexOctet\r\n // clock-seq-and-reserved = hexOctet:\r\n // clock-seq-low = hexOctet\r\n // node = 6hexOctet\r\n // Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\r\n // y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10\r\n // y values are 8, 9, A, B\r\n\r\n const cryptoObj: Crypto = window.crypto; // for IE 11\r\n if (cryptoObj && cryptoObj.getRandomValues) {\r\n const buffer: Uint8Array = new Uint8Array(16);\r\n cryptoObj.getRandomValues(buffer);\r\n\r\n //buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).\r\n buffer[6] |= 0x40; //buffer[6] | 01000000 will set the 6 bit to 1.\r\n buffer[6] &= 0x4f; //buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = \"4\".\r\n\r\n //buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.\r\n buffer[8] |= 0x80; //buffer[8] | 10000000 will set the 7 bit to 1.\r\n buffer[8] &= 0xbf; //buffer[8] & 10111111 will set the 6 bit to 0.\r\n\r\n return Utils.decimalToHex(buffer[0]) + Utils.decimalToHex(buffer[1])\r\n + Utils.decimalToHex(buffer[2]) + Utils.decimalToHex(buffer[3])\r\n + \"-\" + Utils.decimalToHex(buffer[4]) + Utils.decimalToHex(buffer[5])\r\n + \"-\" + Utils.decimalToHex(buffer[6]) + Utils.decimalToHex(buffer[7])\r\n + \"-\" + Utils.decimalToHex(buffer[8]) + Utils.decimalToHex(buffer[9])\r\n + \"-\" + Utils.decimalToHex(buffer[10]) + Utils.decimalToHex(buffer[11])\r\n + Utils.decimalToHex(buffer[12]) + Utils.decimalToHex(buffer[13])\r\n + Utils.decimalToHex(buffer[14]) + Utils.decimalToHex(buffer[15]);\r\n }\r\n else {\r\n const guidHolder: string = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\";\r\n const hex: string = \"0123456789abcdef\";\r\n let r: number = 0;\r\n let guidResponse: string = \"\";\r\n for (let i: number = 0; i < 36; i++) {\r\n if (guidHolder[i] !== \"-\" && guidHolder[i] !== \"4\") {\r\n // each x and y needs to be random\r\n r = Math.random() * 16 | 0;\r\n }\r\n if (guidHolder[i] === \"x\") {\r\n guidResponse += hex[r];\r\n } else if (guidHolder[i] === \"y\") {\r\n // clock-seq-and-reserved first hex is filtered and remaining hex values are random\r\n r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??\r\n r |= 0x8; // set pos 3 to 1 as 1???\r\n guidResponse += hex[r];\r\n } else {\r\n guidResponse += guidHolder[i];\r\n }\r\n }\r\n return guidResponse;\r\n }\r\n }\r\n\r\n /*\r\n * Parses out the components from a url string.\r\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\r\n */\r\n static GetUrlComponents(url: string): IUri {\r\n if (!url) {\r\n throw \"Url required\";\r\n }\r\n\r\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\r\n var regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n\r\n var match = url.match(regEx);\r\n\r\n if (!match || match.length < 6) {\r\n throw \"Valid url required\";\r\n }\r\n\r\n let urlComponents = {\r\n Protocol: match[1],\r\n HostNameAndPort: match[4],\r\n AbsolutePath: match[5]\r\n };\r\n\r\n let pathSegments = urlComponents.AbsolutePath.split(\"/\");\r\n pathSegments = pathSegments.filter((val) => val && val.length > 0); // remove empty elements\r\n urlComponents.PathSegments = pathSegments;\r\n return urlComponents;\r\n }\r\n\r\n /*\r\n * Given a url or path, append a trailing slash if one doesnt exist\r\n */\r\n static CanonicalizeUri(url: string): string {\r\n if (url) {\r\n url = url.toLowerCase();\r\n }\r\n\r\n if (url && !Utils.endsWith(url, \"/\")) {\r\n url += \"/\";\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /*\r\n * Checks to see if the url ends with the suffix\r\n * Required because we are compiling for es5 instead of es6\r\n * @param url\r\n * @param str\r\n */\r\n static endsWith(url: string, suffix: string): boolean {\r\n if (!url || !suffix) {\r\n return false;\r\n }\r\n\r\n return url.indexOf(suffix, url.length - suffix.length) !== -1;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Utils.ts","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/tslib/tslib.es6.js\n// module id = 1\n// module chunks = 0 1","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\nexport interface ILoggerCallback {\r\n (level: LogLevel, message: string, containsPii: boolean): void;\r\n}\r\n\r\nexport enum LogLevel {\r\n Error,\r\n Warning,\r\n Info,\r\n Verbose\r\n}\r\n\r\nexport class Logger {// Singleton Class\r\n\r\n /*\r\n * @hidden\r\n */\r\n private static _instance: Logger;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _correlationId: string;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _level: LogLevel = LogLevel.Info;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _piiLoggingEnabled: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _localCallback: ILoggerCallback;\r\n\r\n constructor(localCallback: ILoggerCallback,\r\n options:\r\n {\r\n correlationId?: string,\r\n level?: LogLevel,\r\n piiLoggingEnabled?: boolean,\r\n } = {}) {\r\n const {\r\n correlationId = \"\",\r\n level = LogLevel.Info,\r\n piiLoggingEnabled = false\r\n } = options;\r\n\r\n this._localCallback = localCallback;\r\n this._correlationId = correlationId;\r\n this._level = level;\r\n this._piiLoggingEnabled = piiLoggingEnabled;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n private logMessage(logLevel: LogLevel, logMessage: string, containsPii: boolean): void {\r\n if ((logLevel > this._level) || (!this._piiLoggingEnabled && containsPii)) {\r\n return;\r\n }\r\n var timestamp = new Date().toUTCString();\r\n var log: string;\r\n if (!Utils.isEmpty(this._correlationId)) {\r\n log = timestamp + \":\" + this._correlationId + \"-\" + Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n else {\r\n log = timestamp + \":\" + Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n this.executeCallback(logLevel, log, containsPii);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n executeCallback(level: LogLevel, message: string, containsPii: boolean) {\r\n if (this._localCallback) {\r\n this._localCallback(level, message, containsPii);\r\n }\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n error(message: string): void {\r\n this.logMessage(LogLevel.Error, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n errorPii(message: string): void {\r\n this.logMessage(LogLevel.Error, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n warning(message: string): void {\r\n this.logMessage(LogLevel.Warning, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n warningPii(message: string): void {\r\n this.logMessage(LogLevel.Warning, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n info(message: string): void {\r\n this.logMessage(LogLevel.Info, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n infoPii(message: string): void {\r\n this.logMessage(LogLevel.Info, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n verbose(message: string): void {\r\n this.logMessage(LogLevel.Verbose, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n verbosePii(message: string): void {\r\n this.logMessage(LogLevel.Verbose, message, true);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Logger.ts","import { IUri } from \"./IUri\";\r\nimport { Utils } from \"./Utils\";\r\nimport { ITenantDiscoveryResponse } from \"./ITenantDiscoveryResponse\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\nimport { XhrClient } from \"./XHRClient\";\r\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport enum AuthorityType {\r\n Aad,\r\n Adfs,\r\n B2C\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport abstract class Authority {\r\n constructor(authority: string, validateAuthority: boolean) {\r\n this.IsValidationEnabled = validateAuthority;\r\n this.CanonicalAuthority = authority;\r\n\r\n this.validateAsUri();\r\n }\r\n\r\n public abstract get AuthorityType(): AuthorityType;\r\n\r\n public IsValidationEnabled: boolean;\r\n\r\n public get Tenant(): string {\r\n return this.CanonicalAuthorityUrlComponents.PathSegments[0];\r\n }\r\n\r\n private tenantDiscoveryResponse: ITenantDiscoveryResponse;\r\n\r\n public get AuthorizationEndpoint(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n public get EndSessionEndpoint(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.EndSessionEndpoint.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n public get SelfSignedJwtAudience(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.Issuer.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n private validateResolved() {\r\n if (!this.tenantDiscoveryResponse) {\r\n throw \"Please call ResolveEndpointsAsync first\";\r\n }\r\n }\r\n\r\n /*\r\n * A URL that is the authority set by the developer\r\n */\r\n public get CanonicalAuthority(): string {\r\n return this.canonicalAuthority;\r\n }\r\n\r\n public set CanonicalAuthority(url: string) {\r\n this.canonicalAuthority = Utils.CanonicalizeUri(url);\r\n this.canonicalAuthorityUrlComponents = null;\r\n }\r\n\r\n private canonicalAuthority: string;\r\n private canonicalAuthorityUrlComponents: IUri;\r\n\r\n public get CanonicalAuthorityUrlComponents(): IUri {\r\n if (!this.canonicalAuthorityUrlComponents) {\r\n this.canonicalAuthorityUrlComponents = Utils.GetUrlComponents(this.CanonicalAuthority);\r\n }\r\n\r\n return this.canonicalAuthorityUrlComponents;\r\n }\r\n\r\n /*\r\n * // http://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\r\n */\r\n protected get DefaultOpenIdConfigurationEndpoint(): string {\r\n return `${this.CanonicalAuthority}v2.0/.well-known/openid-configuration`;\r\n }\r\n\r\n /*\r\n * Given a string, validate that it is of the form https://domain/path\r\n */\r\n private validateAsUri() {\r\n let components;\r\n try {\r\n components = this.CanonicalAuthorityUrlComponents;\r\n } catch (e) {\r\n throw ErrorMessage.invalidAuthorityType;\r\n }\r\n\r\n if (!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\r\n throw ErrorMessage.authorityUriInsecure;\r\n }\r\n\r\n if (!components.PathSegments || components.PathSegments.length < 1) {\r\n throw ErrorMessage.authorityUriInvalidPath;\r\n }\r\n }\r\n\r\n /*\r\n * Calls the OIDC endpoint and returns the response\r\n */\r\n private DiscoverEndpoints(openIdConfigurationEndpoint: string): Promise {\r\n let client = new XhrClient();\r\n return client.sendRequestAsync(openIdConfigurationEndpoint, \"GET\", /*enableCaching: */ true)\r\n .then((response: any) => {\r\n return {\r\n AuthorizationEndpoint: response.authorization_endpoint,\r\n EndSessionEndpoint: response.end_session_endpoint,\r\n Issuer: response.issuer\r\n };\r\n });\r\n }\r\n\r\n /*\r\n * Returns a promise.\r\n * Checks to see if the authority is in the cache\r\n * Discover endpoints via openid-configuration\r\n * If successful, caches the endpoint for later use in OIDC\r\n */\r\n public ResolveEndpointsAsync(): Promise {\r\n let openIdConfigurationEndpoint = \"\";\r\n return this.GetOpenIdConfigurationEndpointAsync().then(openIdConfigurationEndpointResponse => {\r\n openIdConfigurationEndpoint = openIdConfigurationEndpointResponse;\r\n return this.DiscoverEndpoints(openIdConfigurationEndpoint);\r\n }).then((tenantDiscoveryResponse: ITenantDiscoveryResponse) => {\r\n this.tenantDiscoveryResponse = tenantDiscoveryResponse;\r\n return this;\r\n });\r\n }\r\n\r\n /*\r\n * Returns a promise with the TenantDiscoveryEndpoint\r\n */\r\n public abstract GetOpenIdConfigurationEndpointAsync(): Promise;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Authority.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorMessage {\r\n static get authorityUriInvalidPath(): string { return \"AuthorityUriInvalidPath\"; }\r\n static get authorityUriInsecure(): string { return \"AuthorityUriInsecure\"; }\r\n static get invalidAuthorityType(): string { return \"InvalidAuthorityType\"; }\r\n static get unsupportedAuthorityValidation(): string { return \"UnsupportedAuthorityValidation\"; }\r\n static get b2cAuthorityUriInvalidPath(): string { return \"B2cAuthorityUriInvalidPath\"; }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/ErrorMessage.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Constants {\r\n static get errorDescription(): string { return \"error_description\"; }\r\n static get error(): string { return \"error\"; }\r\n static get scope(): string { return \"scope\"; }\r\n static get acquireTokenUser(): string { return \"msal_acquireTokenUser\"; }\r\n static get clientInfo(): string { return \"client_info\"; }\r\n static get clientId(): string { return \"clientId\"; }\r\n static get authority(): string { return \"authority\"; }\r\n static get idToken(): string { return \"id_token\"; }\r\n static get accessToken(): string { return \"access_token\"; }\r\n static get expiresIn(): string { return \"expires_in\"; }\r\n static get sessionState(): string { return \"session_state\"; }\r\n static get msalClientInfo(): string { return \"msal.client.info\"; }\r\n static get msalError(): string { return \"msal.error\"; }\r\n static get msalErrorDescription(): string { return \"msal.error.description\"; }\r\n static get msalSessionState(): string { return \"msal.session.state\"; }\r\n static get tokenKeys(): string { return \"msal.token.keys\"; }\r\n static get accessTokenKey(): string { return \"msal.access.token.key\"; }\r\n static get expirationKey(): string { return \"msal.expiration.key\"; }\r\n static get stateLogin(): string { return \"msal.state.login\"; }\r\n static get stateAcquireToken(): string { return \"msal.state.acquireToken\"; }\r\n static get stateRenew(): string { return \"msal.state.renew\"; }\r\n static get nonceIdToken(): string { return \"msal.nonce.idtoken\"; }\r\n static get userName(): string { return \"msal.username\"; }\r\n static get idTokenKey(): string { return \"msal.idtoken\"; }\r\n static get loginRequest(): string { return \"msal.login.request\"; }\r\n static get loginError(): string { return \"msal.login.error\"; }\r\n static get renewStatus(): string { return \"msal.token.renew.status\"; }\r\n static get msal(): string { return \"msal\"; }\r\n static get resourceDelimeter(): string { return \"|\"; }\r\n static get tokenRenewStatusCancelled(): string { return \"Canceled\"; }\r\n static get tokenRenewStatusCompleted(): string { return \"Completed\"; }\r\n static get tokenRenewStatusInProgress(): string { return \"In Progress\"; }\r\n private static _popUpWidth: number = 483;\r\n static get popUpWidth(): number { return this._popUpWidth; }\r\n static set popUpWidth(width: number) {\r\n this._popUpWidth = width;\r\n }\r\n private static _popUpHeight: number = 600;\r\n static get popUpHeight(): number { return this._popUpHeight; }\r\n static set popUpHeight(height: number) {\r\n this._popUpHeight = height;\r\n }\r\n static get login(): string { return \"LOGIN\"; }\r\n static get renewToken(): string { return \"renewToken\"; }\r\n static get unknown(): string { return \"UNKNOWN\"; }\r\n static get urlHash(): string { return \"msal.urlHash\"; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorCodes {\r\n static get loginProgressError(): string { return \"login_progress_error\"; }\r\n static get acquireTokenProgressError(): string { return \"acquiretoken_progress_error\"; }\r\n static get inputScopesError(): string { return \"input_scopes_error\"; }\r\n static get endpointResolutionError(): string { return \"endpoints_resolution_error\"; }\r\n static get popUpWindowError(): string { return \"popup_window_error\"; }\r\n static get userLoginError(): string { return \"user_login_error\"; }\r\n static get userCancelledError(): string { return \"user_cancelled\"; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorDescription {\r\n static get loginProgressError(): string { return \"Login is in progress\"; }\r\n static get acquireTokenProgressError(): string { return \"Acquire token is in progress\"; }\r\n static get inputScopesError(): string { return \"Invalid value of input scopes provided\"; }\r\n static get endpointResolutionError(): string { return \"Endpoints cannot be resolved\"; }\r\n static get popUpWindowError(): string { return \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"; }\r\n static get userLoginError(): string { return \"User login is required\"; }\r\n static get userCancelledError(): string { return \"User closed the popup window window and cancelled the flow\"; }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Constants.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { Utils } from \"./Utils\";\r\n\r\nexport class User {\r\n\r\n displayableId: string;\r\n name: string;\r\n identityProvider: string;\r\n userIdentifier: string;\r\n idToken: Object\r\n\r\n /*\r\n * @hidden\r\n */\r\n constructor(displayableId: string, name: string, identityProvider: string, userIdentifier: string, idToken:Object) {\r\n this.displayableId = displayableId;\r\n this.name = name;\r\n this.identityProvider = identityProvider;\r\n this.userIdentifier = userIdentifier;\r\n this.idToken = idToken;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n static createUser(idToken: IdToken, clientInfo: ClientInfo, authority: string): User {\r\n let uid: string;\r\n let utid: string;\r\n if (!clientInfo) {\r\n uid = \"\";\r\n utid = \"\";\r\n }\r\n else {\r\n uid = clientInfo.uid;\r\n utid = clientInfo.utid;\r\n }\r\n\r\n const userIdentifier = Utils.base64EncodeStringUrlSafe(uid) + \".\" + Utils.base64EncodeStringUrlSafe(utid);\r\n return new User(idToken.preferredName, idToken.name, idToken.issuer, userIdentifier, idToken.decodedIdToken);\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/User.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Authority, AuthorityType } from \"./Authority\";\r\nimport { XhrClient } from \"./XHRClient\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class AadAuthority extends Authority {\r\n private static readonly AadInstanceDiscoveryEndpoint: string = \"https://login.microsoftonline.com/common/discovery/instance\";\r\n\r\n private get AadInstanceDiscoveryEndpointUrl(): string {\r\n return `${AadAuthority.AadInstanceDiscoveryEndpoint}?api-version=1.0&authorization_endpoint=${this.CanonicalAuthority}oauth2/v2.0/authorize`;\r\n }\r\n\r\n public constructor(authority: string, validateAuthority: boolean) {\r\n super(authority, validateAuthority);\r\n }\r\n\r\n public get AuthorityType(): AuthorityType {\r\n return AuthorityType.Aad;\r\n }\r\n\r\n private static readonly TrustedHostList: any = {\r\n \"login.windows.net\": \"login.windows.net\",\r\n \"login.chinacloudapi.cn\": \"login.chinacloudapi.cn\",\r\n \"login.cloudgovapi.us\": \"login.cloudgovapi.us\",\r\n \"login.microsoftonline.com\": \"login.microsoftonline.com\",\r\n \"login.microsoftonline.de\": \"login.microsoftonline.de\",\r\n \"login.microsoftonline.us\": \"login.microsoftonline.us\"\r\n };\r\n\r\n /**\r\n * Returns a promise which resolves to the OIDC endpoint\r\n * Only responds with the endpoint\r\n */\r\n public GetOpenIdConfigurationEndpointAsync(): Promise {\r\n var resultPromise: Promise = new Promise((resolve, reject) =>\r\n resolve(this.DefaultOpenIdConfigurationEndpoint));\r\n\r\n if (!this.IsValidationEnabled) {\r\n return resultPromise;\r\n }\r\n\r\n let host: string = this.CanonicalAuthorityUrlComponents.HostNameAndPort;\r\n if (this.IsInTrustedHostList(host)) {\r\n return resultPromise;\r\n }\r\n\r\n let client: XhrClient = new XhrClient();\r\n\r\n return client.sendRequestAsync(this.AadInstanceDiscoveryEndpointUrl, \"GET\", true)\r\n .then((response) => {\r\n return response.tenant_discovery_endpoint;\r\n });\r\n }\r\n\r\n /**\r\n * Checks to see if the host is in a list of trusted hosts\r\n * @param {string} The host to look up\r\n */\r\n public IsInTrustedHostList(host: string): boolean {\r\n return AadAuthority.TrustedHostList[host.toLowerCase()];\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AadAuthority.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * XHR client for JSON endpoints\r\n * https://www.npmjs.com/package/async-promise\r\n * @hidden\r\n */\r\nexport class XhrClient {\r\n public sendRequestAsync(url: string, method: string, enableCaching?: boolean): Promise {\r\n return new Promise((resolve, reject) => {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url, /*async: */ true);\r\n if (enableCaching) {\r\n // TODO: (shivb) ensure that this can be cached\r\n // xhr.setRequestHeader(\"Cache-Control\", \"Public\");\r\n }\r\n\r\n xhr.onload = (ev) => {\r\n if (xhr.status < 200 || xhr.status >= 300) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n\r\n try {\r\n var jsonResponse = JSON.parse(xhr.responseText);\r\n } catch (e) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n\r\n resolve(jsonResponse);\r\n };\r\n\r\n xhr.onerror = (ev) => {\r\n reject(xhr.status);\r\n };\r\n\r\n if (method === \"GET\") {\r\n xhr.send();\r\n }\r\n else {\r\n throw \"not implemented\";\r\n }\r\n });\r\n }\r\n\r\n protected handleError(responseText: string): any {\r\n var jsonResponse;\r\n try {\r\n jsonResponse = JSON.parse(responseText);\r\n if (jsonResponse.error) {\r\n return jsonResponse.error;\r\n } else {\r\n throw responseText;\r\n }\r\n } catch (e) {\r\n return responseText;\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/XHRClient.ts","export { UserAgentApplication } from \"./UserAgentApplication\";\r\nexport { Logger } from \"./Logger\";\r\nexport { LogLevel } from \"./Logger\";\r\nexport { User } from \"./User\";\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { AccessTokenCacheItem } from \"./AccessTokenCacheItem\";\r\nimport { AccessTokenKey } from \"./AccessTokenKey\";\r\nimport { AccessTokenValue } from \"./AccessTokenValue\";\r\nimport { AuthenticationRequestParameters } from \"./AuthenticationRequestParameters\";\r\nimport { Authority } from \"./Authority\";\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { Constants, ErrorCodes, ErrorDescription } from \"./Constants\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { Logger } from \"./Logger\";\r\nimport { Storage } from \"./Storage\";\r\nimport { TokenResponse } from \"./RequestInfo\";\r\nimport { User } from \"./User\";\r\nimport { Utils } from \"./Utils\";\r\nimport { AuthorityFactory } from \"./AuthorityFactory\";\r\n\r\ndeclare global {\r\n interface Window {\r\n msal: Object;\r\n callBackMappedToRenewStates: Object;\r\n callBacksMappedToRenewStates: Object; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nlet ResponseTypes = {\r\n id_token: \"id_token\",\r\n token: \"token\",\r\n id_token_token: \"id_token token\"\r\n};\r\n\r\n/*\r\n * @hidden\r\n */\r\ninterface CacheResult {\r\n errorDesc: string;\r\n token: string;\r\n error: string;\r\n}\r\n\r\n/*\r\n * A type alias of for a tokenReceivedCallback function.\r\n * @param tokenReceivedCallback.errorDesc error description returned from the STS if API call fails.\r\n * @param tokenReceivedCallback.token token returned from STS if token request is successful.\r\n * @param tokenReceivedCallback.error error code returned from the STS if API call fails.\r\n * @param tokenReceivedCallback.tokenType tokenType returned from the STS if API call is successful. Possible values are: id_token OR access_token.\r\n */\r\nexport type tokenReceivedCallback = (errorDesc: string, token: string, error: string, tokenType: string) => void;\r\nconst resolveTokenOnlyIfOutOfIframe = (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n const tokenAcquisitionMethod = descriptor.value;\r\n descriptor.value = function (...args: any[]) {\r\n return this.isInIframe()\r\n ? new Promise(() => { })\r\n : tokenAcquisitionMethod.apply(this, args);\r\n };\r\n return descriptor;\r\n};\r\nexport class UserAgentApplication {\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheLocations = {\r\n localStorage: \"localStorage\",\r\n sessionStorage: \"sessionStorage\"\r\n };\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheLocation: string;\r\n\r\n /*\r\n * Used to get the cache location\r\n */\r\n get cacheLocation(): string {\r\n return this._cacheLocation;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _logger: Logger;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _loginInProgress: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _acquireTokenInProgress: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _renewStates: Array;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _activeRenewals: Object;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _clockSkew = 300;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheStorage: Storage;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _tokenReceivedCallback: tokenReceivedCallback = null;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _user: User;\r\n\r\n /*\r\n * Client ID assigned to your app by Azure Active Directory.\r\n */\r\n clientId: string;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private authorityInstance: Authority;\r\n\r\n /*\r\n * Used to set the authority.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n */\r\n public set authority(val) {\r\n this.authorityInstance = AuthorityFactory.CreateInstance(val, this.validateAuthority);\r\n }\r\n\r\n /*\r\n * Used to get the authority.\r\n */\r\n public get authority(): string {\r\n return this.authorityInstance.CanonicalAuthority;\r\n }\r\n\r\n /*\r\n * Used to turn authority validation on/off.\r\n * When set to true (default), MSAL will compare the application\"s authority against well-known URLs templates representing well-formed authorities. It is useful when the authority is obtained at run time to prevent MSAL from displaying authentication prompts from malicious pages.\r\n */\r\n validateAuthority: boolean;\r\n\r\n /*\r\n * The redirect URI of the application, this should be same as the value in the application registration portal.\r\n * Defaults to `window.location.href`.\r\n */\r\n private _redirectUri: string;\r\n\r\n /*\r\n * Used to redirect the user to this location after logout.\r\n * Defaults to `window.location.href`.\r\n */\r\n private _postLogoutredirectUri: string;\r\n\r\n /*\r\n * Used to keep track of opened popup windows.\r\n */\r\n private _openedWindows: Array;\r\n\r\n /*\r\n * Used to track the authentication request.\r\n */\r\n private _requestType: string;\r\n\r\n loadFrameTimeout: number;\r\n\r\n private _navigateToLoginRequestUrl: boolean;\r\n\r\n /*\r\n * Initialize a UserAgentApplication with a given clientId and authority.\r\n * @constructor\r\n * @param {string} clientId - The clientID of your application, you should get this from the application registration portal.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<instance>/<tenant>,\\ where <instance> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenantId>/<policyName>/\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param _tokenReceivedCallback - The function that will get the call back once this API is completed (either successfully or with a failure).\r\n * @param {boolean} validateAuthority - boolean to turn authority validation on/off.\r\n */\r\n constructor(\r\n clientId: string,\r\n authority: string | null,\r\n tokenReceivedCallback: tokenReceivedCallback,\r\n options:\r\n {\r\n validateAuthority?: boolean,\r\n cacheLocation?: string,\r\n redirectUri?: string,\r\n postLogoutRedirectUri?: string,\r\n logger?: Logger,\r\n loadFrameTimeout?: number,\r\n navigateToLoginRequestUrl?: boolean,\r\n } = {}) {\r\n const {\r\n validateAuthority = true,\r\n cacheLocation = \"sessionStorage\",\r\n redirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0],\r\n postLogoutRedirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0],\r\n logger = new Logger(null),\r\n loadFrameTimeout = 6000,\r\n navigateToLoginRequestUrl = true\r\n } = options;\r\n\r\n this.loadFrameTimeout = loadFrameTimeout;\r\n this.clientId = clientId;\r\n this.validateAuthority = validateAuthority;\r\n this.authority = authority || \"https://login.microsoftonline.com/common\";\r\n this._tokenReceivedCallback = tokenReceivedCallback;\r\n this._redirectUri = redirectUri;\r\n this._postLogoutredirectUri = postLogoutRedirectUri;\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n this._renewStates = [];\r\n this._activeRenewals = {};\r\n this._cacheLocation = cacheLocation;\r\n this._navigateToLoginRequestUrl = navigateToLoginRequestUrl;\r\n if (!this._cacheLocations[cacheLocation]) {\r\n throw new Error(\"Cache Location is not valid. Provided value:\" + this._cacheLocation + \".Possible values are: \" + this._cacheLocations.localStorage + \", \" + this._cacheLocations.sessionStorage);\r\n }\r\n\r\n this._cacheStorage = new Storage(this._cacheLocation); //cache keys msal\r\n this._logger = logger;\r\n this._openedWindows = [];\r\n window.msal = this;\r\n window.callBackMappedToRenewStates = {};\r\n window.callBacksMappedToRenewStates = {};\r\n var urlHash = window.location.hash;\r\n var isCallback = this.isCallback(urlHash);\r\n \r\n if (isCallback) {\r\n this.handleAuthenticationResponse.call(this, urlHash);\r\n }\r\n else {\r\n var pendingCallback = this._cacheStorage.getItem(Constants.urlHash);\r\n if (pendingCallback) {\r\n this.processCallBack(pendingCallback);\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * Used to call the constructor callback with the token/error\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n * @hidden\r\n */\r\n private processCallBack(hash: string): void {\r\n this._logger.info('Processing the callback from redirect response');\r\n const requestInfo = this.getRequestInfo(hash);\r\n this.saveTokenFromHash(requestInfo);\r\n const token = requestInfo.parameters[Constants.accessToken] || requestInfo.parameters[Constants.idToken];\r\n const errorDesc = requestInfo.parameters[Constants.errorDescription];\r\n const error = requestInfo.parameters[Constants.error];\r\n var tokenType: string;\r\n\r\n if (requestInfo.parameters[Constants.accessToken]) {\r\n tokenType = Constants.accessToken;\r\n }\r\n else {\r\n tokenType = Constants.idToken;\r\n }\r\n\r\n this._cacheStorage.removeItem(Constants.urlHash);\r\n\r\n try {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback.call(this, errorDesc, token, error, tokenType);\r\n }\r\n\r\n } catch (err) {\r\n this._logger.error(\"Error occurred in token received callback function: \" + err);\r\n }\r\n }\r\n\r\n \r\n /*\r\n * Initiate the login process by redirecting the user to the STS authorization endpoint.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the authentication server during the interactive authentication flow.\r\n */\r\n loginRedirect(scopes?: Array, extraQueryParameters?: string): void {\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n if (this._loginInProgress) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(\"Login is in progress\", null, null, Constants.idToken);\r\n return;\r\n }\r\n }\r\n\r\n if (scopes) {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(isValidScope, null, null, Constants.idToken);\r\n return;\r\n }\r\n }\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n this.authorityInstance.ResolveEndpointsAsync()\r\n .then(() => {\r\n const authenticationRequest = new AuthenticationRequestParameters(this.authorityInstance, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.loginRequest, window.location.href);\r\n this._cacheStorage.setItem(Constants.loginError, \"\");\r\n this._cacheStorage.setItem(Constants.stateLogin, authenticationRequest.state);\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, this.authority);\r\n }\r\n\r\n const urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n this._loginInProgress = true;\r\n this._requestType = Constants.login;\r\n this.promptUser(urlNavigate);\r\n });\r\n }\r\n\r\n /*\r\n * Initiate the login process by opening a popup window.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the interactive authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the token or error.\r\n */\r\n loginPopup(scopes: Array, extraQueryParameters?: string): Promise {\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n return new Promise((resolve, reject) => {\r\n if (this._loginInProgress) {\r\n reject(ErrorCodes.loginProgressError + \":\" + ErrorDescription.loginProgressError);\r\n return;\r\n }\r\n\r\n if (scopes) {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n reject(ErrorCodes.inputScopesError + \":\" + ErrorDescription.inputScopesError);\r\n return;\r\n }\r\n\r\n scopes = this.filterScopes(scopes);\r\n }\r\n else {\r\n scopes = [this.clientId];\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n var popUpWindow = this.openWindow(\"about:blank\", \"_blank\", 1, this, resolve, reject);\r\n if (!popUpWindow) {\r\n return;\r\n }\r\n\r\n this.authorityInstance.ResolveEndpointsAsync().then(() => {\r\n const authenticationRequest = new AuthenticationRequestParameters(this.authorityInstance, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.loginRequest, window.location.href);\r\n this._cacheStorage.setItem(Constants.loginError, \"\");\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, this.authority);\r\n }\r\n\r\n const urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._requestType = Constants.login;\r\n this._loginInProgress = true;\r\n if (popUpWindow) {\r\n this._logger.infoPii(\"Navigated Popup window to:\" + urlNavigate);\r\n popUpWindow.location.href = urlNavigate;\r\n }\r\n\r\n }, () => {\r\n this._logger.info(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.endpointResolutionError);\r\n if (reject) {\r\n reject(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n }\r\n\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n });\r\n });\r\n }\r\n\r\n /*\r\n * Used to redirect the browser to the STS authorization endpoint\r\n * @param {string} urlNavigate - URL of the authorization endpoint\r\n * @hidden\r\n */\r\n private promptUser(urlNavigate: string) {\r\n if (urlNavigate && !Utils.isEmpty(urlNavigate)) {\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n window.location.replace(urlNavigate);\r\n } else {\r\n this._logger.info(\"Navigate url is empty\");\r\n }\r\n }\r\n\r\n /*\r\n * Used to send the user to the redirect_uri after authentication is complete. The user\"s bearer token is attached to the URI fragment as an id_token/access_token field.\r\n * This function also closes the popup window after redirection.\r\n * @hidden\r\n * @ignore\r\n */\r\n private openWindow(urlNavigate: string, title: string, interval: number, instance: this, resolve?: Function, reject?: Function): Window {\r\n var popupWindow = this.openPopup(urlNavigate, title, Constants.popUpWidth, Constants.popUpHeight);\r\n if (popupWindow == null) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n this._logger.info(ErrorCodes.popUpWindowError + \":\" + ErrorDescription.popUpWindowError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.popUpWindowError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.popUpWindowError);\r\n if (reject) {\r\n reject(ErrorCodes.popUpWindowError + \":\" + ErrorDescription.popUpWindowError);\r\n }\r\n return null;\r\n }\r\n\r\n this._openedWindows.push(popupWindow);\r\n var pollTimer = window.setInterval(() => {\r\n if (popupWindow && popupWindow.closed && instance._loginInProgress) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n if (reject) {\r\n reject(ErrorCodes.userCancelledError + \":\" + ErrorDescription.userCancelledError);\r\n }\r\n window.clearInterval(pollTimer);\r\n }\r\n\r\n try {\r\n var popUpWindowLocation = popupWindow.location;\r\n if (popUpWindowLocation.href.indexOf(this._redirectUri) !== -1) {\r\n window.clearInterval(pollTimer);\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n this._logger.info(\"Closing popup window\");\r\n }\r\n } catch (e) {\r\n //Cross Domain url check error. Will be thrown until AAD redirects the user back to the app\"s root page with the token. No need to log or throw this error as it will create unnecessary traffic.\r\n }\r\n },\r\n interval);\r\n\r\n return popupWindow;\r\n }\r\n\r\n /*\r\n * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Defaults behaviour is to redirect the user to `window.location.href`.\r\n */\r\n logout(): void {\r\n this.clearCache();\r\n this._user = null;\r\n let logout = \"\";\r\n if (this._postLogoutredirectUri) {\r\n logout = \"post_logout_redirect_uri=\" + encodeURIComponent(this._postLogoutredirectUri);\r\n }\r\n\r\n const urlNavigate = this.authority + \"/oauth2/v2.0/logout?\" + logout;\r\n this.promptUser(urlNavigate);\r\n }\r\n\r\n /*\r\n * Used to configure the popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n private clearCache(): void {\r\n this._renewStates = [];\r\n const accessTokenItems = this._cacheStorage.getAllAccessTokens(Constants.clientId, Constants.authority);\r\n for (let i = 0; i < accessTokenItems.length; i++) {\r\n this._cacheStorage.removeItem(JSON.stringify(accessTokenItems[i].key));\r\n }\r\n\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.acquireTokenUser, Constants.renewStatus);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.authority + Constants.resourceDelimeter, Constants.renewStatus);\r\n this._cacheStorage.resetCacheItems();\r\n }\r\n\r\n /*\r\n * Configures popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n private openPopup(urlNavigate: string, title: string, popUpWidth: number, popUpHeight: number) {\r\n try {\r\n /*\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n const winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /*\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n const height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n const left = ((width / 2) - (popUpWidth / 2)) + winLeft;\r\n const top = ((height / 2) - (popUpHeight / 2)) + winTop;\r\n\r\n const popupWindow = window.open(urlNavigate, title, \"width=\" + popUpWidth + \", height=\" + popUpHeight + \", top=\" + top + \", left=\" + left);\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n\r\n return popupWindow;\r\n } catch (e) {\r\n this._logger.error(\"error opening popup \" + e.message);\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n return null;\r\n }\r\n }\r\n\r\n /*\r\n * Used to validate the scopes input parameter requested by the developer.\r\n * @param {Array} scopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @ignore\r\n * @hidden\r\n */\r\n private validateInputScope(scopes: Array): string {\r\n if (!scopes || scopes.length < 1) {\r\n return \"Scopes cannot be passed as an empty array\";\r\n }\r\n\r\n if (!Array.isArray(scopes)) {\r\n throw new Error(\"API does not accept non-array scopes\");\r\n }\r\n\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n if (scopes.length > 1) {\r\n return \"ClientId can only be provided as a single scope\";\r\n }\r\n }\r\n return \"\";\r\n }\r\n\r\n /*\r\n * Used to remove openid and profile from the list of scopes passed by the developer.These scopes are added by default\r\n * @hidden\r\n */\r\n private filterScopes(scopes: Array): Array {\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"openid\";\r\n });\r\n\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"profile\";\r\n });\r\n\r\n return scopes;\r\n }\r\n /*\r\n * Used to add the developer requested callback to the array of callbacks for the specified scopes. The updated array is stored on the window object\r\n * @param {string} scope - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} expectedState - Unique state identifier (guid).\r\n * @param {Function} resolve - The resolve function of the promise object.\r\n * @param {Function} reject - The reject function of the promise object.\r\n * @ignore\r\n * @hidden\r\n */\r\n private registerCallback(expectedState: string, scope: string, resolve: Function, reject: Function): void {\r\n this._activeRenewals[scope] = expectedState;\r\n if (!window.callBacksMappedToRenewStates[expectedState]) {\r\n window.callBacksMappedToRenewStates[expectedState] = [];\r\n }\r\n window.callBacksMappedToRenewStates[expectedState].push({ resolve: resolve, reject: reject });\r\n if (!window.callBackMappedToRenewStates[expectedState]) {\r\n window.callBackMappedToRenewStates[expectedState] =\r\n (errorDesc: string, token: string, error: string, tokenType: string) => {\r\n this._activeRenewals[scope] = null;\r\n for (let i = 0; i < window.callBacksMappedToRenewStates[expectedState].length; ++i) {\r\n try {\r\n if (errorDesc || error) {\r\n window.callBacksMappedToRenewStates[expectedState][i].reject(errorDesc + \": \" + error);\r\n }\r\n else if (token) {\r\n window.callBacksMappedToRenewStates[expectedState][i].resolve(token);\r\n }\r\n } catch (e) {\r\n this._logger.warning(e);\r\n }\r\n }\r\n window.callBacksMappedToRenewStates[expectedState] = null;\r\n window.callBackMappedToRenewStates[expectedState] = null;\r\n };\r\n }\r\n }\r\n\r\n /*\r\n * Used to get token for the specified set of scopes from the cache\r\n * @param {AuthenticationRequestParameters} authenticationRequest - Request sent to the STS to obtain an id_token/access_token\r\n * @param {User} user - User for which the scopes were requested\r\n * @hidden\r\n */\r\n private getCachedToken(authenticationRequest: AuthenticationRequestParameters, user: User): CacheResult {\r\n let accessTokenCacheItem: AccessTokenCacheItem = null;\r\n const scopes = authenticationRequest.scopes;\r\n const tokenCacheItems = this._cacheStorage.getAllAccessTokens(this.clientId, user.userIdentifier); //filter by clientId and user\r\n if (tokenCacheItems.length === 0) { // No match found after initial filtering\r\n return null;\r\n }\r\n\r\n const filteredItems: Array = [];\r\n //if no authority passed\r\n if (!authenticationRequest.authority) {\r\n //filter by scope\r\n for (let i = 0; i < tokenCacheItems.length; i++) {\r\n const cacheItem = tokenCacheItems[i];\r\n const cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils.containsScope(cachedScopes, scopes)) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n\r\n //if only one cached token found\r\n if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n\r\n authenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(accessTokenCacheItem.key.authority, this.validateAuthority);\r\n }\r\n else if (filteredItems.length > 1) {\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n else {\r\n //no match found. check if there was a single authority used\r\n const authorityList = this.getUniqueAuthority(tokenCacheItems, \"authority\");\r\n if (authorityList.length > 1) {\r\n return {\r\n errorDesc: \"Multiple authorities found in the cache. Pass authority in the API overload.\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n\r\n authenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(authorityList[0], this.validateAuthority);\r\n }\r\n }\r\n else {\r\n //authority was passed in the API, filter by authority and scope\r\n for (let i = 0; i < tokenCacheItems.length; i++) {\r\n const cacheItem = tokenCacheItems[i];\r\n const cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils.containsScope(cachedScopes, scopes) && cacheItem.key.authority === authenticationRequest.authority) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n\r\n //no match\r\n if (filteredItems.length === 0) {\r\n return null;\r\n }\r\n //only one cachedToken Found\r\n else if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n }\r\n else {\r\n //more than one match found.\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements.Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n }\r\n\r\n if (accessTokenCacheItem != null) {\r\n const expired = Number(accessTokenCacheItem.value.expiresIn);\r\n // If expiration is within offset, it will force renew\r\n const offset = this._clockSkew || 300;\r\n if (expired && (expired > Utils.now() + offset)) {\r\n return {\r\n errorDesc: null,\r\n token: accessTokenCacheItem.value.accessToken,\r\n error: null\r\n };\r\n } else {\r\n this._cacheStorage.removeItem(JSON.stringify(filteredItems[0].key));\r\n return null;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n /*\r\n * Used to filter all cached items and return a list of unique users based on userIdentifier.\r\n * @param {Array} Users - users saved in the cache.\r\n */\r\n getAllUsers(): Array {\r\n const users: Array = [];\r\n const accessTokenCacheItems = this._cacheStorage.getAllAccessTokens(Constants.clientId, Constants.authority);\r\n for (let i = 0; i < accessTokenCacheItems.length; i++) {\r\n const idToken = new IdToken(accessTokenCacheItems[i].value.idToken);\r\n const clientInfo = new ClientInfo(accessTokenCacheItems[i].value.clientInfo);\r\n const user = User.createUser(idToken, clientInfo, this.authority);\r\n users.push(user);\r\n }\r\n\r\n return this.getUniqueUsers(users);\r\n }\r\n\r\n /*\r\n * Used to filter users based on userIdentifier\r\n * @param {Array} Users - users saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n private getUniqueUsers(users: Array): Array {\r\n if (!users || users.length <= 1) {\r\n return users;\r\n }\r\n\r\n const flags: Array = [];\r\n const uniqueUsers: Array = [];\r\n for (let index = 0; index < users.length; ++index) {\r\n if (users[index].userIdentifier && flags.indexOf(users[index].userIdentifier) === -1) {\r\n flags.push(users[index].userIdentifier);\r\n uniqueUsers.push(users[index]);\r\n }\r\n }\r\n\r\n return uniqueUsers;\r\n }\r\n\r\n /*\r\n * Used to get a unique list of authoritues from the cache\r\n * @param {Array} accessTokenCacheItems - accessTokenCacheItems saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n private getUniqueAuthority(accessTokenCacheItems: Array, property: string): Array {\r\n const authorityList: Array = [];\r\n const flags: Array = [];\r\n accessTokenCacheItems.forEach(element => {\r\n if (element.key.hasOwnProperty(property) && (flags.indexOf(element.key[property]) === -1)) {\r\n flags.push(element.key[property]);\r\n authorityList.push(element.key[property]);\r\n }\r\n });\r\n return authorityList;\r\n }\r\n\r\n /*\r\n * Adds login_hint to authorization URL which is used to pre-fill the username field of sign in page for the user if known ahead of time\r\n * domain_hint can be one of users/organisations which when added skips the email based discovery process of the user\r\n * domain_req utid received as part of the clientInfo\r\n * login_req uid received as part of clientInfo\r\n * @param {string} urlNavigate - Authentication request url\r\n * @param {User} user - User for which the token is requested\r\n * @ignore\r\n * @hidden\r\n */\r\n private addHintParameters(urlNavigate: string, user: User): string {\r\n const userObject = user ? user : this.getUser();\r\n const decodedClientInfo = userObject.userIdentifier.split(\".\");\r\n const uid = Utils.base64DecodeStringUrlSafe(decodedClientInfo[0]);\r\n const utid = Utils.base64DecodeStringUrlSafe(decodedClientInfo[1]);\r\n if (!this.urlContainsQueryStringParameter(\"login_hint\", urlNavigate) && userObject.displayableId && !Utils.isEmpty(userObject.displayableId)) {\r\n urlNavigate += \"&login_hint=\" + encodeURIComponent(user.displayableId);\r\n }\r\n\r\n if (!Utils.isEmpty(uid) && !Utils.isEmpty(utid)) {\r\n if (!this.urlContainsQueryStringParameter(\"domain_req\", urlNavigate) && !Utils.isEmpty(utid)) {\r\n urlNavigate += \"&domain_req=\" + encodeURIComponent(utid);\r\n }\r\n\r\n if (!this.urlContainsQueryStringParameter(\"login_req\", urlNavigate) && !Utils.isEmpty(uid)) {\r\n urlNavigate += \"&login_req=\" + encodeURIComponent(uid);\r\n }\r\n\r\n if (!this.urlContainsQueryStringParameter(\"domain_hint\", urlNavigate) && !Utils.isEmpty(utid)) {\r\n if (utid === \"9188040d-6c67-4c5b-b112-36a304b66dad\") {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"consumers\");\r\n } else {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"organizations\");\r\n }\r\n }\r\n }\r\n\r\n return urlNavigate;\r\n }\r\n\r\n /*\r\n * Checks if the authorization endpoint URL contains query string parameters\r\n * @ignore\r\n * @hidden\r\n */\r\n private urlContainsQueryStringParameter(name: string, url: string): boolean {\r\n // regex to detect pattern of a ? or & followed by the name parameter and an equals character\r\n const regex = new RegExp(\"[\\\\?&]\" + name + \"=\");\r\n return regex.test(url);\r\n }\r\n\r\n /*\r\n * Used to obtain an access_token by redirecting the user to the authorization endpoint.\r\n * To renew idToken, clientId should be passed as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://{instance}/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://{instance}/tfp/<tenant>/\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n */\r\n acquireTokenRedirect(scopes: Array): void;\r\n acquireTokenRedirect(scopes: Array, authority: string): void;\r\n acquireTokenRedirect(scopes: Array, authority: string, user: User): void;\r\n acquireTokenRedirect(scopes: Array, authority: string, user: User, extraQueryParameters: string): void;\r\n acquireTokenRedirect(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string): void {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(isValidScope, null, null, Constants.accessToken);\r\n return;\r\n }\r\n }\r\n\r\n if (scopes) {\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n const userObject = user ? user : this.getUser();\r\n if (this._acquireTokenInProgress) {\r\n return;\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n if (!userObject) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(ErrorDescription.userLoginError, null, ErrorCodes.userLoginError, Constants.accessToken);\r\n return;\r\n }\r\n }\r\n\r\n this._acquireTokenInProgress = true;\r\n let authenticationRequest: AuthenticationRequestParameters;\r\n let acquireTokenAuthority = authority ? AuthorityFactory.CreateInstance(authority, this.validateAuthority) : this.authorityInstance;\r\n\r\n acquireTokenAuthority.ResolveEndpointsAsync().then(() => {\r\n if (Utils.compareObjects(userObject, this.getUser())) {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.token, this._redirectUri);\r\n } else {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.id_token_token, this._redirectUri);\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + userObject.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(userObject));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, acquireTokenAuthority.CanonicalAuthority);\r\n }\r\n\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n urlNavigate = this.addHintParameters(urlNavigate, userObject);\r\n if (urlNavigate) {\r\n this._cacheStorage.setItem(Constants.stateAcquireToken, authenticationRequest.state);\r\n this._requestType = Constants.renewToken;\r\n window.location.replace(urlNavigate);\r\n }\r\n });\r\n }\r\n\r\n /*\r\n * Used to acquire an access token for a new user using interactive authentication via a popup Window.\r\n * To request an id_token, pass the clientId as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\".\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the token or error.\r\n */\r\n acquireTokenPopup(scopes: Array): Promise;\r\n acquireTokenPopup(scopes: Array, authority: string): Promise;\r\n acquireTokenPopup(scopes: Array, authority: string, user: User): Promise;\r\n acquireTokenPopup(scopes: Array, authority: string, user: User, extraQueryParameters: string): Promise;\r\n acquireTokenPopup(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string): Promise {\r\n return new Promise((resolve, reject) => {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n reject(ErrorCodes.inputScopesError + \":\" + isValidScope);\r\n }\r\n\r\n if (scopes) {\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n const userObject = user ? user : this.getUser();\r\n if (this._acquireTokenInProgress) {\r\n reject(ErrorCodes.acquireTokenProgressError + \":\" + ErrorDescription.acquireTokenProgressError);\r\n return;\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n if (!userObject) {\r\n reject(ErrorCodes.userLoginError + \":\" + ErrorDescription.userLoginError);\r\n return;\r\n }\r\n\r\n this._acquireTokenInProgress = true;\r\n let authenticationRequest: AuthenticationRequestParameters;\r\n let acquireTokenAuthority = authority ? AuthorityFactory.CreateInstance(authority, this.validateAuthority) : this.authorityInstance;\r\n var popUpWindow = this.openWindow(\"about:blank\", \"_blank\", 1, this, resolve, reject);\r\n if (!popUpWindow) {\r\n return;\r\n }\r\n\r\n acquireTokenAuthority.ResolveEndpointsAsync().then(() => {\r\n if (Utils.compareObjects(userObject, this.getUser())) {\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n }\r\n else {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.token, this._redirectUri);\r\n }\r\n } else {\r\n authenticationRequest = new AuthenticationRequestParameters(acquireTokenAuthority, this.clientId, scopes, ResponseTypes.id_token_token, this._redirectUri);\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n authenticationRequest.state = authenticationRequest.state;\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + userObject.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(userObject));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, acquireTokenAuthority.CanonicalAuthority);\r\n }\r\n\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n urlNavigate = this.addHintParameters(urlNavigate, userObject);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._requestType = Constants.renewToken;\r\n if (popUpWindow) {\r\n popUpWindow.location.href = urlNavigate;\r\n }\r\n\r\n }, () => {\r\n this._logger.info(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.endpointResolutionError);\r\n if (reject) {\r\n reject(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n }\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n });\r\n });\r\n }\r\n\r\n /*\r\n * Used to get the token from cache.\r\n * MSAL will return the cached token if it is not expired.\r\n * Or it will send a request to the STS to obtain an access_token using a hidden iframe. To renew idToken, clientId should be passed as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Resolved with token or rejected with error.\r\n */\r\n @resolveTokenOnlyIfOutOfIframe\r\n acquireTokenSilent(scopes: Array, authority?: string, user?: User, extraQueryParameters?: string): Promise {\r\n return new Promise((resolve, reject) => {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n reject(ErrorCodes.inputScopesError + \":\" + isValidScope);\r\n } else {\r\n if (scopes) {\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n const userObject = user ? user : this.getUser();\r\n if (!userObject) {\r\n reject(ErrorCodes.userLoginError + \":\" + ErrorDescription.userLoginError);\r\n return;\r\n }\r\n\r\n let authenticationRequest: AuthenticationRequestParameters;\r\n let newAuthority = authority ? AuthorityFactory.CreateInstance(authority, this.validateAuthority) : this.authorityInstance;\r\n if (Utils.compareObjects(userObject, this.getUser())) {\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n authenticationRequest = new AuthenticationRequestParameters(newAuthority, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n }\r\n else {\r\n authenticationRequest = new AuthenticationRequestParameters(newAuthority, this.clientId, scopes, ResponseTypes.token, this._redirectUri);\r\n }\r\n } else {\r\n authenticationRequest = new AuthenticationRequestParameters(newAuthority, this.clientId, scopes, ResponseTypes.id_token_token, this._redirectUri);\r\n }\r\n\r\n const cacheResult = this.getCachedToken(authenticationRequest, userObject);\r\n if (cacheResult) {\r\n if (cacheResult.token) {\r\n this._logger.info(\"Token is already in cache for scope:\" + scope);\r\n resolve(cacheResult.token);\r\n return;\r\n }\r\n else if (cacheResult.errorDesc || cacheResult.error) {\r\n this._logger.infoPii(cacheResult.errorDesc + \":\" + cacheResult.error);\r\n reject(cacheResult.errorDesc + \": \" + cacheResult.error);\r\n return;\r\n }\r\n }\r\n\r\n this._requestType = Constants.renewToken;\r\n // cache miss\r\n return this.authorityInstance.ResolveEndpointsAsync()\r\n .then(() => {\r\n // refresh attept with iframe\r\n //Already renewing for this scope, callback when we get the token.\r\n if (this._activeRenewals[scope]) {\r\n this._logger.verbose(\"Renew token for scope: \" + scope + \" is in progress. Registering callback\");\r\n //Active renewals contains the state for each renewal.\r\n this.registerCallback(this._activeRenewals[scope], scope, resolve, reject);\r\n }\r\n else {\r\n if (scopes && scopes.indexOf(this.clientId) > -1 && scopes.length === 1) {\r\n // App uses idToken to send to api endpoints\r\n // Default scope is tracked as clientId to store this token\r\n this._logger.verbose(\"renewing idToken\");\r\n this.renewIdToken(scopes, resolve, reject, userObject, authenticationRequest, extraQueryParameters);\r\n } else {\r\n this._logger.verbose(\"renewing accesstoken\");\r\n this.renewToken(scopes, resolve, reject, userObject, authenticationRequest, extraQueryParameters);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /*\r\n * Calling _loadFrame but with a timeout to signal failure in loadframeStatus. Callbacks are left.\r\n * registered when network errors occur and subsequent token requests for same resource are registered to the pending request.\r\n * @ignore\r\n * @hidden\r\n */\r\n private loadIframeTimeout(urlNavigate: string, frameName: string, scope: string): void {\r\n //set iframe session to pending\r\n this._logger.verbose(\"Set loading state to pending for: \" + scope);\r\n this._cacheStorage.setItem(Constants.renewStatus + scope, Constants.tokenRenewStatusInProgress);\r\n this.loadFrame(urlNavigate, frameName);\r\n setTimeout(() => {\r\n if (this._cacheStorage.getItem(Constants.renewStatus + scope) === Constants.tokenRenewStatusInProgress) {\r\n // fail the iframe session if it\"s in pending state\r\n this._logger.verbose(\"Loading frame has timed out after: \" + (this.loadFrameTimeout / 1000) + \" seconds for scope \" + scope);\r\n const expectedState = this._activeRenewals[scope];\r\n if (expectedState && window.callBackMappedToRenewStates[expectedState]) {\r\n window.callBackMappedToRenewStates[expectedState](\"Token renewal operation failed due to timeout\", null, \"Token Renewal Failed\", Constants.accessToken);\r\n }\r\n \r\n this._cacheStorage.setItem(Constants.renewStatus + scope, Constants.tokenRenewStatusCancelled);\r\n }\r\n }, this.loadFrameTimeout);\r\n }\r\n\r\n /*\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n * @hidden\r\n */\r\n private loadFrame(urlNavigate: string, frameName: string): void {\r\n // This trick overcomes iframe navigation in IE\r\n // IE does not load the page consistently in iframe\r\n this._logger.info(\"LoadFrame: \" + frameName);\r\n var frameCheck = frameName;\r\n setTimeout(() => {\r\n var frameHandle = this.addAdalFrame(frameCheck);\r\n if (frameHandle.src === \"\" || frameHandle.src === \"about:blank\") {\r\n frameHandle.src = urlNavigate;\r\n this._logger.infoPii(\"Frame Name : \" + frameName + \" Navigated to: \" + urlNavigate);\r\n }\r\n },\r\n 500);\r\n }\r\n\r\n /*\r\n * Adds the hidden iframe for silent token renewal.\r\n * @ignore\r\n * @hidden\r\n */\r\n private addAdalFrame(iframeId: string): HTMLIFrameElement {\r\n if (typeof iframeId === \"undefined\") {\r\n return null;\r\n }\r\n\r\n this._logger.info(\"Add msal frame to document:\" + iframeId);\r\n let adalFrame = document.getElementById(iframeId) as HTMLIFrameElement;\r\n if (!adalFrame) {\r\n if (document.createElement &&\r\n document.documentElement &&\r\n (window.navigator.userAgent.indexOf(\"MSIE 5.0\") === -1)) {\r\n const ifr = document.createElement(\"iframe\");\r\n ifr.setAttribute(\"id\", iframeId);\r\n ifr.style.visibility = \"hidden\";\r\n ifr.style.position = \"absolute\";\r\n ifr.style.width = ifr.style.height = \"0\";\r\n ifr.style.border = \"0\";\r\n adalFrame = (document.getElementsByTagName(\"body\")[0].appendChild(ifr) as HTMLIFrameElement);\r\n } else if (document.body && document.body.insertAdjacentHTML) {\r\n document.body.insertAdjacentHTML('beforeend', '');\r\n }\r\n\r\n if (window.frames && window.frames[iframeId]) {\r\n adalFrame = window.frames[iframeId];\r\n }\r\n }\r\n\r\n return adalFrame;\r\n }\r\n\r\n /*\r\n * Acquires access token using a hidden iframe.\r\n * @ignore\r\n * @hidden\r\n */\r\n private renewToken(scopes: Array, resolve: Function, reject: Function, user: User, authenticationRequest: AuthenticationRequestParameters, extraQueryParameters?: string): void {\r\n const scope = scopes.join(\" \").toLowerCase();\r\n this._logger.verbose(\"renewToken is called for scope:\" + scope);\r\n const frameHandle = this.addAdalFrame(\"msalRenewFrame\" + scope);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + user.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(user));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, authenticationRequest.authority);\r\n }\r\n\r\n // renew happens in iframe, so it keeps javascript context\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._logger.verbose(\"Renew token Expected state: \" + authenticationRequest.state);\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=none\";\r\n urlNavigate = this.addHintParameters(urlNavigate, user);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n frameHandle.src = \"about:blank\";\r\n this.loadIframeTimeout(urlNavigate, \"msalRenewFrame\" + scope, scope);\r\n }\r\n\r\n /*\r\n * Renews idtoken for app\"s own backend when clientId is passed as a single scope in the scopes array.\r\n * @ignore\r\n * @hidden\r\n */\r\n private renewIdToken(scopes: Array, resolve: Function, reject: Function, user: User, authenticationRequest: AuthenticationRequestParameters, extraQueryParameters?: string): void {\r\n const scope = scopes.join(\" \").toLowerCase();\r\n this._logger.info(\"renewidToken is called\");\r\n const frameHandle = this.addAdalFrame(\"msalIdTokenFrame\");\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n const acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + user.userIdentifier + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(user));\r\n }\r\n\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, authenticationRequest.authority);\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._logger.verbose(\"Renew Idtoken Expected state: \" + authenticationRequest.state);\r\n let urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=none\";\r\n urlNavigate = this.addHintParameters(urlNavigate, user);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, this.clientId, resolve, reject);\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n frameHandle.src = \"about:blank\";\r\n this.loadIframeTimeout(urlNavigate, \"msalIdTokenFrame\", this.clientId);\r\n }\r\n\r\n /*\r\n * Returns the signed in user (received from a user object created at the time of login) or null.\r\n */\r\n getUser(): User {\r\n // idToken is first call\r\n if (this._user) {\r\n return this._user;\r\n }\r\n\r\n // frame is used to get idToken\r\n const rawIdToken = this._cacheStorage.getItem(Constants.idTokenKey);\r\n const rawClientInfo = this._cacheStorage.getItem(Constants.msalClientInfo);\r\n if (!Utils.isEmpty(rawIdToken) && !Utils.isEmpty(rawClientInfo)) {\r\n const idToken = new IdToken(rawIdToken);\r\n const clientInfo = new ClientInfo(rawClientInfo);\r\n this._user = User.createUser(idToken, clientInfo, this.authority);\r\n return this._user;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /*\r\n * This method must be called for processing the response received from the STS. It extracts the hash, processes the token or error information and saves it in the cache. It then\r\n * calls the registered callbacks in case of redirect or resolves the promises with the result.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n * @hidden\r\n */\r\n private handleAuthenticationResponse(hash: string): void {\r\n if (hash == null) {\r\n hash = window.location.hash;\r\n }\r\n\r\n var self = null;\r\n var isPopup: boolean = false;\r\n var isWindowOpenerMsal = false;\r\n\r\n try {\r\n isWindowOpenerMsal = window.opener && window.opener.msal && window.opener.msal !== window.msal;\r\n } catch (err) {\r\n // err = SecurityError: Blocked a frame with origin \"[url]\" from accessing a cross-origin frame.\r\n isWindowOpenerMsal = false;\r\n }\r\n\r\n if (isWindowOpenerMsal) {\r\n self = window.opener.msal;\r\n isPopup = true;\r\n }\r\n else if (window.parent && window.parent.msal) {\r\n self = window.parent.msal;\r\n }\r\n\r\n const requestInfo = self.getRequestInfo(hash);\r\n let token: string = null, tokenReceivedCallback: (errorDesc: string, token: string, error: string, tokenType: string) => void = null, tokenType: string, saveToken:boolean = true;\r\n \r\n self._logger.info(\"Returned from redirect url\");\r\n \r\n if (window.parent !== window && window.parent.callBackMappedToRenewStates[requestInfo.stateResponse]) {\r\n tokenReceivedCallback = window.parent.callBackMappedToRenewStates[requestInfo.stateResponse];\r\n }\r\n else if (window.opener && window.opener.msal && window.opener.callBackMappedToRenewStates[requestInfo.stateResponse]) {\r\n tokenReceivedCallback = window.opener.callBackMappedToRenewStates[requestInfo.stateResponse];\r\n }\r\n else {\r\n if (self._navigateToLoginRequestUrl) {\r\n tokenReceivedCallback = null;\r\n self._cacheStorage.setItem(Constants.urlHash, hash);\r\n saveToken = false;\r\n if (window.parent === window && !isPopup) {\r\n window.location.href = self._cacheStorage.getItem(Constants.loginRequest);\r\n }\r\n return;\r\n }\r\n else {\r\n tokenReceivedCallback = self._tokenReceivedCallback;\r\n window.location.hash = '';\r\n }\r\n\r\n }\r\n\r\n self.saveTokenFromHash(requestInfo);\r\n\r\n if ((requestInfo.requestType === Constants.renewToken) && window.parent) {\r\n if (window.parent!==window) {\r\n self._logger.verbose(\"Window is in iframe, acquiring token silently\");\r\n } else {\r\n self._logger.verbose(\"acquiring token interactive in progress\");\r\n }\r\n\r\n token = requestInfo.parameters[Constants.accessToken] || requestInfo.parameters[Constants.idToken];\r\n tokenType = Constants.accessToken;\r\n } else if (requestInfo.requestType === Constants.login) {\r\n token = requestInfo.parameters[Constants.idToken];\r\n tokenType = Constants.idToken;\r\n }\r\n\r\n var errorDesc = requestInfo.parameters[Constants.errorDescription];\r\n var error = requestInfo.parameters[Constants.error];\r\n \r\n try {\r\n if (tokenReceivedCallback) {\r\n tokenReceivedCallback.call(self, errorDesc, token, error, tokenType);\r\n }\r\n\r\n } catch (err) {\r\n self._logger.error(\"Error occurred in token received callback function: \" + err);\r\n }\r\n \r\n for (var i = 0; i < self._openedWindows.length; i++) {\r\n self._openedWindows[i].close();\r\n }\r\n\r\n }\r\n\r\n /*\r\n * This method must be called for processing the response received from AAD. It extracts the hash, processes the token or error, saves it in the cache and calls the registered callbacks with the result.\r\n * @param {string} authority authority received in the redirect response from AAD.\r\n * @param {TokenResponse} requestInfo an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n * @param {User} user user object for which scopes are consented for. The default user is the logged in user.\r\n * @param {ClientInfo} clientInfo clientInfo received as part of the response comprising of fields uid and utid.\r\n * @param {IdToken} idToken idToken received as part of the response.\r\n * @ignore\r\n * @private\r\n * @hidden\r\n */\r\n private saveAccessToken(authority: string, tokenResponse: TokenResponse, user: User, clientInfo: string, idToken: IdToken): void {\r\n let scope: string;\r\n let clientObj: ClientInfo = new ClientInfo(clientInfo);\r\n if (tokenResponse.parameters.hasOwnProperty(\"scope\")) {\r\n scope = tokenResponse.parameters[\"scope\"];\r\n const consentedScopes = scope.split(\" \");\r\n const accessTokenCacheItems =\r\n this._cacheStorage.getAllAccessTokens(this.clientId, authority);\r\n for (let i = 0; i < accessTokenCacheItems.length; i++) {\r\n const accessTokenCacheItem = accessTokenCacheItems[i];\r\n if (accessTokenCacheItem.key.userIdentifier === user.userIdentifier) {\r\n const cachedScopes = accessTokenCacheItem.key.scopes.split(\" \");\r\n if (Utils.isIntersectingScopes(cachedScopes, consentedScopes)) {\r\n this._cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n }\r\n }\r\n }\r\n const accessTokenKey = new AccessTokenKey(authority, this.clientId, scope, clientObj.uid, clientObj.utid);\r\n const accessTokenValue = new AccessTokenValue(tokenResponse.parameters[Constants.accessToken], idToken.rawIdToken, Utils.expiresIn(tokenResponse.parameters[Constants.expiresIn]).toString(), clientInfo);\r\n this._cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n } else {\r\n scope = this.clientId;\r\n const accessTokenKey = new AccessTokenKey(authority, this.clientId, scope, clientObj.uid, clientObj.utid);\r\n const accessTokenValue = new AccessTokenValue(tokenResponse.parameters[Constants.idToken], tokenResponse.parameters[Constants.idToken], idToken.expiration, clientInfo);\r\n this._cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n }\r\n }\r\n\r\n /*\r\n * Saves token or error received in the response from AAD in the cache. In case of id_token, it also creates the user object.\r\n * @ignore\r\n * @hidden\r\n */\r\n private saveTokenFromHash(tokenResponse: TokenResponse): void {\r\n this._logger.info(\"State status:\" + tokenResponse.stateMatch + \"; Request type:\" + tokenResponse.requestType);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n var scope: string = \"\";\r\n if (tokenResponse.parameters.hasOwnProperty(\"scope\")) {\r\n scope = tokenResponse.parameters[\"scope\"];\r\n }\r\n else {\r\n scope = this.clientId;\r\n }\r\n\r\n // Record error\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.errorDescription) || tokenResponse.parameters.hasOwnProperty(Constants.error)) {\r\n this._logger.infoPii(\"Error :\" + tokenResponse.parameters[Constants.error] + \"; Error description:\" + tokenResponse.parameters[Constants.errorDescription]);\r\n this._cacheStorage.setItem(Constants.msalError, tokenResponse.parameters[\"error\"]);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, tokenResponse.parameters[Constants.errorDescription]);\r\n if (tokenResponse.requestType === Constants.login) {\r\n this._loginInProgress = false;\r\n this._cacheStorage.setItem(Constants.loginError, tokenResponse.parameters[Constants.errorDescription] + \":\" + tokenResponse.parameters[Constants.error]);\r\n }\r\n\r\n if (tokenResponse.requestType === Constants.renewToken) {\r\n this._acquireTokenInProgress = false;\r\n }\r\n } else {\r\n // It must verify the state from redirect\r\n if (tokenResponse.stateMatch) {\r\n // record tokens to storage if exists\r\n this._logger.info(\"State is right\");\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.sessionState)) {\r\n this._cacheStorage.setItem(Constants.msalSessionState, tokenResponse.parameters[Constants.sessionState]);\r\n }\r\n \r\n var idToken: IdToken;\r\n var clientInfo: string = \"\";\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.accessToken)) {\r\n this._logger.info(\"Fragment has access token\");\r\n this._acquireTokenInProgress = false;\r\n let user: User;\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.idToken)) {\r\n idToken = new IdToken(tokenResponse.parameters[Constants.idToken]);\r\n } else {\r\n idToken = new IdToken(this._cacheStorage.getItem(Constants.idTokenKey));\r\n }\r\n\r\n let authorityKey = Constants.authority + Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n let authority: string;\r\n if (!Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n authority = this._cacheStorage.getItem(authorityKey);\r\n authority = Utils.replaceFirstPath(authority, idToken.tenantId);\r\n }\r\n\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.clientInfo)) {\r\n clientInfo = tokenResponse.parameters[Constants.clientInfo];\r\n user = User.createUser(idToken, new ClientInfo(clientInfo), authority);\r\n } else {\r\n this._logger.warning(\"ClientInfo not received in the response from AAD\");\r\n user = User.createUser(idToken, new ClientInfo(clientInfo), authority);\r\n }\r\n\r\n let acquireTokenUserKey = Constants.acquireTokenUser + Constants.resourceDelimeter + user.userIdentifier + Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n let acquireTokenUser: User;\r\n if (!Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n acquireTokenUser = JSON.parse(this._cacheStorage.getItem(acquireTokenUserKey));\r\n if (user && acquireTokenUser && Utils.compareObjects(user, acquireTokenUser)) {\r\n this.saveAccessToken(authority, tokenResponse, user, clientInfo, idToken);\r\n this._logger.info(\r\n \"The user object received in the response is the same as the one passed in the acquireToken request\");\r\n } else {\r\n this._logger.warning(\r\n \"The user object created from the response is not the same as the one passed in the acquireToken request\");\r\n }\r\n }\r\n }\r\n\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.idToken)) {\r\n if (scope.indexOf(this.clientId) > -1) {\r\n this._logger.info(\"Fragment has id token\");\r\n this._loginInProgress = false;\r\n idToken = new IdToken(tokenResponse.parameters[Constants.idToken]);\r\n if (tokenResponse.parameters.hasOwnProperty(Constants.clientInfo)) {\r\n clientInfo = tokenResponse.parameters[Constants.clientInfo];\r\n } else {\r\n this._logger.warning(\"ClientInfo not received in the response from AAD\");\r\n }\r\n\r\n let authorityKey = Constants.authority + Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n let authority: string;\r\n if (!Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n authority = this._cacheStorage.getItem(authorityKey);\r\n authority = Utils.replaceFirstPath(authority, idToken.tenantId);\r\n }\r\n\r\n this._user = User.createUser(idToken, new ClientInfo(clientInfo), authority);\r\n if (idToken && idToken.nonce) {\r\n if (idToken.nonce !== this._cacheStorage.getItem(Constants.nonceIdToken)) {\r\n this._user = null;\r\n this._cacheStorage.setItem(Constants.loginError, \"Nonce Mismatch. Expected Nonce: \" + this._cacheStorage.getItem(Constants.nonceIdToken) + \",\" + \"Actual Nonce: \" + idToken.nonce);\r\n this._logger.error(\"Nonce Mismatch.Expected Nonce: \" + this._cacheStorage.getItem(Constants.nonceIdToken) + \",\" + \"Actual Nonce: \" + idToken.nonce);\r\n } else {\r\n this._cacheStorage.setItem(Constants.idTokenKey, tokenResponse.parameters[Constants.idToken]);\r\n this._cacheStorage.setItem(Constants.msalClientInfo, clientInfo);\r\n\r\n // Save idToken as access token for app itself\r\n this.saveAccessToken(authority, tokenResponse, this._user, clientInfo, idToken);\r\n }\r\n } else {\r\n this._logger.error(\"Invalid id_token received in the response\");\r\n this._cacheStorage.setItem(Constants.msalError, \"invalid idToken\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"Invalid idToken. idToken: \" + tokenResponse.parameters[Constants.idToken]);\r\n }\r\n }\r\n }\r\n } else {\r\n this._logger.error(\"State Mismatch.Expected State: \" + this._cacheStorage.getItem(Constants.stateLogin) + \",\" + \"Actual State: \" + tokenResponse.stateResponse);\r\n this._cacheStorage.setItem(Constants.msalError, \"Invalid_state\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"Invalid_state. state: \" + tokenResponse.stateResponse);\r\n }\r\n }\r\n this._cacheStorage.setItem(Constants.renewStatus + scope, Constants.tokenRenewStatusCompleted);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.acquireTokenUser, Constants.renewStatus);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.authority + Constants.resourceDelimeter, Constants.renewStatus);\r\n }\r\n\r\n /*\r\n * Checks if the redirect response is received from the STS. In case of redirect, the url fragment has either id_token, access_token or error.\r\n * @param {string} hash - Hash passed from redirect page.\r\n * @returns {Boolean} - true if response contains id_token, access_token or error, false otherwise.\r\n * @hidden\r\n */\r\n isCallback(hash: string): boolean {\r\n hash = this.getHash(hash);\r\n const parameters = Utils.deserialize(hash);\r\n return (\r\n parameters.hasOwnProperty(Constants.errorDescription) ||\r\n parameters.hasOwnProperty(Constants.error) ||\r\n parameters.hasOwnProperty(Constants.accessToken) ||\r\n parameters.hasOwnProperty(Constants.idToken)\r\n\r\n );\r\n }\r\n\r\n /*\r\n * Returns the anchor part(#) of the URL\r\n * @ignore\r\n * @hidden\r\n */\r\n private getHash(hash: string): string {\r\n if (hash.indexOf(\"#/\") > -1) {\r\n hash = hash.substring(hash.indexOf(\"#/\") + 2);\r\n } else if (hash.indexOf(\"#\") > -1) {\r\n hash = hash.substring(1);\r\n }\r\n\r\n return hash;\r\n }\r\n\r\n /*\r\n * Creates a requestInfo object from the URL fragment and returns it.\r\n * @param {string} hash - Hash passed from redirect page\r\n * @returns {TokenResponse} an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n * @ignore\r\n * @hidden\r\n */\r\n private getRequestInfo(hash: string): TokenResponse {\r\n hash = this.getHash(hash);\r\n const parameters = Utils.deserialize(hash);\r\n const tokenResponse = new TokenResponse();\r\n if (parameters) {\r\n tokenResponse.parameters = parameters;\r\n if (parameters.hasOwnProperty(Constants.errorDescription) ||\r\n parameters.hasOwnProperty(Constants.error) ||\r\n parameters.hasOwnProperty(Constants.accessToken) ||\r\n parameters.hasOwnProperty(Constants.idToken)) {\r\n tokenResponse.valid = true;\r\n // which call\r\n let stateResponse: string;\r\n if (parameters.hasOwnProperty(\"state\")) {\r\n stateResponse = parameters.state;\r\n } else {\r\n return tokenResponse;\r\n }\r\n\r\n tokenResponse.stateResponse = stateResponse;\r\n // async calls can fire iframe and login request at the same time if developer does not use the API as expected\r\n // incoming callback needs to be looked up to find the request type\r\n if (stateResponse === this._cacheStorage.getItem(Constants.stateLogin)) { // loginRedirect\r\n tokenResponse.requestType = Constants.login;\r\n tokenResponse.stateMatch = true;\r\n return tokenResponse;\r\n } else if (stateResponse === this._cacheStorage.getItem(Constants.stateAcquireToken)) { //acquireTokenRedirect\r\n tokenResponse.requestType = Constants.renewToken;\r\n tokenResponse.stateMatch = true;\r\n return tokenResponse;\r\n }\r\n\r\n // external api requests may have many renewtoken requests for different resource\r\n if (!tokenResponse.stateMatch) {\r\n if (window.parent && window.parent !== window) {\r\n tokenResponse.requestType = Constants.renewToken;\r\n }\r\n else {\r\n tokenResponse.requestType = this._requestType;\r\n }\r\n const statesInParentContext = this._renewStates;\r\n for (let i = 0; i < statesInParentContext.length; i++) {\r\n if (statesInParentContext[i] === tokenResponse.stateResponse) {\r\n tokenResponse.stateMatch = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return tokenResponse;\r\n }\r\n\r\n /*\r\n * Extracts scope value from the state sent with the authentication request.\r\n * @returns {string} scope.\r\n * @ignore\r\n * @hidden\r\n */\r\n private getScopeFromState(state: string): string {\r\n if (state) {\r\n const splitIndex = state.indexOf(\"|\");\r\n if (splitIndex > -1 && splitIndex + 1 < state.length) {\r\n return state.substring(splitIndex + 1);\r\n }\r\n }\r\n return \"\";\r\n }\r\n\r\n /*\r\n * Returns whether current window is in ifram for token renewal\r\n * @ignore\r\n * @hidden\r\n */\r\n private isInIframe() {\r\n return window.parent !== window;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/UserAgentApplication.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AccessTokenKey {\r\n\r\n authority: string;\r\n clientId: string;\r\n userIdentifier: string;\r\n scopes: string;\r\n\r\n constructor(authority: string, clientId: string, scopes: string, uid: string, utid: string) {\r\n this.authority = authority;\r\n this.clientId = clientId;\r\n this.scopes = scopes;\r\n this.userIdentifier = Utils.base64EncodeStringUrlSafe(uid) + \".\" + Utils.base64EncodeStringUrlSafe(utid);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AccessTokenKey.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AccessTokenValue {\r\n\r\n accessToken: string;\r\n idToken: string;\r\n expiresIn: string;\r\n clientInfo: string;\r\n\r\n constructor(accessToken: string, idToken: string, expiresIn: string, clientInfo: string) {\r\n this.accessToken = accessToken;\r\n this.idToken = idToken;\r\n this.expiresIn = expiresIn;\r\n this.clientInfo = clientInfo;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AccessTokenValue.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Authority } from \"./Authority\";\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AuthenticationRequestParameters {\r\n authorityInstance: Authority;\r\n clientId: string;\r\n nonce: string;\r\n state: string;\r\n correlationId: string;\r\n xClientVer: string;\r\n xClientSku: string;\r\n scopes: Array;\r\n responseType: string;\r\n promptValue: string;\r\n extraQueryParameters: string;\r\n loginHint: string;\r\n domainHint: string;\r\n redirectUri: string;\r\n public get authority(): string {\r\n return this.authorityInstance.CanonicalAuthority;\r\n }\r\n\r\n constructor(authority: Authority, clientId: string, scope: Array, responseType: string, redirectUri: string) {\r\n this.authorityInstance = authority;\r\n this.clientId = clientId;\r\n this.scopes = scope;\r\n this.responseType = responseType;\r\n this.redirectUri = redirectUri;\r\n // randomly generated values\r\n this.correlationId = Utils.createNewGuid();\r\n this.state = Utils.createNewGuid();\r\n this.nonce = Utils.createNewGuid();\r\n // telemetry information\r\n this.xClientSku = \"MSAL.JS\";\r\n this.xClientVer = Utils.getLibraryVersion();\r\n }\r\n\r\n createNavigateUrl(scopes: Array): string {\r\n if (!scopes) {\r\n scopes = [this.clientId];\r\n }\r\n\r\n if (scopes.indexOf(this.clientId) === -1) {\r\n scopes.push(this.clientId);\r\n }\r\n\r\n const str: Array = [];\r\n str.push(\"response_type=\" + this.responseType);\r\n this.translateclientIdUsedInScope(scopes);\r\n str.push(\"scope=\" + encodeURIComponent(this.parseScope(scopes)));\r\n str.push(\"client_id=\" + encodeURIComponent(this.clientId));\r\n str.push(\"redirect_uri=\" + encodeURIComponent(this.redirectUri));\r\n str.push(\"state=\" + encodeURIComponent(this.state));\r\n str.push(\"nonce=\" + encodeURIComponent(this.nonce));\r\n str.push(\"client_info=1\");\r\n str.push(`x-client-SKU=${this.xClientSku}`);\r\n str.push(`x-client-Ver=${this.xClientVer}`);\r\n\r\n if (this.extraQueryParameters) {\r\n str.push(this.extraQueryParameters);\r\n }\r\n\r\n str.push(\"client-request-id=\" + encodeURIComponent(this.correlationId));\r\n let authEndpoint: string = this.authorityInstance.AuthorizationEndpoint;\r\n\r\n // if the endpoint already has queryparams, lets add to it, otherwise add the first one\r\n if (authEndpoint.indexOf(\"?\") < 0) {\r\n authEndpoint += \"?\";\r\n } else {\r\n authEndpoint += \"&\";\r\n }\r\n\r\n let requestUrl: string = `${authEndpoint}${str.join(\"&\")}`;\r\n return requestUrl;\r\n }\r\n\r\n translateclientIdUsedInScope(scopes: Array): void {\r\n const clientIdIndex: number = scopes.indexOf(this.clientId);\r\n if (clientIdIndex >= 0) {\r\n scopes.splice(clientIdIndex, 1);\r\n if (scopes.indexOf(\"openid\") === -1) {\r\n scopes.push(\"openid\");\r\n }\r\n if (scopes.indexOf(\"profile\") === -1) {\r\n scopes.push(\"profile\");\r\n }\r\n }\r\n }\r\n\r\n parseScope(scopes: Array): string {\r\n let scopeList: string = \"\";\r\n if (scopes) {\r\n for (let i: number = 0; i < scopes.length; ++i) {\r\n scopeList += (i !== scopes.length - 1) ? scopes[i] + \" \" : scopes[i];\r\n }\r\n }\r\n\r\n return scopeList;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthenticationRequestParameters.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ClientInfo {\r\n\r\n private _uid: string;\r\n get uid(): string {\r\n return this._uid ? this._uid : \"\";\r\n }\r\n\r\n set uid(uid: string) {\r\n this._uid = uid;\r\n }\r\n\r\n private _utid: string;\r\n get utid(): string {\r\n return this._utid ? this._utid : \"\";\r\n }\r\n\r\n set utid(utid: string) {\r\n this._utid = utid;\r\n }\r\n\r\n constructor(rawClientInfo: string) {\r\n if (!rawClientInfo || Utils.isEmpty(rawClientInfo)) {\r\n this.uid = \"\";\r\n this.utid = \"\";\r\n return;\r\n }\r\n\r\n try {\r\n const decodedClientInfo: string = Utils.base64DecodeStringUrlSafe(rawClientInfo);\r\n const clientInfo: ClientInfo = JSON.parse(decodedClientInfo);\r\n if (clientInfo) {\r\n if (clientInfo.hasOwnProperty(\"uid\")) {\r\n this.uid = clientInfo.uid;\r\n }\r\n\r\n if (clientInfo.hasOwnProperty(\"utid\")) {\r\n this.utid = clientInfo.utid;\r\n }\r\n }\r\n } catch (e) {\r\n throw new Error(e);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/ClientInfo.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class IdToken {\r\n\r\n issuer: string;\r\n objectId: string;\r\n subject: string;\r\n tenantId: string;\r\n version: string;\r\n preferredName: string;\r\n name: string;\r\n homeObjectId: string;\r\n nonce: string;\r\n expiration: string;\r\n rawIdToken: string;\r\n decodedIdToken: Object\r\n\r\n constructor(rawIdToken: string) {\r\n if (Utils.isEmpty(rawIdToken)) {\r\n throw new Error(\"null or empty raw idtoken\");\r\n }\r\n try {\r\n this.rawIdToken = rawIdToken;\r\n this.decodedIdToken = Utils.extractIdToken(rawIdToken);\r\n if (this.decodedIdToken) {\r\n if (this.decodedIdToken.hasOwnProperty(\"iss\")) {\r\n this.issuer = this.decodedIdToken[\"iss\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"oid\")) {\r\n this.objectId = this.decodedIdToken['oid'];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"sub\")) {\r\n this.subject = this.decodedIdToken[\"sub\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"tid\")) {\r\n this.tenantId = this.decodedIdToken[\"tid\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"ver\")) {\r\n this.version = this.decodedIdToken[\"ver\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"preferred_username\")) {\r\n this.preferredName = this.decodedIdToken[\"preferred_username\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"name\")) {\r\n this.name = this.decodedIdToken[\"name\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"nonce\")) {\r\n this.nonce = this.decodedIdToken[\"nonce\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"exp\")) {\r\n this.expiration = this.decodedIdToken[\"exp\"];\r\n }\r\n\r\n if (this.decodedIdToken.hasOwnProperty(\"home_oid\")) {\r\n this.homeObjectId = this.decodedIdToken[\"home_oid\"];\r\n }\r\n }\r\n } catch (e) {\r\n throw new Error(\"Failed to parse the returned id token\");\r\n }\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/IdToken.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Constants } from \"./Constants\";\r\nimport { AccessTokenCacheItem } from \"./AccessTokenCacheItem\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Storage {// Singleton\r\n\r\n private static _instance: Storage;\r\n private _localStorageSupported: boolean;\r\n private _sessionStorageSupported: boolean;\r\n private _cacheLocation: string;\r\n\r\n constructor(cacheLocation: string) {\r\n if (Storage._instance) {\r\n return Storage._instance;\r\n }\r\n\r\n this._cacheLocation = cacheLocation;\r\n this._localStorageSupported = typeof window[this._cacheLocation] !== \"undefined\" && window[this._cacheLocation] != null;\r\n this._sessionStorageSupported = typeof window[cacheLocation] !== \"undefined\" && window[cacheLocation] != null;\r\n Storage._instance = this;\r\n if (!this._localStorageSupported && !this._sessionStorageSupported) {\r\n throw new Error(\"localStorage and sessionStorage not supported\");\r\n }\r\n\r\n return Storage._instance;\r\n }\r\n\r\n // add value to storage\r\n setItem(key: string, value: string): void {\r\n if (window[this._cacheLocation]) {\r\n window[this._cacheLocation].setItem(key, value);\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n // get one item by key from storage\r\n getItem(key: string): string {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].getItem(key);\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n // remove value from storage\r\n removeItem(key: string): void {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].removeItem(key);\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n // clear storage (remove all items from it)\r\n clear(): void {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].clear();\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n getAllAccessTokens(clientId: string, userIdentifier: string): Array {\r\n const results: Array = [];\r\n let accessTokenCacheItem: AccessTokenCacheItem;\r\n const storage = window[this._cacheLocation];\r\n if (storage) {\r\n let key: string;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key)) {\r\n if (key.match(clientId) && key.match(userIdentifier)) {\r\n let value = this.getItem(key);\r\n if (value) {\r\n accessTokenCacheItem = new AccessTokenCacheItem(JSON.parse(key), JSON.parse(value));\r\n results.push(accessTokenCacheItem);\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n\r\n return results;\r\n }\r\n\r\n removeAcquireTokenEntries(acquireTokenUser: string, acquireTokenStatus: string): void {\r\n const storage = window[this._cacheLocation];\r\n if (storage) {\r\n let key: string;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key)) {\r\n if ((key.indexOf(acquireTokenUser) > -1) || (key.indexOf(acquireTokenStatus) > -1)) {\r\n this.removeItem(key);\r\n }\r\n }\r\n }\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n\r\n resetCacheItems(): void {\r\n const storage = window[this._cacheLocation];\r\n if (storage) {\r\n let key: string;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key) && key.indexOf(Constants.msal) !== -1) {\r\n storage[key] = \"\";\r\n }\r\n }\r\n } else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Storage.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { AccessTokenKey } from \"./AccessTokenKey\";\r\nimport { AccessTokenValue } from \"./AccessTokenValue\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class AccessTokenCacheItem {\r\n\r\n key: AccessTokenKey;\r\n value: AccessTokenValue;\r\n\r\n constructor(key: AccessTokenKey, value: AccessTokenValue) {\r\n this.key = key;\r\n this.value = value;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AccessTokenCacheItem.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class TokenResponse {\r\n valid: boolean;\r\n parameters: Object;\r\n stateMatch: boolean;\r\n stateResponse: string;\r\n requestType: string;\r\n\r\n constructor() {\r\n this.valid = false;\r\n this.parameters = {};\r\n this.stateMatch = false;\r\n this.stateResponse = \"\";\r\n this.requestType = \"unknown\";\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/RequestInfo.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nimport { Utils } from \"./Utils\";\r\nimport { AadAuthority } from \"./AadAuthority\";\r\nimport { B2cAuthority } from \"./B2cAuthority\";\r\nimport { Authority, AuthorityType } from \"./Authority\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\n\r\nexport class AuthorityFactory {\r\n /*\r\n * Parse the url and determine the type of authority\r\n */\r\n private static DetectAuthorityFromUrl(authorityUrl: string): AuthorityType {\r\n authorityUrl = Utils.CanonicalizeUri(authorityUrl);\r\n let components = Utils.GetUrlComponents(authorityUrl);\r\n let pathSegments = components.PathSegments;\r\n switch (pathSegments[0]) {\r\n case \"tfp\":\r\n return AuthorityType.B2C;\r\n case \"adfs\":\r\n return AuthorityType.Adfs;\r\n default:\r\n return AuthorityType.Aad;\r\n }\r\n }\r\n\r\n /*\r\n * Create an authority object of the correct type based on the url\r\n * Performs basic authority validation - checks to see if the authority is of a valid type (eg aad, b2c)\r\n */\r\n public static CreateInstance(authorityUrl: string, validateAuthority: boolean): Authority {\r\n let type = AuthorityFactory.DetectAuthorityFromUrl(authorityUrl);\r\n // Depending on above detection, create the right type.\r\n switch (type) {\r\n case AuthorityType.B2C:\r\n return new B2cAuthority(authorityUrl, validateAuthority);\r\n case AuthorityType.Aad:\r\n return new AadAuthority(authorityUrl, validateAuthority);\r\n default:\r\n throw ErrorMessage.invalidAuthorityType;\r\n }\r\n }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AuthorityFactory.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { AadAuthority } from \"./AadAuthority\";\r\nimport { Authority, AuthorityType } from \"./Authority\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\nimport { Utils } from \"./Utils\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class B2cAuthority extends AadAuthority {\r\n public constructor(authority: string, validateAuthority: boolean) {\r\n super(authority, validateAuthority);\r\n let urlComponents = Utils.GetUrlComponents(authority);\r\n\r\n let pathSegments = urlComponents.PathSegments;\r\n if (pathSegments.length < 3) {\r\n throw ErrorMessage.b2cAuthorityUriInvalidPath;\r\n }\r\n\r\n this.CanonicalAuthority = `https://${urlComponents.HostNameAndPort}/${pathSegments[0]}/${pathSegments[1]}/${pathSegments[2]}/`;\r\n }\r\n\r\n public get AuthorityType(): AuthorityType {\r\n return AuthorityType.B2C;\r\n }\r\n\r\n /*\r\n * Returns a promise with the TenantDiscoveryEndpoint\r\n */\r\n public GetOpenIdConfigurationEndpointAsync(): Promise {\r\n var resultPromise = new Promise((resolve, reject) =>\r\n resolve(this.DefaultOpenIdConfigurationEndpoint));\r\n\r\n if (!this.IsValidationEnabled) {\r\n return resultPromise;\r\n }\r\n\r\n if (this.IsInTrustedHostList(this.CanonicalAuthorityUrlComponents.HostNameAndPort)) {\r\n return resultPromise;\r\n }\r\n\r\n return new Promise((resolve, reject) =>\r\n reject(ErrorMessage.unsupportedAuthorityValidation));\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/B2cAuthority.ts"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/msal.min.js b/dist/msal.min.js
index 487f073b34..3f73c24551 100644
--- a/dist/msal.min.js
+++ b/dist/msal.min.js
@@ -1,7 +1,7 @@
-/*! msal v0.1.3 2018-02-22 */
+/*! msal v0.1.5 2018-02-27 */
'use strict';
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Msal",[],t):"object"==typeof exports?exports.Msal=t():e.Msal=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.compareObjects=function(e,t){return!(!e||!t)&&!(!e.userIdentifier||!t.userIdentifier||e.userIdentifier!==t.userIdentifier)},e.expiresIn=function(e){return e||(e="3599"),this.now()+parseInt(e,10)},e.now=function(){return Math.round((new Date).getTime()/1e3)},e.isEmpty=function(e){return void 0===e||!e||0===e.length},e.extractIdToken=function(e){var t=this.decodeJwt(e);if(!t)return null;try{var n=t.JWSPayload,r=this.base64DecodeStringUrlSafe(n);return r?JSON.parse(r):null}catch(e){}return null},e.base64EncodeStringUrlSafe=function(e){return window.btoa?window.btoa(e):this.encode(e)},e.base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(window.atob(e)):decodeURIComponent(this.decode(e))},e.encode=function(e){var t,n,r,o,i,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",l=0;for(e=this.utf8Encode(e);l>2,i=(3&t)<<4|n>>4,s=(15&n)<<2|r>>6,a=63&r,isNaN(n)?s=a=64:isNaN(r)&&(a=64),u=u+c.charAt(o)+c.charAt(i)+c.charAt(s)+c.charAt(a);return u.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},e.utf8Encode=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t},e.decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var n=e.length;if(n%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var r,o,i,s,a,c,u,l,d="",p=0;p>16&255,u=a>>8&255,d+=String.fromCharCode(c,u);break}if(p+1===n-1){a=r<<18|o<<12,c=a>>16&255,d+=String.fromCharCode(c);break}a=r<<18|o<<12|i<<6|s,c=a>>16&255,u=a>>8&255,l=255&a,d+=String.fromCharCode(c,u,l)}return d},e.decodeJwt=function(e){if(this.isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=t.exec(e);return!n||n.length<4?null:{header:n[1],JWSPayload:n[2],JWSSig:n[3]}},e.deserialize=function(e){var t,n=/\+/g,r=/([^&=]+)=([^&]*)/g,o=function(e){return decodeURIComponent(e.replace(n," "))},i={};for(t=r.exec(e);t;)i[o(t[1])]=o(t[2]),t=r.exec(e);return i},e.isIntersectingScopes=function(e,t){e=this.convertToLowerCase(e);for(var n=0;n-1)return!0;return!1},e.containsScope=function(e,t){return e=this.convertToLowerCase(e),t.every(function(t){return e.indexOf(t.toString().toLowerCase())>=0})},e.convertToLowerCase=function(e){return e.map(function(e){return e.toLowerCase()})},e.removeElement=function(e,t){return e.filter(function(e){return e!==t})},e.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e.getLibraryVersion=function(){return"0.1.3"},e.replaceFirstPath=function(t,n){if(t.match(/^(https?\:)\/\/(([^:\/?#] *)(?:\:([0-9]+))?)([\/]{0,1}[^?#] *)(\?[^#] *|)(#. *|)$/)){var r=e.GetUrlComponents(t),o=r.PathSegments;o.shift(),(o[0]&&"common"===o[0]||"organizations"===o[0])&&(o[0]=n,t=r.Protocol+"//"+r.HostNameAndPort+"/"+o.join("/"))}return t},e.createNewGuid=function(){var t=window.crypto;if(t&&t.getRandomValues){var n=new Uint8Array(16);return t.getRandomValues(n),n[6]|=64,n[6]&=79,n[8]|=128,n[8]&=191,e.decimalToHex(n[0])+e.decimalToHex(n[1])+e.decimalToHex(n[2])+e.decimalToHex(n[3])+"-"+e.decimalToHex(n[4])+e.decimalToHex(n[5])+"-"+e.decimalToHex(n[6])+e.decimalToHex(n[7])+"-"+e.decimalToHex(n[8])+e.decimalToHex(n[9])+"-"+e.decimalToHex(n[10])+e.decimalToHex(n[11])+e.decimalToHex(n[12])+e.decimalToHex(n[13])+e.decimalToHex(n[14])+e.decimalToHex(n[15])}for(var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",i=0,s="",a=0;a<36;a++)"-"!==r[a]&&"4"!==r[a]&&(i=16*Math.random()|0),"x"===r[a]?s+=o[i]:"y"===r[a]?(i&=3,i|=8,s+=o[i]):s+=r[a];return s},e.GetUrlComponents=function(e){if(!e)throw"Url required";var t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=e.match(t);if(!n||n.length<6)throw"Valid url required";var r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5]},o=r.AbsolutePath.split("/");return o=o.filter(function(e){return e&&e.length>0}),r.PathSegments=o,r},e.CanonicalizeUri=function(t){return t&&(t=t.toLowerCase()),t&&!e.endsWith(t,"/")&&(t+="/"),t},e.endsWith=function(e,t){return!(!e||!t)&&-1!==e.indexOf(t,e.length-t.length)},e}();t.Utils=r},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function s(e,t){return function(n,r){t(n,r,e)}}function a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function u(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;c;)try{if(o=1,i&&(s=i[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,i=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(s=c.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function h(){for(var e=[],t=0;t1||o(e,t)})})}function o(e,t){try{i(l[e](t))}catch(e){c(d[0][3],e)}}function i(e){e.value instanceof f?Promise.resolve(e.value.v).then(s,a):c(d[0][2],e)}function s(e){o("next",e)}function a(e){o("throw",e)}function c(e,t){e(t),d.shift(),d.length&&o(d[0][0],d[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u,l=n.apply(e,t||[]),d=[];return u={},r("next"),r("throw"),r("return"),u[Symbol.asyncIterator]=function(){return this},u}function m(e){function t(t,o){e[t]&&(n[t]=function(n){return(r=!r)?{value:f(e[t](n)),done:"return"===t}:o?o(n):n})}var n,r;return n={},t("next"),t("throw",function(e){throw e}),t("return"),n[Symbol.iterator]=function(){return this},n}function y(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof d?d(e):e[Symbol.iterator]()}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=r,n.d(t,"__assign",function(){return _}),t.__rest=o,t.__decorate=i,t.__param=s,t.__metadata=a,t.__awaiter=c,t.__generator=u,t.__exportStar=l,t.__values=d,t.__read=p,t.__spread=h,t.__await=f,t.__asyncGenerator=g,t.__asyncDelegator=m,t.__asyncValues=y;/*! *****************************************************************************
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Msal",[],t):"object"==typeof exports?exports.Msal=t():e.Msal=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=9)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.compareObjects=function(e,t){return!(!e||!t)&&!(!e.userIdentifier||!t.userIdentifier||e.userIdentifier!==t.userIdentifier)},e.expiresIn=function(e){return e||(e="3599"),this.now()+parseInt(e,10)},e.now=function(){return Math.round((new Date).getTime()/1e3)},e.isEmpty=function(e){return void 0===e||!e||0===e.length},e.extractIdToken=function(e){var t=this.decodeJwt(e);if(!t)return null;try{var n=t.JWSPayload,r=this.base64DecodeStringUrlSafe(n);return r?JSON.parse(r):null}catch(e){}return null},e.base64EncodeStringUrlSafe=function(e){return window.btoa?window.btoa(e):this.encode(e)},e.base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(window.atob(e)):decodeURIComponent(this.decode(e))},e.encode=function(e){var t,n,r,o,i,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",l=0;for(e=this.utf8Encode(e);l>2,i=(3&t)<<4|n>>4,s=(15&n)<<2|r>>6,a=63&r,isNaN(n)?s=a=64:isNaN(r)&&(a=64),u=u+c.charAt(o)+c.charAt(i)+c.charAt(s)+c.charAt(a);return u.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},e.utf8Encode=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t},e.decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var n=e.length;if(n%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var r,o,i,s,a,c,u,l,d="",p=0;p>16&255,u=a>>8&255,d+=String.fromCharCode(c,u);break}if(p+1===n-1){a=r<<18|o<<12,c=a>>16&255,d+=String.fromCharCode(c);break}a=r<<18|o<<12|i<<6|s,c=a>>16&255,u=a>>8&255,l=255&a,d+=String.fromCharCode(c,u,l)}return d},e.decodeJwt=function(e){if(this.isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=t.exec(e);return!n||n.length<4?null:{header:n[1],JWSPayload:n[2],JWSSig:n[3]}},e.deserialize=function(e){var t,n=/\+/g,r=/([^&=]+)=([^&]*)/g,o=function(e){return decodeURIComponent(e.replace(n," "))},i={};for(t=r.exec(e);t;)i[o(t[1])]=o(t[2]),t=r.exec(e);return i},e.isIntersectingScopes=function(e,t){e=this.convertToLowerCase(e);for(var n=0;n-1)return!0;return!1},e.containsScope=function(e,t){return e=this.convertToLowerCase(e),t.every(function(t){return e.indexOf(t.toString().toLowerCase())>=0})},e.convertToLowerCase=function(e){return e.map(function(e){return e.toLowerCase()})},e.removeElement=function(e,t){return e.filter(function(e){return e!==t})},e.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e.getLibraryVersion=function(){return"0.1.5"},e.replaceFirstPath=function(t,n){if(t.match(/^(https?\:)\/\/(([^:\/?#] *)(?:\:([0-9]+))?)([\/]{0,1}[^?#] *)(\?[^#] *|)(#. *|)$/)){var r=e.GetUrlComponents(t),o=r.PathSegments;o.shift(),(o[0]&&"common"===o[0]||"organizations"===o[0])&&(o[0]=n,t=r.Protocol+"//"+r.HostNameAndPort+"/"+o.join("/"))}return t},e.createNewGuid=function(){var t=window.crypto;if(t&&t.getRandomValues){var n=new Uint8Array(16);return t.getRandomValues(n),n[6]|=64,n[6]&=79,n[8]|=128,n[8]&=191,e.decimalToHex(n[0])+e.decimalToHex(n[1])+e.decimalToHex(n[2])+e.decimalToHex(n[3])+"-"+e.decimalToHex(n[4])+e.decimalToHex(n[5])+"-"+e.decimalToHex(n[6])+e.decimalToHex(n[7])+"-"+e.decimalToHex(n[8])+e.decimalToHex(n[9])+"-"+e.decimalToHex(n[10])+e.decimalToHex(n[11])+e.decimalToHex(n[12])+e.decimalToHex(n[13])+e.decimalToHex(n[14])+e.decimalToHex(n[15])}for(var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",i=0,s="",a=0;a<36;a++)"-"!==r[a]&&"4"!==r[a]&&(i=16*Math.random()|0),"x"===r[a]?s+=o[i]:"y"===r[a]?(i&=3,i|=8,s+=o[i]):s+=r[a];return s},e.GetUrlComponents=function(e){if(!e)throw"Url required";var t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=e.match(t);if(!n||n.length<6)throw"Valid url required";var r={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5]},o=r.AbsolutePath.split("/");return o=o.filter(function(e){return e&&e.length>0}),r.PathSegments=o,r},e.CanonicalizeUri=function(t){return t&&(t=t.toLowerCase()),t&&!e.endsWith(t,"/")&&(t+="/"),t},e.endsWith=function(e,t){return!(!e||!t)&&-1!==e.indexOf(t,e.length-t.length)},e}();t.Utils=r},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function s(e,t){return function(n,r){t(n,r,e)}}function a(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})}function u(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(o)throw new TypeError("Generator is already executing.");for(;c;)try{if(o=1,i&&(s=i[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,i=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(s=c.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function h(){for(var e=[],t=0;t1||o(e,t)})})}function o(e,t){try{i(l[e](t))}catch(e){c(d[0][3],e)}}function i(e){e.value instanceof f?Promise.resolve(e.value.v).then(s,a):c(d[0][2],e)}function s(e){o("next",e)}function a(e){o("throw",e)}function c(e,t){e(t),d.shift(),d.length&&o(d[0][0],d[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u,l=n.apply(e,t||[]),d=[];return u={},r("next"),r("throw"),r("return"),u[Symbol.asyncIterator]=function(){return this},u}function m(e){function t(t,o){e[t]&&(n[t]=function(n){return(r=!r)?{value:f(e[t](n)),done:"return"===t}:o?o(n):n})}var n,r;return n={},t("next"),t("throw",function(e){throw e}),t("return"),n[Symbol.iterator]=function(){return this},n}function y(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof d?d(e):e[Symbol.iterator]()}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=r,n.d(t,"__assign",function(){return _}),t.__rest=o,t.__decorate=i,t.__param=s,t.__metadata=a,t.__awaiter=c,t.__generator=u,t.__exportStar=l,t.__values=d,t.__read=p,t.__spread=h,t.__await=f,t.__asyncGenerator=g,t.__asyncDelegator=m,t.__asyncValues=y;/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
diff --git a/dist/msal.min.js.map b/dist/msal.min.js.map
index b34299c3dd..7b0bf10f25 100644
--- a/dist/msal.min.js.map
+++ b/dist/msal.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///msal.min.js","webpack:///webpack/bootstrap 8eb1e34f7cca078cb254","webpack:///./src/Utils.ts","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./src/Logger.ts","webpack:///./src/Authority.ts","webpack:///./src/ErrorMessage.ts","webpack:///./src/Constants.ts","webpack:///./src/User.ts","webpack:///./src/AadAuthority.ts","webpack:///./src/XHRClient.ts","webpack:///./src/index.ts","webpack:///./src/UserAgentApplication.ts","webpack:///./src/AccessTokenKey.ts","webpack:///./src/AccessTokenValue.ts","webpack:///./src/AuthenticationRequestParameters.ts","webpack:///./src/ClientInfo.ts","webpack:///./src/IdToken.ts","webpack:///./src/Storage.ts","webpack:///./src/AccessTokenCacheItem.ts","webpack:///./src/RequestInfo.ts","webpack:///./src/AuthorityFactory.ts","webpack:///./src/B2cAuthority.ts"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","Utils","compareObjects","u1","u2","userIdentifier","expiresIn","expires","now","parseInt","Math","round","Date","getTime","isEmpty","str","length","extractIdToken","encodedIdToken","decodedToken","decodeJwt","base64IdToken","JWSPayload","base64Decoded","base64DecodeStringUrlSafe","JSON","parse","err","base64EncodeStringUrlSafe","input","window","btoa","encode","replace","atob","decodeURIComponent","decode","chr1","chr2","chr3","enc1","enc2","enc3","enc4","keyStr","output","utf8Encode","charCodeAt","isNaN","charAt","utftext","String","fromCharCode","codes","Error","h1","h2","h3","h4","bits","c1","c2","c3","decoded","indexOf","jwtToken","idTokenPartsRegex","matches","exec","header","JWSSig","deserialize","query","match","pl","search","obj","isIntersectingScopes","cachedScopes","scopes","convertToLowerCase","toLowerCase","containsScope","every","toString","map","scope","removeElement","filter","decimalToHex","num","hex","getLibraryVersion","replaceFirstPath","href","tenantId","urlObject","GetUrlComponents","pathArray","PathSegments","shift","Protocol","HostNameAndPort","join","createNewGuid","cryptoObj","crypto","getRandomValues","buffer","Uint8Array","guidHolder","r","guidResponse","random","url","regEx","RegExp","urlComponents","AbsolutePath","pathSegments","split","val","CanonicalizeUri","endsWith","suffix","__webpack_exports__","__extends","b","__","constructor","extendStatics","create","__rest","e","t","getOwnPropertySymbols","__decorate","decorators","target","key","desc","arguments","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","throw","result","done","then","apply","__generator","body","verb","v","op","f","TypeError","_","y","label","ops","pop","trys","push","g","sent","return","Symbol","iterator","__exportStar","__values","__read","ar","error","__spread","concat","__await","__asyncGenerator","a","q","resume","settle","fulfill","asyncIterator","__asyncDelegator","__asyncValues","__assign","setPrototypeOf","__proto__","Array","assign","LogLevel","Utils_1","Logger","localCallback","options","_level","Info","_a","correlationId","_b","level","_c","piiLoggingEnabled","_localCallback","_correlationId","_piiLoggingEnabled","logMessage","logLevel","containsPii","log","timestamp","toUTCString","executeCallback","message","errorPii","warning","Warning","warningPii","info","infoPii","verbose","Verbose","verbosePii","ErrorMessage_1","XHRClient_1","AuthorityType","Authority","authority","validateAuthority","IsValidationEnabled","CanonicalAuthority","validateAsUri","CanonicalAuthorityUrlComponents","validateResolved","tenantDiscoveryResponse","AuthorizationEndpoint","Tenant","EndSessionEndpoint","Issuer","canonicalAuthority","set","canonicalAuthorityUrlComponents","components","ErrorMessage","invalidAuthorityType","authorityUriInsecure","authorityUriInvalidPath","DiscoverEndpoints","openIdConfigurationEndpoint","XhrClient","sendRequestAsync","response","authorization_endpoint","end_session_endpoint","issuer","ResolveEndpointsAsync","_this","GetOpenIdConfigurationEndpointAsync","openIdConfigurationEndpointResponse","Constants","_popUpWidth","width","_popUpHeight","height","ErrorCodes","ErrorDescription","User","displayableId","identityProvider","idToken","createUser","clientInfo","uid","utid","preferredName","decodedIdToken","tslib_1","Authority_1","AadAuthority","_super","AadInstanceDiscoveryEndpoint","Aad","resultPromise","DefaultOpenIdConfigurationEndpoint","host","IsInTrustedHostList","AadInstanceDiscoveryEndpointUrl","tenant_discovery_endpoint","TrustedHostList","login.windows.net","login.chinacloudapi.cn","login.cloudgovapi.us","login.microsoftonline.com","login.microsoftonline.de","login.microsoftonline.us","method","enableCaching","xhr","XMLHttpRequest","open","onload","ev","status","handleError","responseText","jsonResponse","onerror","send","UserAgentApplication_1","UserAgentApplication","Logger_1","Logger_2","User_1","AccessTokenKey_1","AccessTokenValue_1","AuthenticationRequestParameters_1","ClientInfo_1","Constants_1","IdToken_1","Storage_1","RequestInfo_1","AuthorityFactory_1","ResponseTypes","id_token","token","id_token_token","resolveTokenOnlyIfOutOfIframe","propertyKey","descriptor","tokenAcquisitionMethod","args","_i","isInIframe","clientId","tokenReceivedCallback","_cacheLocations","localStorage","sessionStorage","_clockSkew","_tokenReceivedCallback","cacheLocation","redirectUri","location","_d","postLogoutRedirectUri","_e","logger","_f","loadFrameTimeout","_g","navigateToLoginRequestUrl","_redirectUri","_postLogoutredirectUri","_loginInProgress","_acquireTokenInProgress","_renewStates","_activeRenewals","_cacheLocation","_navigateToLoginRequestUrl","_cacheStorage","Storage","_logger","_openedWindows","msal","callBackMappedToRenewStates","callBacksMappedToRenewStates","urlHash","hash","isCallback","handleAuthenticationResponse","pendingCallback","getItem","processCallBack","authorityInstance","AuthorityFactory","CreateInstance","requestInfo","getRequestInfo","saveTokenFromHash","tokenType","parameters","accessToken","errorDesc","errorDescription","removeItem","loginRedirect","extraQueryParameters","isValidScope","validateInputScope","filterScopes","authenticationRequest","AuthenticationRequestParameters","setItem","loginRequest","loginError","stateLogin","state","nonceIdToken","nonce","msalError","msalErrorDescription","authorityKey","resourceDelimeter","urlNavigate","createNavigateUrl","_requestType","login","promptUser","loginPopup","loginProgressError","inputScopesError","popUpWindow","openWindow","registerCallback","endpointResolutionError","close","title","interval","instance","popupWindow","openPopup","popUpWidth","popUpHeight","popUpWindowError","pollTimer","setInterval","closed","userCancelledError","clearInterval","logout","clearCache","_user","encodeURIComponent","accessTokenItems","getAllAccessTokens","stringify","removeAcquireTokenEntries","acquireTokenUser","renewStatus","resetCacheItems","winLeft","screenLeft","screenX","winTop","screenTop","screenY","innerWidth","document","documentElement","clientWidth","innerHeight","clientHeight","left","top_1","focus","isArray","element","expectedState","getCachedToken","user","accessTokenCacheItem","tokenCacheItems","filteredItems","cacheItem","authorityList","getUniqueAuthority","expired","Number","offset","getAllUsers","users","accessTokenCacheItems","IdToken","ClientInfo","getUniqueUsers","flags","uniqueUsers","index","forEach","addHintParameters","userObject","getUser","decodedClientInfo","urlContainsQueryStringParameter","test","acquireTokenRedirect","userLoginError","acquireTokenAuthority","acquireTokenUserKey","stateAcquireToken","renewToken","acquireTokenPopup","acquireTokenProgressError","acquireTokenSilent","scope_1","userObject_1","authenticationRequest_1","newAuthority","cacheResult","renewIdToken","loadIframeTimeout","frameName","tokenRenewStatusInProgress","loadFrame","setTimeout","tokenRenewStatusCancelled","frameCheck","frameHandle","addAdalFrame","src","iframeId","adalFrame","getElementById","createElement","navigator","userAgent","ifr","setAttribute","style","visibility","position","border","getElementsByTagName","appendChild","insertAdjacentHTML","frames","rawIdToken","idTokenKey","rawClientInfo","msalClientInfo","self","isPopup","isWindowOpenerMsal","opener","parent","stateResponse","requestType","saveAccessToken","tokenResponse","clientObj","consentedScopes","accessTokenKey","AccessTokenKey","accessTokenValue","AccessTokenValue","expiration","stateMatch","sessionState","msalSessionState","tokenRenewStatusCompleted","getHash","substring","TokenResponse","valid","statesInParentContext","getScopeFromState","splitIndex","responseType","xClientSku","xClientVer","translateclientIdUsedInScope","parseScope","authEndpoint","clientIdIndex","splice","scopeList","_uid","_utid","objectId","subject","version","homeObjectId","AccessTokenCacheItem_1","_instance","_localStorageSupported","_sessionStorageSupported","clear","results","storage","AccessTokenCacheItem","acquireTokenStatus","AadAuthority_1","B2cAuthority_1","DetectAuthorityFromUrl","authorityUrl","B2C","Adfs","B2cAuthority","b2cAuthorityUriInvalidPath","unsupportedAuthorityValidation"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,UAAAH,GACA,gBAAAC,SACAA,QAAA,KAAAD,IAEAD,EAAA,KAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAtB,GACA,GAAAe,GA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AP,cAAAD,GAAA/S,KACMyU,EAAgB,GAAIjJ,SAAgB,SAACC,EAASC,GAChD,MAAAD,GAAQsH,EAAK2B,qCAEf,OAAK1U,MAAKoR,oBAINpR,KAAK4U,oBAAoB5U,KAAKuR,gCAAgCtJ,iBACzDwM,EAGF,GAAIjJ,SAAgB,SAACC,EAASC,GACnC,MAAAA,GAAOoF,EAAAoB,aAAa0V,kCARbnT,GAUbiT,GAnCkCN,EAAA/S,aAArBzU,GAAA8nB","file":"msal.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Msal\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Msal\"] = factory();\n\telse\n\t\troot[\"Msal\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Msal\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Msal\"] = factory();\n\telse\n\t\troot[\"Msal\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 9);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * @hidden\r\n */\r\nvar Utils = /** @class */ (function () {\r\n function Utils() {\r\n }\r\n Utils.compareObjects = function (u1, u2) {\r\n if (!u1 || !u2) {\r\n return false;\r\n }\r\n if (u1.userIdentifier && u2.userIdentifier) {\r\n if (u1.userIdentifier === u2.userIdentifier) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Utils.expiresIn = function (expires) {\r\n // if AAD did not send \"expires_in\" property, use default expiration of 3599 seconds, for some reason AAD sends 3599 as \"expires_in\" value instead of 3600\r\n if (!expires) {\r\n expires = \"3599\";\r\n }\r\n return this.now() + parseInt(expires, 10);\r\n };\r\n Utils.now = function () {\r\n return Math.round(new Date().getTime() / 1000.0);\r\n };\r\n Utils.isEmpty = function (str) {\r\n return (typeof str === \"undefined\" || !str || 0 === str.length);\r\n };\r\n Utils.extractIdToken = function (encodedIdToken) {\r\n // id token will be decoded to get the username\r\n var decodedToken = this.decodeJwt(encodedIdToken);\r\n if (!decodedToken) {\r\n return null;\r\n }\r\n try {\r\n var base64IdToken = decodedToken.JWSPayload;\r\n var base64Decoded = this.base64DecodeStringUrlSafe(base64IdToken);\r\n if (!base64Decoded) {\r\n //this._requestContext.logger.info(\"The returned id_token could not be base64 url safe decoded.\");\r\n return null;\r\n }\r\n // ECMA script has JSON built-in support\r\n return JSON.parse(base64Decoded);\r\n }\r\n catch (err) {\r\n //this._requestContext.logger.error(\"The returned id_token could not be decoded\" + err);\r\n }\r\n return null;\r\n };\r\n Utils.base64EncodeStringUrlSafe = function (input) {\r\n // html5 should support atob function for decoding\r\n if (window.btoa) {\r\n return window.btoa(input);\r\n }\r\n else {\r\n return this.encode(input);\r\n }\r\n };\r\n Utils.base64DecodeStringUrlSafe = function (base64IdToken) {\r\n // html5 should support atob function for decoding\r\n base64IdToken = base64IdToken.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n if (window.atob) {\r\n return decodeURIComponent(window.atob(base64IdToken)); // jshint ignore:line\r\n }\r\n else {\r\n return decodeURIComponent(this.decode(base64IdToken));\r\n }\r\n };\r\n Utils.encode = function (input) {\r\n var keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n var output = \"\";\r\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\r\n var i = 0;\r\n input = this.utf8Encode(input);\r\n while (i < input.length) {\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n }\r\n else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);\r\n }\r\n return output.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\r\n };\r\n Utils.utf8Encode = function (input) {\r\n input = input.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n for (var n = 0; n < input.length; n++) {\r\n var c = input.charCodeAt(n);\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n }\r\n return utftext;\r\n };\r\n Utils.decode = function (base64IdToken) {\r\n var codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n base64IdToken = String(base64IdToken).replace(/=+$/, \"\");\r\n var length = base64IdToken.length;\r\n if (length % 4 === 1) {\r\n throw new Error(\"The token to be decoded is not correctly encoded.\");\r\n }\r\n var h1, h2, h3, h4, bits, c1, c2, c3, decoded = \"\";\r\n for (var i = 0; i < length; i += 4) {\r\n //Every 4 base64 encoded character will be converted to 3 byte string, which is 24 bits\r\n // then 6 bits per base64 encoded character\r\n h1 = codes.indexOf(base64IdToken.charAt(i));\r\n h2 = codes.indexOf(base64IdToken.charAt(i + 1));\r\n h3 = codes.indexOf(base64IdToken.charAt(i + 2));\r\n h4 = codes.indexOf(base64IdToken.charAt(i + 3));\r\n // For padding, if last two are \"=\"\r\n if (i + 2 === length - 1) {\r\n bits = h1 << 18 | h2 << 12 | h3 << 6;\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n decoded += String.fromCharCode(c1, c2);\r\n break;\r\n }\r\n else if (i + 1 === length - 1) {\r\n bits = h1 << 18 | h2 << 12;\r\n c1 = bits >> 16 & 255;\r\n decoded += String.fromCharCode(c1);\r\n break;\r\n }\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n // then convert to 3 byte chars\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n c3 = bits & 255;\r\n decoded += String.fromCharCode(c1, c2, c3);\r\n }\r\n return decoded;\r\n };\r\n Utils.decodeJwt = function (jwtToken) {\r\n if (this.isEmpty(jwtToken)) {\r\n return null;\r\n }\r\n var idTokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n var matches = idTokenPartsRegex.exec(jwtToken);\r\n if (!matches || matches.length < 4) {\r\n //this._requestContext.logger.warn(\"The returned id_token is not parseable.\");\r\n return null;\r\n }\r\n var crackedToken = {\r\n header: matches[1],\r\n JWSPayload: matches[2],\r\n JWSSig: matches[3]\r\n };\r\n return crackedToken;\r\n };\r\n Utils.deserialize = function (query) {\r\n var match; // Regex for replacing addition symbol with a space\r\n var pl = /\\+/g;\r\n var search = /([^&=]+)=([^&]*)/g;\r\n var decode = function (s) { return decodeURIComponent(s.replace(pl, \" \")); };\r\n var obj = {};\r\n match = search.exec(query);\r\n while (match) {\r\n obj[decode(match[1])] = decode(match[2]);\r\n match = search.exec(query);\r\n }\r\n return obj;\r\n };\r\n Utils.isIntersectingScopes = function (cachedScopes, scopes) {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n for (var i = 0; i < scopes.length; i++) {\r\n if (cachedScopes.indexOf(scopes[i].toLowerCase()) > -1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n Utils.containsScope = function (cachedScopes, scopes) {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n return scopes.every(function (value) { return cachedScopes.indexOf(value.toString().toLowerCase()) >= 0; });\r\n };\r\n Utils.convertToLowerCase = function (scopes) {\r\n return scopes.map(function (scope) { return scope.toLowerCase(); });\r\n };\r\n Utils.removeElement = function (scopes, scope) {\r\n return scopes.filter(function (value) { return value !== scope; });\r\n };\r\n Utils.decimalToHex = function (num) {\r\n var hex = num.toString(16);\r\n while (hex.length < 2) {\r\n hex = \"0\" + hex;\r\n }\r\n return hex;\r\n };\r\n Utils.getLibraryVersion = function () {\r\n return \"0.1.3\";\r\n };\r\n /*\r\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\r\n * @param href The url\r\n * @param tenantId The tenant id to replace\r\n */\r\n Utils.replaceFirstPath = function (href, tenantId) {\r\n var match = href.match(/^(https?\\:)\\/\\/(([^:\\/?#] *)(?:\\:([0-9]+))?)([\\/]{0,1}[^?#] *)(\\?[^#] *|)(#. *|)$/);\r\n if (match) {\r\n var urlObject = Utils.GetUrlComponents(href);\r\n var pathArray = urlObject.PathSegments;\r\n pathArray.shift();\r\n if (pathArray[0] && pathArray[0] === \"common\" || pathArray[0] === \"organizations\") {\r\n pathArray[0] = tenantId;\r\n href = urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + pathArray.join(\"/\");\r\n }\r\n }\r\n return href;\r\n };\r\n Utils.createNewGuid = function () {\r\n // RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or\r\n // pseudo-random numbers.\r\n // The algorithm is as follows:\r\n // Set the two most significant bits (bits 6 and 7) of the\r\n // clock_seq_hi_and_reserved to zero and one, respectively.\r\n // Set the four most significant bits (bits 12 through 15) of the\r\n // time_hi_and_version field to the 4-bit version number from\r\n // Section 4.1.3. Version4\r\n // Set all the other bits to randomly (or pseudo-randomly) chosen\r\n // values.\r\n // UUID = time-low \"-\" time-mid \"-\"time-high-and-version \"-\"clock-seq-reserved and low(2hexOctet)\"-\" node\r\n // time-low = 4hexOctet\r\n // time-mid = 2hexOctet\r\n // time-high-and-version = 2hexOctet\r\n // clock-seq-and-reserved = hexOctet:\r\n // clock-seq-low = hexOctet\r\n // node = 6hexOctet\r\n // Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\r\n // y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10\r\n // y values are 8, 9, A, B\r\n var cryptoObj = window.crypto; // for IE 11\r\n if (cryptoObj && cryptoObj.getRandomValues) {\r\n var buffer = new Uint8Array(16);\r\n cryptoObj.getRandomValues(buffer);\r\n //buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).\r\n buffer[6] |= 0x40; //buffer[6] | 01000000 will set the 6 bit to 1.\r\n buffer[6] &= 0x4f; //buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = \"4\".\r\n //buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.\r\n buffer[8] |= 0x80; //buffer[8] | 10000000 will set the 7 bit to 1.\r\n buffer[8] &= 0xbf; //buffer[8] & 10111111 will set the 6 bit to 0.\r\n return Utils.decimalToHex(buffer[0]) + Utils.decimalToHex(buffer[1])\r\n + Utils.decimalToHex(buffer[2]) + Utils.decimalToHex(buffer[3])\r\n + \"-\" + Utils.decimalToHex(buffer[4]) + Utils.decimalToHex(buffer[5])\r\n + \"-\" + Utils.decimalToHex(buffer[6]) + Utils.decimalToHex(buffer[7])\r\n + \"-\" + Utils.decimalToHex(buffer[8]) + Utils.decimalToHex(buffer[9])\r\n + \"-\" + Utils.decimalToHex(buffer[10]) + Utils.decimalToHex(buffer[11])\r\n + Utils.decimalToHex(buffer[12]) + Utils.decimalToHex(buffer[13])\r\n + Utils.decimalToHex(buffer[14]) + Utils.decimalToHex(buffer[15]);\r\n }\r\n else {\r\n var guidHolder = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\";\r\n var hex = \"0123456789abcdef\";\r\n var r = 0;\r\n var guidResponse = \"\";\r\n for (var i = 0; i < 36; i++) {\r\n if (guidHolder[i] !== \"-\" && guidHolder[i] !== \"4\") {\r\n // each x and y needs to be random\r\n r = Math.random() * 16 | 0;\r\n }\r\n if (guidHolder[i] === \"x\") {\r\n guidResponse += hex[r];\r\n }\r\n else if (guidHolder[i] === \"y\") {\r\n // clock-seq-and-reserved first hex is filtered and remaining hex values are random\r\n r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??\r\n r |= 0x8; // set pos 3 to 1 as 1???\r\n guidResponse += hex[r];\r\n }\r\n else {\r\n guidResponse += guidHolder[i];\r\n }\r\n }\r\n return guidResponse;\r\n }\r\n };\r\n /*\r\n * Parses out the components from a url string.\r\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\r\n */\r\n Utils.GetUrlComponents = function (url) {\r\n if (!url) {\r\n throw \"Url required\";\r\n }\r\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\r\n var regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n var match = url.match(regEx);\r\n if (!match || match.length < 6) {\r\n throw \"Valid url required\";\r\n }\r\n var urlComponents = {\r\n Protocol: match[1],\r\n HostNameAndPort: match[4],\r\n AbsolutePath: match[5]\r\n };\r\n var pathSegments = urlComponents.AbsolutePath.split(\"/\");\r\n pathSegments = pathSegments.filter(function (val) { return val && val.length > 0; }); // remove empty elements\r\n urlComponents.PathSegments = pathSegments;\r\n return urlComponents;\r\n };\r\n /*\r\n * Given a url or path, append a trailing slash if one doesnt exist\r\n */\r\n Utils.CanonicalizeUri = function (url) {\r\n if (url) {\r\n url = url.toLowerCase();\r\n }\r\n if (url && !Utils.endsWith(url, \"/\")) {\r\n url += \"/\";\r\n }\r\n return url;\r\n };\r\n /*\r\n * Checks to see if the url ends with the suffix\r\n * Required because we are compiling for es5 instead of es6\r\n * @param url\r\n * @param str\r\n */\r\n Utils.endsWith = function (url, suffix) {\r\n if (!url || !suffix) {\r\n return false;\r\n }\r\n return url.indexOf(suffix, url.length - suffix.length) !== -1;\r\n };\r\n return Utils;\r\n}());\r\nexports.Utils = Utils;\r\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (immutable) */ __webpack_exports__[\"__extends\"] = __extends;\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__assign\", function() { return __assign; });\n/* harmony export (immutable) */ __webpack_exports__[\"__rest\"] = __rest;\n/* harmony export (immutable) */ __webpack_exports__[\"__decorate\"] = __decorate;\n/* harmony export (immutable) */ __webpack_exports__[\"__param\"] = __param;\n/* harmony export (immutable) */ __webpack_exports__[\"__metadata\"] = __metadata;\n/* harmony export (immutable) */ __webpack_exports__[\"__awaiter\"] = __awaiter;\n/* harmony export (immutable) */ __webpack_exports__[\"__generator\"] = __generator;\n/* harmony export (immutable) */ __webpack_exports__[\"__exportStar\"] = __exportStar;\n/* harmony export (immutable) */ __webpack_exports__[\"__values\"] = __values;\n/* harmony export (immutable) */ __webpack_exports__[\"__read\"] = __read;\n/* harmony export (immutable) */ __webpack_exports__[\"__spread\"] = __spread;\n/* harmony export (immutable) */ __webpack_exports__[\"__await\"] = __await;\n/* harmony export (immutable) */ __webpack_exports__[\"__asyncGenerator\"] = __asyncGenerator;\n/* harmony export (immutable) */ __webpack_exports__[\"__asyncDelegator\"] = __asyncDelegator;\n/* harmony export (immutable) */ __webpack_exports__[\"__asyncValues\"] = __asyncValues;\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nfunction __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Utils_1 = __webpack_require__(0);\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"Error\"] = 0] = \"Error\";\r\n LogLevel[LogLevel[\"Warning\"] = 1] = \"Warning\";\r\n LogLevel[LogLevel[\"Info\"] = 2] = \"Info\";\r\n LogLevel[LogLevel[\"Verbose\"] = 3] = \"Verbose\";\r\n})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));\r\nvar Logger = /** @class */ (function () {\r\n function Logger(localCallback, options) {\r\n if (options === void 0) { options = {}; }\r\n /*\r\n * @hidden\r\n */\r\n this._level = LogLevel.Info;\r\n var _a = options.correlationId, correlationId = _a === void 0 ? \"\" : _a, _b = options.level, level = _b === void 0 ? LogLevel.Info : _b, _c = options.piiLoggingEnabled, piiLoggingEnabled = _c === void 0 ? false : _c;\r\n this._localCallback = localCallback;\r\n this._correlationId = correlationId;\r\n this._level = level;\r\n this._piiLoggingEnabled = piiLoggingEnabled;\r\n }\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.logMessage = function (logLevel, logMessage, containsPii) {\r\n if ((logLevel > this._level) || (!this._piiLoggingEnabled && containsPii)) {\r\n return;\r\n }\r\n var timestamp = new Date().toUTCString();\r\n var log;\r\n if (!Utils_1.Utils.isEmpty(this._correlationId)) {\r\n log = timestamp + \":\" + this._correlationId + \"-\" + Utils_1.Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n else {\r\n log = timestamp + \":\" + Utils_1.Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n this.executeCallback(logLevel, log, containsPii);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.executeCallback = function (level, message, containsPii) {\r\n if (this._localCallback) {\r\n this._localCallback(level, message, containsPii);\r\n }\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.error = function (message) {\r\n this.logMessage(LogLevel.Error, message, false);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.errorPii = function (message) {\r\n this.logMessage(LogLevel.Error, message, true);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.warning = function (message) {\r\n this.logMessage(LogLevel.Warning, message, false);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.warningPii = function (message) {\r\n this.logMessage(LogLevel.Warning, message, true);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.info = function (message) {\r\n this.logMessage(LogLevel.Info, message, false);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.infoPii = function (message) {\r\n this.logMessage(LogLevel.Info, message, true);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.verbose = function (message) {\r\n this.logMessage(LogLevel.Verbose, message, false);\r\n };\r\n /*\r\n * @hidden\r\n */\r\n Logger.prototype.verbosePii = function (message) {\r\n this.logMessage(LogLevel.Verbose, message, true);\r\n };\r\n return Logger;\r\n}());\r\nexports.Logger = Logger;\r\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Utils_1 = __webpack_require__(0);\r\nvar ErrorMessage_1 = __webpack_require__(4);\r\nvar XHRClient_1 = __webpack_require__(8);\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n/*\r\n * @hidden\r\n */\r\nvar AuthorityType;\r\n(function (AuthorityType) {\r\n AuthorityType[AuthorityType[\"Aad\"] = 0] = \"Aad\";\r\n AuthorityType[AuthorityType[\"Adfs\"] = 1] = \"Adfs\";\r\n AuthorityType[AuthorityType[\"B2C\"] = 2] = \"B2C\";\r\n})(AuthorityType = exports.AuthorityType || (exports.AuthorityType = {}));\r\n/*\r\n * @hidden\r\n */\r\nvar Authority = /** @class */ (function () {\r\n function Authority(authority, validateAuthority) {\r\n this.IsValidationEnabled = validateAuthority;\r\n this.CanonicalAuthority = authority;\r\n this.validateAsUri();\r\n }\r\n Object.defineProperty(Authority.prototype, \"Tenant\", {\r\n get: function () {\r\n return this.CanonicalAuthorityUrlComponents.PathSegments[0];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"AuthorizationEndpoint\", {\r\n get: function () {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(\"{tenant}\", this.Tenant);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"EndSessionEndpoint\", {\r\n get: function () {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.EndSessionEndpoint.replace(\"{tenant}\", this.Tenant);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"SelfSignedJwtAudience\", {\r\n get: function () {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.Issuer.replace(\"{tenant}\", this.Tenant);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Authority.prototype.validateResolved = function () {\r\n if (!this.tenantDiscoveryResponse) {\r\n throw \"Please call ResolveEndpointsAsync first\";\r\n }\r\n };\r\n Object.defineProperty(Authority.prototype, \"CanonicalAuthority\", {\r\n /*\r\n * A URL that is the authority set by the developer\r\n */\r\n get: function () {\r\n return this.canonicalAuthority;\r\n },\r\n set: function (url) {\r\n this.canonicalAuthority = Utils_1.Utils.CanonicalizeUri(url);\r\n this.canonicalAuthorityUrlComponents = null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"CanonicalAuthorityUrlComponents\", {\r\n get: function () {\r\n if (!this.canonicalAuthorityUrlComponents) {\r\n this.canonicalAuthorityUrlComponents = Utils_1.Utils.GetUrlComponents(this.CanonicalAuthority);\r\n }\r\n return this.canonicalAuthorityUrlComponents;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"DefaultOpenIdConfigurationEndpoint\", {\r\n /*\r\n * // http://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\r\n */\r\n get: function () {\r\n return this.CanonicalAuthority + \"v2.0/.well-known/openid-configuration\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /*\r\n * Given a string, validate that it is of the form https://domain/path\r\n */\r\n Authority.prototype.validateAsUri = function () {\r\n var components;\r\n try {\r\n components = this.CanonicalAuthorityUrlComponents;\r\n }\r\n catch (e) {\r\n throw ErrorMessage_1.ErrorMessage.invalidAuthorityType;\r\n }\r\n if (!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\r\n throw ErrorMessage_1.ErrorMessage.authorityUriInsecure;\r\n }\r\n if (!components.PathSegments || components.PathSegments.length < 1) {\r\n throw ErrorMessage_1.ErrorMessage.authorityUriInvalidPath;\r\n }\r\n };\r\n /*\r\n * Calls the OIDC endpoint and returns the response\r\n */\r\n Authority.prototype.DiscoverEndpoints = function (openIdConfigurationEndpoint) {\r\n var client = new XHRClient_1.XhrClient();\r\n return client.sendRequestAsync(openIdConfigurationEndpoint, \"GET\", /*enableCaching: */ true)\r\n .then(function (response) {\r\n return {\r\n AuthorizationEndpoint: response.authorization_endpoint,\r\n EndSessionEndpoint: response.end_session_endpoint,\r\n Issuer: response.issuer\r\n };\r\n });\r\n };\r\n /*\r\n * Returns a promise.\r\n * Checks to see if the authority is in the cache\r\n * Discover endpoints via openid-configuration\r\n * If successful, caches the endpoint for later use in OIDC\r\n */\r\n Authority.prototype.ResolveEndpointsAsync = function () {\r\n var _this = this;\r\n var openIdConfigurationEndpoint = \"\";\r\n return this.GetOpenIdConfigurationEndpointAsync().then(function (openIdConfigurationEndpointResponse) {\r\n openIdConfigurationEndpoint = openIdConfigurationEndpointResponse;\r\n return _this.DiscoverEndpoints(openIdConfigurationEndpoint);\r\n }).then(function (tenantDiscoveryResponse) {\r\n _this.tenantDiscoveryResponse = tenantDiscoveryResponse;\r\n return _this;\r\n });\r\n };\r\n return Authority;\r\n}());\r\nexports.Authority = Authority;\r\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * @hidden\r\n */\r\nvar ErrorMessage = /** @class */ (function () {\r\n function ErrorMessage() {\r\n }\r\n Object.defineProperty(ErrorMessage, \"authorityUriInvalidPath\", {\r\n get: function () { return \"AuthorityUriInvalidPath\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorMessage, \"authorityUriInsecure\", {\r\n get: function () { return \"AuthorityUriInsecure\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorMessage, \"invalidAuthorityType\", {\r\n get: function () { return \"InvalidAuthorityType\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorMessage, \"unsupportedAuthorityValidation\", {\r\n get: function () { return \"UnsupportedAuthorityValidation\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorMessage, \"b2cAuthorityUriInvalidPath\", {\r\n get: function () { return \"B2cAuthorityUriInvalidPath\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ErrorMessage;\r\n}());\r\nexports.ErrorMessage = ErrorMessage;\r\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * @hidden\r\n */\r\nvar Constants = /** @class */ (function () {\r\n function Constants() {\r\n }\r\n Object.defineProperty(Constants, \"errorDescription\", {\r\n get: function () { return \"error_description\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"error\", {\r\n get: function () { return \"error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"scope\", {\r\n get: function () { return \"scope\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"acquireTokenUser\", {\r\n get: function () { return \"msal_acquireTokenUser\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"clientInfo\", {\r\n get: function () { return \"client_info\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"clientId\", {\r\n get: function () { return \"clientId\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"authority\", {\r\n get: function () { return \"authority\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"idToken\", {\r\n get: function () { return \"id_token\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"accessToken\", {\r\n get: function () { return \"access_token\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"expiresIn\", {\r\n get: function () { return \"expires_in\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"sessionState\", {\r\n get: function () { return \"session_state\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"msalClientInfo\", {\r\n get: function () { return \"msal.client.info\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"msalError\", {\r\n get: function () { return \"msal.error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"msalErrorDescription\", {\r\n get: function () { return \"msal.error.description\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"msalSessionState\", {\r\n get: function () { return \"msal.session.state\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"tokenKeys\", {\r\n get: function () { return \"msal.token.keys\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"accessTokenKey\", {\r\n get: function () { return \"msal.access.token.key\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"expirationKey\", {\r\n get: function () { return \"msal.expiration.key\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"stateLogin\", {\r\n get: function () { return \"msal.state.login\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"stateAcquireToken\", {\r\n get: function () { return \"msal.state.acquireToken\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"stateRenew\", {\r\n get: function () { return \"msal.state.renew\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"nonceIdToken\", {\r\n get: function () { return \"msal.nonce.idtoken\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"userName\", {\r\n get: function () { return \"msal.username\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"idTokenKey\", {\r\n get: function () { return \"msal.idtoken\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"loginRequest\", {\r\n get: function () { return \"msal.login.request\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"loginError\", {\r\n get: function () { return \"msal.login.error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"renewStatus\", {\r\n get: function () { return \"msal.token.renew.status\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"msal\", {\r\n get: function () { return \"msal\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"resourceDelimeter\", {\r\n get: function () { return \"|\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"tokenRenewStatusCancelled\", {\r\n get: function () { return \"Canceled\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"tokenRenewStatusCompleted\", {\r\n get: function () { return \"Completed\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"tokenRenewStatusInProgress\", {\r\n get: function () { return \"In Progress\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"popUpWidth\", {\r\n get: function () { return this._popUpWidth; },\r\n set: function (width) {\r\n this._popUpWidth = width;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"popUpHeight\", {\r\n get: function () { return this._popUpHeight; },\r\n set: function (height) {\r\n this._popUpHeight = height;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"login\", {\r\n get: function () { return \"LOGIN\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"renewToken\", {\r\n get: function () { return \"renewToken\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"unknown\", {\r\n get: function () { return \"UNKNOWN\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"urlHash\", {\r\n get: function () { return \"msal.urlHash\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Constants._popUpWidth = 483;\r\n Constants._popUpHeight = 600;\r\n return Constants;\r\n}());\r\nexports.Constants = Constants;\r\n/*\r\n * @hidden\r\n */\r\nvar ErrorCodes = /** @class */ (function () {\r\n function ErrorCodes() {\r\n }\r\n Object.defineProperty(ErrorCodes, \"loginProgressError\", {\r\n get: function () { return \"login_progress_error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorCodes, \"acquireTokenProgressError\", {\r\n get: function () { return \"acquiretoken_progress_error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorCodes, \"inputScopesError\", {\r\n get: function () { return \"input_scopes_error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorCodes, \"endpointResolutionError\", {\r\n get: function () { return \"endpoints_resolution_error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorCodes, \"popUpWindowError\", {\r\n get: function () { return \"popup_window_error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorCodes, \"userLoginError\", {\r\n get: function () { return \"user_login_error\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorCodes, \"userCancelledError\", {\r\n get: function () { return \"user_cancelled\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ErrorCodes;\r\n}());\r\nexports.ErrorCodes = ErrorCodes;\r\n/*\r\n * @hidden\r\n */\r\nvar ErrorDescription = /** @class */ (function () {\r\n function ErrorDescription() {\r\n }\r\n Object.defineProperty(ErrorDescription, \"loginProgressError\", {\r\n get: function () { return \"Login is in progress\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorDescription, \"acquireTokenProgressError\", {\r\n get: function () { return \"Acquire token is in progress\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorDescription, \"inputScopesError\", {\r\n get: function () { return \"Invalid value of input scopes provided\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorDescription, \"endpointResolutionError\", {\r\n get: function () { return \"Endpoints cannot be resolved\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorDescription, \"popUpWindowError\", {\r\n get: function () { return \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorDescription, \"userLoginError\", {\r\n get: function () { return \"User login is required\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ErrorDescription, \"userCancelledError\", {\r\n get: function () { return \"User closed the popup window window and cancelled the flow\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ErrorDescription;\r\n}());\r\nexports.ErrorDescription = ErrorDescription;\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Utils_1 = __webpack_require__(0);\r\nvar User = /** @class */ (function () {\r\n /*\r\n * @hidden\r\n */\r\n function User(displayableId, name, identityProvider, userIdentifier, idToken) {\r\n this.displayableId = displayableId;\r\n this.name = name;\r\n this.identityProvider = identityProvider;\r\n this.userIdentifier = userIdentifier;\r\n this.idToken = idToken;\r\n }\r\n /*\r\n * @hidden\r\n */\r\n User.createUser = function (idToken, clientInfo, authority) {\r\n var uid;\r\n var utid;\r\n if (!clientInfo) {\r\n uid = \"\";\r\n utid = \"\";\r\n }\r\n else {\r\n uid = clientInfo.uid;\r\n utid = clientInfo.utid;\r\n }\r\n var userIdentifier = Utils_1.Utils.base64EncodeStringUrlSafe(uid) + \".\" + Utils_1.Utils.base64EncodeStringUrlSafe(utid);\r\n return new User(idToken.preferredName, idToken.name, idToken.issuer, userIdentifier, idToken.decodedIdToken);\r\n };\r\n return User;\r\n}());\r\nexports.User = User;\r\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(1);\r\nvar Authority_1 = __webpack_require__(3);\r\nvar XHRClient_1 = __webpack_require__(8);\r\n/**\r\n * @hidden\r\n */\r\nvar AadAuthority = /** @class */ (function (_super) {\r\n tslib_1.__extends(AadAuthority, _super);\r\n function AadAuthority(authority, validateAuthority) {\r\n return _super.call(this, authority, validateAuthority) || this;\r\n }\r\n Object.defineProperty(AadAuthority.prototype, \"AadInstanceDiscoveryEndpointUrl\", {\r\n get: function () {\r\n return AadAuthority.AadInstanceDiscoveryEndpoint + \"?api-version=1.0&authorization_endpoint=\" + this.CanonicalAuthority + \"oauth2/v2.0/authorize\";\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(AadAuthority.prototype, \"AuthorityType\", {\r\n get: function () {\r\n return Authority_1.AuthorityType.Aad;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns a promise which resolves to the OIDC endpoint\r\n * Only responds with the endpoint\r\n */\r\n AadAuthority.prototype.GetOpenIdConfigurationEndpointAsync = function () {\r\n var _this = this;\r\n var resultPromise = new Promise(function (resolve, reject) {\r\n return resolve(_this.DefaultOpenIdConfigurationEndpoint);\r\n });\r\n if (!this.IsValidationEnabled) {\r\n return resultPromise;\r\n }\r\n var host = this.CanonicalAuthorityUrlComponents.HostNameAndPort;\r\n if (this.IsInTrustedHostList(host)) {\r\n return resultPromise;\r\n }\r\n var client = new XHRClient_1.XhrClient();\r\n return client.sendRequestAsync(this.AadInstanceDiscoveryEndpointUrl, \"GET\", true)\r\n .then(function (response) {\r\n return response.tenant_discovery_endpoint;\r\n });\r\n };\r\n /**\r\n * Checks to see if the host is in a list of trusted hosts\r\n * @param {string} The host to look up\r\n */\r\n AadAuthority.prototype.IsInTrustedHostList = function (host) {\r\n return AadAuthority.TrustedHostList[host.toLowerCase()];\r\n };\r\n AadAuthority.AadInstanceDiscoveryEndpoint = \"https://login.microsoftonline.com/common/discovery/instance\";\r\n AadAuthority.TrustedHostList = {\r\n \"login.windows.net\": \"login.windows.net\",\r\n \"login.chinacloudapi.cn\": \"login.chinacloudapi.cn\",\r\n \"login.cloudgovapi.us\": \"login.cloudgovapi.us\",\r\n \"login.microsoftonline.com\": \"login.microsoftonline.com\",\r\n \"login.microsoftonline.de\": \"login.microsoftonline.de\",\r\n \"login.microsoftonline.us\": \"login.microsoftonline.us\"\r\n };\r\n return AadAuthority;\r\n}(Authority_1.Authority));\r\nexports.AadAuthority = AadAuthority;\r\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * XHR client for JSON endpoints\r\n * https://www.npmjs.com/package/async-promise\r\n * @hidden\r\n */\r\nvar XhrClient = /** @class */ (function () {\r\n function XhrClient() {\r\n }\r\n XhrClient.prototype.sendRequestAsync = function (url, method, enableCaching) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url, /*async: */ true);\r\n if (enableCaching) {\r\n // TODO: (shivb) ensure that this can be cached\r\n // xhr.setRequestHeader(\"Cache-Control\", \"Public\");\r\n }\r\n xhr.onload = function (ev) {\r\n if (xhr.status < 200 || xhr.status >= 300) {\r\n reject(_this.handleError(xhr.responseText));\r\n }\r\n try {\r\n var jsonResponse = JSON.parse(xhr.responseText);\r\n }\r\n catch (e) {\r\n reject(_this.handleError(xhr.responseText));\r\n }\r\n resolve(jsonResponse);\r\n };\r\n xhr.onerror = function (ev) {\r\n reject(xhr.status);\r\n };\r\n if (method === \"GET\") {\r\n xhr.send();\r\n }\r\n else {\r\n throw \"not implemented\";\r\n }\r\n });\r\n };\r\n XhrClient.prototype.handleError = function (responseText) {\r\n var jsonResponse;\r\n try {\r\n jsonResponse = JSON.parse(responseText);\r\n if (jsonResponse.error) {\r\n return jsonResponse.error;\r\n }\r\n else {\r\n throw responseText;\r\n }\r\n }\r\n catch (e) {\r\n return responseText;\r\n }\r\n };\r\n return XhrClient;\r\n}());\r\nexports.XhrClient = XhrClient;\r\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(10);\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar UserAgentApplication_1 = __webpack_require__(11);\r\nexports.UserAgentApplication = UserAgentApplication_1.UserAgentApplication;\r\nvar Logger_1 = __webpack_require__(2);\r\nexports.Logger = Logger_1.Logger;\r\nvar Logger_2 = __webpack_require__(2);\r\nexports.LogLevel = Logger_2.LogLevel;\r\nvar User_1 = __webpack_require__(6);\r\nexports.User = User_1.User;\r\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(1);\r\nvar AccessTokenKey_1 = __webpack_require__(12);\r\nvar AccessTokenValue_1 = __webpack_require__(13);\r\nvar AuthenticationRequestParameters_1 = __webpack_require__(14);\r\nvar ClientInfo_1 = __webpack_require__(15);\r\nvar Constants_1 = __webpack_require__(5);\r\nvar IdToken_1 = __webpack_require__(16);\r\nvar Logger_1 = __webpack_require__(2);\r\nvar Storage_1 = __webpack_require__(17);\r\nvar RequestInfo_1 = __webpack_require__(19);\r\nvar User_1 = __webpack_require__(6);\r\nvar Utils_1 = __webpack_require__(0);\r\nvar AuthorityFactory_1 = __webpack_require__(20);\r\n/*\r\n * @hidden\r\n */\r\nvar ResponseTypes = {\r\n id_token: \"id_token\",\r\n token: \"token\",\r\n id_token_token: \"id_token token\"\r\n};\r\nvar resolveTokenOnlyIfOutOfIframe = function (target, propertyKey, descriptor) {\r\n var tokenAcquisitionMethod = descriptor.value;\r\n descriptor.value = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n return this.isInIframe()\r\n ? new Promise(function () { })\r\n : tokenAcquisitionMethod.apply(this, args);\r\n };\r\n return descriptor;\r\n};\r\nvar UserAgentApplication = /** @class */ (function () {\r\n /*\r\n * Initialize a UserAgentApplication with a given clientId and authority.\r\n * @constructor\r\n * @param {string} clientId - The clientID of your application, you should get this from the application registration portal.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<instance>/<tenant>,\\ where <instance> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenantId>/<policyName>/\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param _tokenReceivedCallback - The function that will get the call back once this API is completed (either successfully or with a failure).\r\n * @param {boolean} validateAuthority - boolean to turn authority validation on/off.\r\n */\r\n function UserAgentApplication(clientId, authority, tokenReceivedCallback, options) {\r\n if (options === void 0) { options = {}; }\r\n /*\r\n * @hidden\r\n */\r\n this._cacheLocations = {\r\n localStorage: \"localStorage\",\r\n sessionStorage: \"sessionStorage\"\r\n };\r\n /*\r\n * @hidden\r\n */\r\n this._clockSkew = 300;\r\n /*\r\n * @hidden\r\n */\r\n this._tokenReceivedCallback = null;\r\n var _a = options.validateAuthority, validateAuthority = _a === void 0 ? true : _a, _b = options.cacheLocation, cacheLocation = _b === void 0 ? \"sessionStorage\" : _b, _c = options.redirectUri, redirectUri = _c === void 0 ? window.location.href.split(\"?\")[0].split(\"#\")[0] : _c, _d = options.postLogoutRedirectUri, postLogoutRedirectUri = _d === void 0 ? window.location.href.split(\"?\")[0].split(\"#\")[0] : _d, _e = options.logger, logger = _e === void 0 ? new Logger_1.Logger(null) : _e, _f = options.loadFrameTimeout, loadFrameTimeout = _f === void 0 ? 6000 : _f, _g = options.navigateToLoginRequestUrl, navigateToLoginRequestUrl = _g === void 0 ? true : _g;\r\n this.loadFrameTimeout = loadFrameTimeout;\r\n this.clientId = clientId;\r\n this.validateAuthority = validateAuthority;\r\n this.authority = authority || \"https://login.microsoftonline.com/common\";\r\n this._tokenReceivedCallback = tokenReceivedCallback;\r\n this._redirectUri = redirectUri;\r\n this._postLogoutredirectUri = postLogoutRedirectUri;\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n this._renewStates = [];\r\n this._activeRenewals = {};\r\n this._cacheLocation = cacheLocation;\r\n this._navigateToLoginRequestUrl = navigateToLoginRequestUrl;\r\n if (!this._cacheLocations[cacheLocation]) {\r\n throw new Error(\"Cache Location is not valid. Provided value:\" + this._cacheLocation + \".Possible values are: \" + this._cacheLocations.localStorage + \", \" + this._cacheLocations.sessionStorage);\r\n }\r\n this._cacheStorage = new Storage_1.Storage(this._cacheLocation); //cache keys msal\r\n this._logger = logger;\r\n this._openedWindows = [];\r\n window.msal = this;\r\n window.callBackMappedToRenewStates = {};\r\n window.callBacksMappedToRenewStates = {};\r\n var urlHash = window.location.hash;\r\n var isCallback = this.isCallback(urlHash);\r\n if (isCallback) {\r\n this.handleAuthenticationResponse.call(this, urlHash);\r\n }\r\n else {\r\n var pendingCallback = this._cacheStorage.getItem(Constants_1.Constants.urlHash);\r\n if (pendingCallback) {\r\n this.processCallBack(pendingCallback);\r\n }\r\n }\r\n }\r\n Object.defineProperty(UserAgentApplication.prototype, \"cacheLocation\", {\r\n /*\r\n * Used to get the cache location\r\n */\r\n get: function () {\r\n return this._cacheLocation;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(UserAgentApplication.prototype, \"authority\", {\r\n /*\r\n * Used to get the authority.\r\n */\r\n get: function () {\r\n return this.authorityInstance.CanonicalAuthority;\r\n },\r\n /*\r\n * Used to set the authority.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n */\r\n set: function (val) {\r\n this.authorityInstance = AuthorityFactory_1.AuthorityFactory.CreateInstance(val, this.validateAuthority);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /*\r\n * Used to call the constructor callback with the token/error\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.processCallBack = function (hash) {\r\n this._logger.info('Processing the callback from redirect response');\r\n var requestInfo = this.getRequestInfo(hash);\r\n this.saveTokenFromHash(requestInfo);\r\n var token = requestInfo.parameters[Constants_1.Constants.accessToken] || requestInfo.parameters[Constants_1.Constants.idToken];\r\n var errorDesc = requestInfo.parameters[Constants_1.Constants.errorDescription];\r\n var error = requestInfo.parameters[Constants_1.Constants.error];\r\n var tokenType;\r\n if (requestInfo.parameters[Constants_1.Constants.accessToken]) {\r\n tokenType = Constants_1.Constants.accessToken;\r\n }\r\n else {\r\n tokenType = Constants_1.Constants.idToken;\r\n }\r\n this._cacheStorage.removeItem(Constants_1.Constants.urlHash);\r\n try {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback.call(this, errorDesc, token, error, tokenType);\r\n }\r\n }\r\n catch (err) {\r\n this._logger.error(\"Error occurred in token received callback function: \" + err);\r\n }\r\n };\r\n /*\r\n * Initiate the login process by redirecting the user to the STS authorization endpoint.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the authentication server during the interactive authentication flow.\r\n */\r\n UserAgentApplication.prototype.loginRedirect = function (scopes, extraQueryParameters) {\r\n var _this = this;\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n if (this._loginInProgress) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(\"Login is in progress\", null, null, Constants_1.Constants.idToken);\r\n return;\r\n }\r\n }\r\n if (scopes) {\r\n var isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils_1.Utils.isEmpty(isValidScope)) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(isValidScope, null, null, Constants_1.Constants.idToken);\r\n return;\r\n }\r\n }\r\n scopes = this.filterScopes(scopes);\r\n }\r\n this.authorityInstance.ResolveEndpointsAsync()\r\n .then(function () {\r\n var authenticationRequest = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(_this.authorityInstance, _this.clientId, scopes, ResponseTypes.id_token, _this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n _this._cacheStorage.setItem(Constants_1.Constants.loginRequest, window.location.href);\r\n _this._cacheStorage.setItem(Constants_1.Constants.loginError, \"\");\r\n _this._cacheStorage.setItem(Constants_1.Constants.stateLogin, authenticationRequest.state);\r\n _this._cacheStorage.setItem(Constants_1.Constants.nonceIdToken, authenticationRequest.nonce);\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalError, \"\");\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, \"\");\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(_this._cacheStorage.getItem(authorityKey))) {\r\n _this._cacheStorage.setItem(authorityKey, _this.authority);\r\n }\r\n var urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n _this._loginInProgress = true;\r\n _this._requestType = Constants_1.Constants.login;\r\n _this.promptUser(urlNavigate);\r\n });\r\n };\r\n /*\r\n * Initiate the login process by opening a popup window.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the interactive authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the token or error.\r\n */\r\n UserAgentApplication.prototype.loginPopup = function (scopes, extraQueryParameters) {\r\n var _this = this;\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n return new Promise(function (resolve, reject) {\r\n if (_this._loginInProgress) {\r\n reject(Constants_1.ErrorCodes.loginProgressError + \":\" + Constants_1.ErrorDescription.loginProgressError);\r\n return;\r\n }\r\n if (scopes) {\r\n var isValidScope = _this.validateInputScope(scopes);\r\n if (isValidScope && !Utils_1.Utils.isEmpty(isValidScope)) {\r\n reject(Constants_1.ErrorCodes.inputScopesError + \":\" + Constants_1.ErrorDescription.inputScopesError);\r\n return;\r\n }\r\n scopes = _this.filterScopes(scopes);\r\n }\r\n else {\r\n scopes = [_this.clientId];\r\n }\r\n var scope = scopes.join(\" \").toLowerCase();\r\n var popUpWindow = _this.openWindow(\"about:blank\", \"_blank\", 1, _this, resolve, reject);\r\n if (!popUpWindow) {\r\n return;\r\n }\r\n _this.authorityInstance.ResolveEndpointsAsync().then(function () {\r\n var authenticationRequest = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(_this.authorityInstance, _this.clientId, scopes, ResponseTypes.id_token, _this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n _this._cacheStorage.setItem(Constants_1.Constants.loginRequest, window.location.href);\r\n _this._cacheStorage.setItem(Constants_1.Constants.loginError, \"\");\r\n _this._cacheStorage.setItem(Constants_1.Constants.nonceIdToken, authenticationRequest.nonce);\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalError, \"\");\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, \"\");\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(_this._cacheStorage.getItem(authorityKey))) {\r\n _this._cacheStorage.setItem(authorityKey, _this.authority);\r\n }\r\n var urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n _this._renewStates.push(authenticationRequest.state);\r\n _this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n _this._requestType = Constants_1.Constants.login;\r\n _this._loginInProgress = true;\r\n if (popUpWindow) {\r\n _this._logger.infoPii(\"Navigated Popup window to:\" + urlNavigate);\r\n popUpWindow.location.href = urlNavigate;\r\n }\r\n }, function () {\r\n _this._logger.info(Constants_1.ErrorCodes.endpointResolutionError + \":\" + Constants_1.ErrorDescription.endpointResolutionError);\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalError, Constants_1.ErrorCodes.endpointResolutionError);\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, Constants_1.ErrorDescription.endpointResolutionError);\r\n if (reject) {\r\n reject(Constants_1.ErrorCodes.endpointResolutionError + \":\" + Constants_1.ErrorDescription.endpointResolutionError);\r\n }\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n });\r\n });\r\n };\r\n /*\r\n * Used to redirect the browser to the STS authorization endpoint\r\n * @param {string} urlNavigate - URL of the authorization endpoint\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.promptUser = function (urlNavigate) {\r\n if (urlNavigate && !Utils_1.Utils.isEmpty(urlNavigate)) {\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n window.location.replace(urlNavigate);\r\n }\r\n else {\r\n this._logger.info(\"Navigate url is empty\");\r\n }\r\n };\r\n /*\r\n * Used to send the user to the redirect_uri after authentication is complete. The user\"s bearer token is attached to the URI fragment as an id_token/access_token field.\r\n * This function also closes the popup window after redirection.\r\n * @hidden\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.openWindow = function (urlNavigate, title, interval, instance, resolve, reject) {\r\n var _this = this;\r\n var popupWindow = this.openPopup(urlNavigate, title, Constants_1.Constants.popUpWidth, Constants_1.Constants.popUpHeight);\r\n if (popupWindow == null) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n this._logger.info(Constants_1.ErrorCodes.popUpWindowError + \":\" + Constants_1.ErrorDescription.popUpWindowError);\r\n this._cacheStorage.setItem(Constants_1.Constants.msalError, Constants_1.ErrorCodes.popUpWindowError);\r\n this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, Constants_1.ErrorDescription.popUpWindowError);\r\n if (reject) {\r\n reject(Constants_1.ErrorCodes.popUpWindowError + \":\" + Constants_1.ErrorDescription.popUpWindowError);\r\n }\r\n return null;\r\n }\r\n this._openedWindows.push(popupWindow);\r\n var pollTimer = window.setInterval(function () {\r\n if (popupWindow && popupWindow.closed && instance._loginInProgress) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n if (reject) {\r\n reject(Constants_1.ErrorCodes.userCancelledError + \":\" + Constants_1.ErrorDescription.userCancelledError);\r\n }\r\n window.clearInterval(pollTimer);\r\n }\r\n try {\r\n var popUpWindowLocation = popupWindow.location;\r\n if (popUpWindowLocation.href.indexOf(_this._redirectUri) !== -1) {\r\n window.clearInterval(pollTimer);\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n _this._logger.info(\"Closing popup window\");\r\n }\r\n }\r\n catch (e) {\r\n //Cross Domain url check error. Will be thrown until AAD redirects the user back to the app\"s root page with the token. No need to log or throw this error as it will create unnecessary traffic.\r\n }\r\n }, interval);\r\n return popupWindow;\r\n };\r\n /*\r\n * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Defaults behaviour is to redirect the user to `window.location.href`.\r\n */\r\n UserAgentApplication.prototype.logout = function () {\r\n this.clearCache();\r\n this._user = null;\r\n var logout = \"\";\r\n if (this._postLogoutredirectUri) {\r\n logout = \"post_logout_redirect_uri=\" + encodeURIComponent(this._postLogoutredirectUri);\r\n }\r\n var urlNavigate = this.authority + \"/oauth2/v2.0/logout?\" + logout;\r\n this.promptUser(urlNavigate);\r\n };\r\n /*\r\n * Used to configure the popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.clearCache = function () {\r\n this._renewStates = [];\r\n var accessTokenItems = this._cacheStorage.getAllAccessTokens(Constants_1.Constants.clientId, Constants_1.Constants.authority);\r\n for (var i = 0; i < accessTokenItems.length; i++) {\r\n this._cacheStorage.removeItem(JSON.stringify(accessTokenItems[i].key));\r\n }\r\n this._cacheStorage.removeAcquireTokenEntries(Constants_1.Constants.acquireTokenUser, Constants_1.Constants.renewStatus);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter, Constants_1.Constants.renewStatus);\r\n this._cacheStorage.resetCacheItems();\r\n };\r\n /*\r\n * Configures popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.openPopup = function (urlNavigate, title, popUpWidth, popUpHeight) {\r\n try {\r\n /*\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n var winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n var winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /*\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n var left = ((width / 2) - (popUpWidth / 2)) + winLeft;\r\n var top_1 = ((height / 2) - (popUpHeight / 2)) + winTop;\r\n var popupWindow = window.open(urlNavigate, title, \"width=\" + popUpWidth + \", height=\" + popUpHeight + \", top=\" + top_1 + \", left=\" + left);\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n return popupWindow;\r\n }\r\n catch (e) {\r\n this._logger.error(\"error opening popup \" + e.message);\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n return null;\r\n }\r\n };\r\n /*\r\n * Used to validate the scopes input parameter requested by the developer.\r\n * @param {Array} scopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.validateInputScope = function (scopes) {\r\n if (!scopes || scopes.length < 1) {\r\n return \"Scopes cannot be passed as an empty array\";\r\n }\r\n if (!Array.isArray(scopes)) {\r\n throw new Error(\"API does not accept non-array scopes\");\r\n }\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n if (scopes.length > 1) {\r\n return \"ClientId can only be provided as a single scope\";\r\n }\r\n }\r\n return \"\";\r\n };\r\n /*\r\n * Used to remove openid and profile from the list of scopes passed by the developer.These scopes are added by default\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.filterScopes = function (scopes) {\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"openid\";\r\n });\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"profile\";\r\n });\r\n return scopes;\r\n };\r\n /*\r\n * Used to add the developer requested callback to the array of callbacks for the specified scopes. The updated array is stored on the window object\r\n * @param {string} scope - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} expectedState - Unique state identifier (guid).\r\n * @param {Function} resolve - The resolve function of the promise object.\r\n * @param {Function} reject - The reject function of the promise object.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.registerCallback = function (expectedState, scope, resolve, reject) {\r\n var _this = this;\r\n this._activeRenewals[scope] = expectedState;\r\n if (!window.callBacksMappedToRenewStates[expectedState]) {\r\n window.callBacksMappedToRenewStates[expectedState] = [];\r\n }\r\n window.callBacksMappedToRenewStates[expectedState].push({ resolve: resolve, reject: reject });\r\n if (!window.callBackMappedToRenewStates[expectedState]) {\r\n window.callBackMappedToRenewStates[expectedState] =\r\n function (errorDesc, token, error, tokenType) {\r\n _this._activeRenewals[scope] = null;\r\n for (var i = 0; i < window.callBacksMappedToRenewStates[expectedState].length; ++i) {\r\n try {\r\n if (errorDesc || error) {\r\n window.callBacksMappedToRenewStates[expectedState][i].reject(errorDesc + \": \" + error);\r\n }\r\n else if (token) {\r\n window.callBacksMappedToRenewStates[expectedState][i].resolve(token);\r\n }\r\n }\r\n catch (e) {\r\n _this._logger.warning(e);\r\n }\r\n }\r\n window.callBacksMappedToRenewStates[expectedState] = null;\r\n window.callBackMappedToRenewStates[expectedState] = null;\r\n };\r\n }\r\n };\r\n /*\r\n * Used to get token for the specified set of scopes from the cache\r\n * @param {AuthenticationRequestParameters} authenticationRequest - Request sent to the STS to obtain an id_token/access_token\r\n * @param {User} user - User for which the scopes were requested\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.getCachedToken = function (authenticationRequest, user) {\r\n var accessTokenCacheItem = null;\r\n var scopes = authenticationRequest.scopes;\r\n var tokenCacheItems = this._cacheStorage.getAllAccessTokens(this.clientId, user.userIdentifier); //filter by clientId and user\r\n if (tokenCacheItems.length === 0) {\r\n return null;\r\n }\r\n var filteredItems = [];\r\n //if no authority passed\r\n if (!authenticationRequest.authority) {\r\n //filter by scope\r\n for (var i = 0; i < tokenCacheItems.length; i++) {\r\n var cacheItem = tokenCacheItems[i];\r\n var cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils_1.Utils.containsScope(cachedScopes, scopes)) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n //if only one cached token found\r\n if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n authenticationRequest.authorityInstance = AuthorityFactory_1.AuthorityFactory.CreateInstance(accessTokenCacheItem.key.authority, this.validateAuthority);\r\n }\r\n else if (filteredItems.length > 1) {\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n else {\r\n //no match found. check if there was a single authority used\r\n var authorityList = this.getUniqueAuthority(tokenCacheItems, \"authority\");\r\n if (authorityList.length > 1) {\r\n return {\r\n errorDesc: \"Multiple authorities found in the cache. Pass authority in the API overload.\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n authenticationRequest.authorityInstance = AuthorityFactory_1.AuthorityFactory.CreateInstance(authorityList[0], this.validateAuthority);\r\n }\r\n }\r\n else {\r\n //authority was passed in the API, filter by authority and scope\r\n for (var i = 0; i < tokenCacheItems.length; i++) {\r\n var cacheItem = tokenCacheItems[i];\r\n var cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils_1.Utils.containsScope(cachedScopes, scopes) && cacheItem.key.authority === authenticationRequest.authority) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n //no match\r\n if (filteredItems.length === 0) {\r\n return null;\r\n }\r\n else if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n }\r\n else {\r\n //more than one match found.\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements.Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n }\r\n if (accessTokenCacheItem != null) {\r\n var expired = Number(accessTokenCacheItem.value.expiresIn);\r\n // If expiration is within offset, it will force renew\r\n var offset = this._clockSkew || 300;\r\n if (expired && (expired > Utils_1.Utils.now() + offset)) {\r\n return {\r\n errorDesc: null,\r\n token: accessTokenCacheItem.value.accessToken,\r\n error: null\r\n };\r\n }\r\n else {\r\n this._cacheStorage.removeItem(JSON.stringify(filteredItems[0].key));\r\n return null;\r\n }\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /*\r\n * Used to filter all cached items and return a list of unique users based on userIdentifier.\r\n * @param {Array} Users - users saved in the cache.\r\n */\r\n UserAgentApplication.prototype.getAllUsers = function () {\r\n var users = [];\r\n var accessTokenCacheItems = this._cacheStorage.getAllAccessTokens(Constants_1.Constants.clientId, Constants_1.Constants.authority);\r\n for (var i = 0; i < accessTokenCacheItems.length; i++) {\r\n var idToken = new IdToken_1.IdToken(accessTokenCacheItems[i].value.idToken);\r\n var clientInfo = new ClientInfo_1.ClientInfo(accessTokenCacheItems[i].value.clientInfo);\r\n var user = User_1.User.createUser(idToken, clientInfo, this.authority);\r\n users.push(user);\r\n }\r\n return this.getUniqueUsers(users);\r\n };\r\n /*\r\n * Used to filter users based on userIdentifier\r\n * @param {Array} Users - users saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.getUniqueUsers = function (users) {\r\n if (!users || users.length <= 1) {\r\n return users;\r\n }\r\n var flags = [];\r\n var uniqueUsers = [];\r\n for (var index = 0; index < users.length; ++index) {\r\n if (users[index].userIdentifier && flags.indexOf(users[index].userIdentifier) === -1) {\r\n flags.push(users[index].userIdentifier);\r\n uniqueUsers.push(users[index]);\r\n }\r\n }\r\n return uniqueUsers;\r\n };\r\n /*\r\n * Used to get a unique list of authoritues from the cache\r\n * @param {Array} accessTokenCacheItems - accessTokenCacheItems saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.getUniqueAuthority = function (accessTokenCacheItems, property) {\r\n var authorityList = [];\r\n var flags = [];\r\n accessTokenCacheItems.forEach(function (element) {\r\n if (element.key.hasOwnProperty(property) && (flags.indexOf(element.key[property]) === -1)) {\r\n flags.push(element.key[property]);\r\n authorityList.push(element.key[property]);\r\n }\r\n });\r\n return authorityList;\r\n };\r\n /*\r\n * Adds login_hint to authorization URL which is used to pre-fill the username field of sign in page for the user if known ahead of time\r\n * domain_hint can be one of users/organisations which when added skips the email based discovery process of the user\r\n * domain_req utid received as part of the clientInfo\r\n * login_req uid received as part of clientInfo\r\n * @param {string} urlNavigate - Authentication request url\r\n * @param {User} user - User for which the token is requested\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.addHintParameters = function (urlNavigate, user) {\r\n var userObject = user ? user : this.getUser();\r\n var decodedClientInfo = userObject.userIdentifier.split(\".\");\r\n var uid = Utils_1.Utils.base64DecodeStringUrlSafe(decodedClientInfo[0]);\r\n var utid = Utils_1.Utils.base64DecodeStringUrlSafe(decodedClientInfo[1]);\r\n if (!this.urlContainsQueryStringParameter(\"login_hint\", urlNavigate) && userObject.displayableId && !Utils_1.Utils.isEmpty(userObject.displayableId)) {\r\n urlNavigate += \"&login_hint=\" + encodeURIComponent(user.displayableId);\r\n }\r\n if (!Utils_1.Utils.isEmpty(uid) && !Utils_1.Utils.isEmpty(utid)) {\r\n if (!this.urlContainsQueryStringParameter(\"domain_req\", urlNavigate) && !Utils_1.Utils.isEmpty(utid)) {\r\n urlNavigate += \"&domain_req=\" + encodeURIComponent(utid);\r\n }\r\n if (!this.urlContainsQueryStringParameter(\"login_req\", urlNavigate) && !Utils_1.Utils.isEmpty(uid)) {\r\n urlNavigate += \"&login_req=\" + encodeURIComponent(uid);\r\n }\r\n if (!this.urlContainsQueryStringParameter(\"domain_hint\", urlNavigate) && !Utils_1.Utils.isEmpty(utid)) {\r\n if (utid === \"9188040d-6c67-4c5b-b112-36a304b66dad\") {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"consumers\");\r\n }\r\n else {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"organizations\");\r\n }\r\n }\r\n }\r\n return urlNavigate;\r\n };\r\n /*\r\n * Checks if the authorization endpoint URL contains query string parameters\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.urlContainsQueryStringParameter = function (name, url) {\r\n // regex to detect pattern of a ? or & followed by the name parameter and an equals character\r\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=\");\r\n return regex.test(url);\r\n };\r\n UserAgentApplication.prototype.acquireTokenRedirect = function (scopes, authority, user, extraQueryParameters) {\r\n var _this = this;\r\n var isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils_1.Utils.isEmpty(isValidScope)) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(isValidScope, null, null, Constants_1.Constants.accessToken);\r\n return;\r\n }\r\n }\r\n if (scopes) {\r\n scopes = this.filterScopes(scopes);\r\n }\r\n var userObject = user ? user : this.getUser();\r\n if (this._acquireTokenInProgress) {\r\n return;\r\n }\r\n var scope = scopes.join(\" \").toLowerCase();\r\n if (!userObject) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(Constants_1.ErrorDescription.userLoginError, null, Constants_1.ErrorCodes.userLoginError, Constants_1.Constants.accessToken);\r\n return;\r\n }\r\n }\r\n this._acquireTokenInProgress = true;\r\n var authenticationRequest;\r\n var acquireTokenAuthority = authority ? AuthorityFactory_1.AuthorityFactory.CreateInstance(authority, this.validateAuthority) : this.authorityInstance;\r\n acquireTokenAuthority.ResolveEndpointsAsync().then(function () {\r\n if (Utils_1.Utils.compareObjects(userObject, _this.getUser())) {\r\n authenticationRequest = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(acquireTokenAuthority, _this.clientId, scopes, ResponseTypes.token, _this._redirectUri);\r\n }\r\n else {\r\n authenticationRequest = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(acquireTokenAuthority, _this.clientId, scopes, ResponseTypes.id_token_token, _this._redirectUri);\r\n }\r\n _this._cacheStorage.setItem(Constants_1.Constants.nonceIdToken, authenticationRequest.nonce);\r\n var acquireTokenUserKey = Constants_1.Constants.acquireTokenUser + Constants_1.Constants.resourceDelimeter + userObject.userIdentifier + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(_this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n _this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(userObject));\r\n }\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(_this._cacheStorage.getItem(authorityKey))) {\r\n _this._cacheStorage.setItem(authorityKey, acquireTokenAuthority.CanonicalAuthority);\r\n }\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n var urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n urlNavigate = _this.addHintParameters(urlNavigate, userObject);\r\n if (urlNavigate) {\r\n _this._cacheStorage.setItem(Constants_1.Constants.stateAcquireToken, authenticationRequest.state);\r\n _this._requestType = Constants_1.Constants.renewToken;\r\n window.location.replace(urlNavigate);\r\n }\r\n });\r\n };\r\n UserAgentApplication.prototype.acquireTokenPopup = function (scopes, authority, user, extraQueryParameters) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n var isValidScope = _this.validateInputScope(scopes);\r\n if (isValidScope && !Utils_1.Utils.isEmpty(isValidScope)) {\r\n reject(Constants_1.ErrorCodes.inputScopesError + \":\" + isValidScope);\r\n }\r\n if (scopes) {\r\n scopes = _this.filterScopes(scopes);\r\n }\r\n var userObject = user ? user : _this.getUser();\r\n if (_this._acquireTokenInProgress) {\r\n reject(Constants_1.ErrorCodes.acquireTokenProgressError + \":\" + Constants_1.ErrorDescription.acquireTokenProgressError);\r\n return;\r\n }\r\n var scope = scopes.join(\" \").toLowerCase();\r\n if (!userObject) {\r\n reject(Constants_1.ErrorCodes.userLoginError + \":\" + Constants_1.ErrorDescription.userLoginError);\r\n return;\r\n }\r\n _this._acquireTokenInProgress = true;\r\n var authenticationRequest;\r\n var acquireTokenAuthority = authority ? AuthorityFactory_1.AuthorityFactory.CreateInstance(authority, _this.validateAuthority) : _this.authorityInstance;\r\n var popUpWindow = _this.openWindow(\"about:blank\", \"_blank\", 1, _this, resolve, reject);\r\n if (!popUpWindow) {\r\n return;\r\n }\r\n acquireTokenAuthority.ResolveEndpointsAsync().then(function () {\r\n if (Utils_1.Utils.compareObjects(userObject, _this.getUser())) {\r\n if (scopes.indexOf(_this.clientId) > -1) {\r\n authenticationRequest = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(acquireTokenAuthority, _this.clientId, scopes, ResponseTypes.id_token, _this._redirectUri);\r\n }\r\n else {\r\n authenticationRequest = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(acquireTokenAuthority, _this.clientId, scopes, ResponseTypes.token, _this._redirectUri);\r\n }\r\n }\r\n else {\r\n authenticationRequest = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(acquireTokenAuthority, _this.clientId, scopes, ResponseTypes.id_token_token, _this._redirectUri);\r\n }\r\n _this._cacheStorage.setItem(Constants_1.Constants.nonceIdToken, authenticationRequest.nonce);\r\n authenticationRequest.state = authenticationRequest.state;\r\n var acquireTokenUserKey = Constants_1.Constants.acquireTokenUser + Constants_1.Constants.resourceDelimeter + userObject.userIdentifier + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(_this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n _this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(userObject));\r\n }\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(_this._cacheStorage.getItem(authorityKey))) {\r\n _this._cacheStorage.setItem(authorityKey, acquireTokenAuthority.CanonicalAuthority);\r\n }\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n var urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n urlNavigate = _this.addHintParameters(urlNavigate, userObject);\r\n _this._renewStates.push(authenticationRequest.state);\r\n _this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n _this._requestType = Constants_1.Constants.renewToken;\r\n if (popUpWindow) {\r\n popUpWindow.location.href = urlNavigate;\r\n }\r\n }, function () {\r\n _this._logger.info(Constants_1.ErrorCodes.endpointResolutionError + \":\" + Constants_1.ErrorDescription.endpointResolutionError);\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalError, Constants_1.ErrorCodes.endpointResolutionError);\r\n _this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, Constants_1.ErrorDescription.endpointResolutionError);\r\n if (reject) {\r\n reject(Constants_1.ErrorCodes.endpointResolutionError + \":\" + Constants_1.ErrorDescription.endpointResolutionError);\r\n }\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n });\r\n });\r\n };\r\n /*\r\n * Used to get the token from cache.\r\n * MSAL will return the cached token if it is not expired.\r\n * Or it will send a request to the STS to obtain an access_token using a hidden iframe. To renew idToken, clientId should be passed as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Resolved with token or rejected with error.\r\n */\r\n UserAgentApplication.prototype.acquireTokenSilent = function (scopes, authority, user, extraQueryParameters) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n var isValidScope = _this.validateInputScope(scopes);\r\n if (isValidScope && !Utils_1.Utils.isEmpty(isValidScope)) {\r\n reject(Constants_1.ErrorCodes.inputScopesError + \":\" + isValidScope);\r\n }\r\n else {\r\n if (scopes) {\r\n scopes = _this.filterScopes(scopes);\r\n }\r\n var scope_1 = scopes.join(\" \").toLowerCase();\r\n var userObject_1 = user ? user : _this.getUser();\r\n if (!userObject_1) {\r\n reject(Constants_1.ErrorCodes.userLoginError + \":\" + Constants_1.ErrorDescription.userLoginError);\r\n return;\r\n }\r\n var authenticationRequest_1;\r\n var newAuthority = authority ? AuthorityFactory_1.AuthorityFactory.CreateInstance(authority, _this.validateAuthority) : _this.authorityInstance;\r\n if (Utils_1.Utils.compareObjects(userObject_1, _this.getUser())) {\r\n if (scopes.indexOf(_this.clientId) > -1) {\r\n authenticationRequest_1 = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(newAuthority, _this.clientId, scopes, ResponseTypes.id_token, _this._redirectUri);\r\n }\r\n else {\r\n authenticationRequest_1 = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(newAuthority, _this.clientId, scopes, ResponseTypes.token, _this._redirectUri);\r\n }\r\n }\r\n else {\r\n authenticationRequest_1 = new AuthenticationRequestParameters_1.AuthenticationRequestParameters(newAuthority, _this.clientId, scopes, ResponseTypes.id_token_token, _this._redirectUri);\r\n }\r\n var cacheResult = _this.getCachedToken(authenticationRequest_1, userObject_1);\r\n if (cacheResult) {\r\n if (cacheResult.token) {\r\n _this._logger.info(\"Token is already in cache for scope:\" + scope_1);\r\n resolve(cacheResult.token);\r\n return;\r\n }\r\n else if (cacheResult.errorDesc || cacheResult.error) {\r\n _this._logger.infoPii(cacheResult.errorDesc + \":\" + cacheResult.error);\r\n reject(cacheResult.errorDesc + \": \" + cacheResult.error);\r\n return;\r\n }\r\n }\r\n _this._requestType = Constants_1.Constants.renewToken;\r\n // cache miss\r\n return _this.authorityInstance.ResolveEndpointsAsync()\r\n .then(function () {\r\n // refresh attept with iframe\r\n //Already renewing for this scope, callback when we get the token.\r\n if (_this._activeRenewals[scope_1]) {\r\n _this._logger.verbose(\"Renew token for scope: \" + scope_1 + \" is in progress. Registering callback\");\r\n //Active renewals contains the state for each renewal.\r\n _this.registerCallback(_this._activeRenewals[scope_1], scope_1, resolve, reject);\r\n }\r\n else {\r\n if (scopes && scopes.indexOf(_this.clientId) > -1 && scopes.length === 1) {\r\n // App uses idToken to send to api endpoints\r\n // Default scope is tracked as clientId to store this token\r\n _this._logger.verbose(\"renewing idToken\");\r\n _this.renewIdToken(scopes, resolve, reject, userObject_1, authenticationRequest_1, extraQueryParameters);\r\n }\r\n else {\r\n _this._logger.verbose(\"renewing accesstoken\");\r\n _this.renewToken(scopes, resolve, reject, userObject_1, authenticationRequest_1, extraQueryParameters);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n };\r\n /*\r\n * Calling _loadFrame but with a timeout to signal failure in loadframeStatus. Callbacks are left.\r\n * registered when network errors occur and subsequent token requests for same resource are registered to the pending request.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.loadIframeTimeout = function (urlNavigate, frameName, scope) {\r\n var _this = this;\r\n //set iframe session to pending\r\n this._logger.verbose(\"Set loading state to pending for: \" + scope);\r\n this._cacheStorage.setItem(Constants_1.Constants.renewStatus + scope, Constants_1.Constants.tokenRenewStatusInProgress);\r\n this.loadFrame(urlNavigate, frameName);\r\n setTimeout(function () {\r\n if (_this._cacheStorage.getItem(Constants_1.Constants.renewStatus + scope) === Constants_1.Constants.tokenRenewStatusInProgress) {\r\n // fail the iframe session if it\"s in pending state\r\n _this._logger.verbose(\"Loading frame has timed out after: \" + (_this.loadFrameTimeout / 1000) + \" seconds for scope \" + scope);\r\n var expectedState = _this._activeRenewals[scope];\r\n if (expectedState && window.callBackMappedToRenewStates[expectedState]) {\r\n window.callBackMappedToRenewStates[expectedState](\"Token renewal operation failed due to timeout\", null, \"Token Renewal Failed\", Constants_1.Constants.accessToken);\r\n }\r\n _this._cacheStorage.setItem(Constants_1.Constants.renewStatus + scope, Constants_1.Constants.tokenRenewStatusCancelled);\r\n }\r\n }, this.loadFrameTimeout);\r\n };\r\n /*\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.loadFrame = function (urlNavigate, frameName) {\r\n var _this = this;\r\n // This trick overcomes iframe navigation in IE\r\n // IE does not load the page consistently in iframe\r\n this._logger.info(\"LoadFrame: \" + frameName);\r\n var frameCheck = frameName;\r\n setTimeout(function () {\r\n var frameHandle = _this.addAdalFrame(frameCheck);\r\n if (frameHandle.src === \"\" || frameHandle.src === \"about:blank\") {\r\n frameHandle.src = urlNavigate;\r\n _this._logger.infoPii(\"Frame Name : \" + frameName + \" Navigated to: \" + urlNavigate);\r\n }\r\n }, 500);\r\n };\r\n /*\r\n * Adds the hidden iframe for silent token renewal.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.addAdalFrame = function (iframeId) {\r\n if (typeof iframeId === \"undefined\") {\r\n return null;\r\n }\r\n this._logger.info(\"Add msal frame to document:\" + iframeId);\r\n var adalFrame = document.getElementById(iframeId);\r\n if (!adalFrame) {\r\n if (document.createElement &&\r\n document.documentElement &&\r\n (window.navigator.userAgent.indexOf(\"MSIE 5.0\") === -1)) {\r\n var ifr = document.createElement(\"iframe\");\r\n ifr.setAttribute(\"id\", iframeId);\r\n ifr.style.visibility = \"hidden\";\r\n ifr.style.position = \"absolute\";\r\n ifr.style.width = ifr.style.height = \"0\";\r\n ifr.style.border = \"0\";\r\n adalFrame = document.getElementsByTagName(\"body\")[0].appendChild(ifr);\r\n }\r\n else if (document.body && document.body.insertAdjacentHTML) {\r\n document.body.insertAdjacentHTML('beforeend', '');\r\n }\r\n if (window.frames && window.frames[iframeId]) {\r\n adalFrame = window.frames[iframeId];\r\n }\r\n }\r\n return adalFrame;\r\n };\r\n /*\r\n * Acquires access token using a hidden iframe.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.renewToken = function (scopes, resolve, reject, user, authenticationRequest, extraQueryParameters) {\r\n var scope = scopes.join(\" \").toLowerCase();\r\n this._logger.verbose(\"renewToken is called for scope:\" + scope);\r\n var frameHandle = this.addAdalFrame(\"msalRenewFrame\" + scope);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n var acquireTokenUserKey = Constants_1.Constants.acquireTokenUser + Constants_1.Constants.resourceDelimeter + user.userIdentifier + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(user));\r\n }\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, authenticationRequest.authority);\r\n }\r\n // renew happens in iframe, so it keeps javascript context\r\n this._cacheStorage.setItem(Constants_1.Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._logger.verbose(\"Renew token Expected state: \" + authenticationRequest.state);\r\n var urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=none\";\r\n urlNavigate = this.addHintParameters(urlNavigate, user);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n frameHandle.src = \"about:blank\";\r\n this.loadIframeTimeout(urlNavigate, \"msalRenewFrame\" + scope, scope);\r\n };\r\n /*\r\n * Renews idtoken for app\"s own backend when clientId is passed as a single scope in the scopes array.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.renewIdToken = function (scopes, resolve, reject, user, authenticationRequest, extraQueryParameters) {\r\n var scope = scopes.join(\" \").toLowerCase();\r\n this._logger.info(\"renewidToken is called\");\r\n var frameHandle = this.addAdalFrame(\"msalIdTokenFrame\");\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n var acquireTokenUserKey = Constants_1.Constants.acquireTokenUser + Constants_1.Constants.resourceDelimeter + user.userIdentifier + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n this._cacheStorage.setItem(acquireTokenUserKey, JSON.stringify(user));\r\n }\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils_1.Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, authenticationRequest.authority);\r\n }\r\n this._cacheStorage.setItem(Constants_1.Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._logger.verbose(\"Renew Idtoken Expected state: \" + authenticationRequest.state);\r\n var urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=none\";\r\n urlNavigate = this.addHintParameters(urlNavigate, user);\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, this.clientId, resolve, reject);\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n frameHandle.src = \"about:blank\";\r\n this.loadIframeTimeout(urlNavigate, \"msalIdTokenFrame\", this.clientId);\r\n };\r\n /*\r\n * Returns the signed in user (received from a user object created at the time of login) or null.\r\n */\r\n UserAgentApplication.prototype.getUser = function () {\r\n // idToken is first call\r\n if (this._user) {\r\n return this._user;\r\n }\r\n // frame is used to get idToken\r\n var rawIdToken = this._cacheStorage.getItem(Constants_1.Constants.idTokenKey);\r\n var rawClientInfo = this._cacheStorage.getItem(Constants_1.Constants.msalClientInfo);\r\n if (!Utils_1.Utils.isEmpty(rawIdToken) && !Utils_1.Utils.isEmpty(rawClientInfo)) {\r\n var idToken = new IdToken_1.IdToken(rawIdToken);\r\n var clientInfo = new ClientInfo_1.ClientInfo(rawClientInfo);\r\n this._user = User_1.User.createUser(idToken, clientInfo, this.authority);\r\n return this._user;\r\n }\r\n return null;\r\n };\r\n /*\r\n * This method must be called for processing the response received from the STS. It extracts the hash, processes the token or error information and saves it in the cache. It then\r\n * calls the registered callbacks in case of redirect or resolves the promises with the result.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.handleAuthenticationResponse = function (hash) {\r\n if (hash == null) {\r\n hash = window.location.hash;\r\n }\r\n var self = null;\r\n var isPopup = false;\r\n var isWindowOpenerMsal = false;\r\n try {\r\n isWindowOpenerMsal = window.opener && window.opener.msal && window.opener.msal !== window.msal;\r\n }\r\n catch (err) {\r\n // err = SecurityError: Blocked a frame with origin \"[url]\" from accessing a cross-origin frame.\r\n isWindowOpenerMsal = false;\r\n }\r\n if (isWindowOpenerMsal) {\r\n self = window.opener.msal;\r\n isPopup = true;\r\n }\r\n else if (window.parent && window.parent.msal) {\r\n self = window.parent.msal;\r\n }\r\n var requestInfo = self.getRequestInfo(hash);\r\n var token = null, tokenReceivedCallback = null, tokenType, saveToken = true;\r\n self._logger.info(\"Returned from redirect url\");\r\n if (window.parent !== window && window.parent.callBackMappedToRenewStates[requestInfo.stateResponse]) {\r\n tokenReceivedCallback = window.parent.callBackMappedToRenewStates[requestInfo.stateResponse];\r\n }\r\n else if (window.opener && window.opener.msal && window.opener.callBackMappedToRenewStates[requestInfo.stateResponse]) {\r\n tokenReceivedCallback = window.opener.callBackMappedToRenewStates[requestInfo.stateResponse];\r\n }\r\n else {\r\n if (self._navigateToLoginRequestUrl) {\r\n tokenReceivedCallback = null;\r\n self._cacheStorage.setItem(Constants_1.Constants.urlHash, hash);\r\n saveToken = false;\r\n if (window.parent === window && !isPopup) {\r\n window.location.href = self._cacheStorage.getItem(Constants_1.Constants.loginRequest);\r\n }\r\n return;\r\n }\r\n else {\r\n tokenReceivedCallback = self._tokenReceivedCallback;\r\n window.location.hash = '';\r\n }\r\n }\r\n self.saveTokenFromHash(requestInfo);\r\n if ((requestInfo.requestType === Constants_1.Constants.renewToken) && window.parent) {\r\n if (window.parent !== window) {\r\n self._logger.verbose(\"Window is in iframe, acquiring token silently\");\r\n }\r\n else {\r\n self._logger.verbose(\"acquiring token interactive in progress\");\r\n }\r\n token = requestInfo.parameters[Constants_1.Constants.accessToken] || requestInfo.parameters[Constants_1.Constants.idToken];\r\n tokenType = Constants_1.Constants.accessToken;\r\n }\r\n else if (requestInfo.requestType === Constants_1.Constants.login) {\r\n token = requestInfo.parameters[Constants_1.Constants.idToken];\r\n tokenType = Constants_1.Constants.idToken;\r\n }\r\n var errorDesc = requestInfo.parameters[Constants_1.Constants.errorDescription];\r\n var error = requestInfo.parameters[Constants_1.Constants.error];\r\n try {\r\n if (tokenReceivedCallback) {\r\n tokenReceivedCallback.call(self, errorDesc, token, error, tokenType);\r\n }\r\n }\r\n catch (err) {\r\n self._logger.error(\"Error occurred in token received callback function: \" + err);\r\n }\r\n for (var i = 0; i < self._openedWindows.length; i++) {\r\n self._openedWindows[i].close();\r\n }\r\n };\r\n /*\r\n * This method must be called for processing the response received from AAD. It extracts the hash, processes the token or error, saves it in the cache and calls the registered callbacks with the result.\r\n * @param {string} authority authority received in the redirect response from AAD.\r\n * @param {TokenResponse} requestInfo an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n * @param {User} user user object for which scopes are consented for. The default user is the logged in user.\r\n * @param {ClientInfo} clientInfo clientInfo received as part of the response comprising of fields uid and utid.\r\n * @param {IdToken} idToken idToken received as part of the response.\r\n * @ignore\r\n * @private\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.saveAccessToken = function (authority, tokenResponse, user, clientInfo, idToken) {\r\n var scope;\r\n var clientObj = new ClientInfo_1.ClientInfo(clientInfo);\r\n if (tokenResponse.parameters.hasOwnProperty(\"scope\")) {\r\n scope = tokenResponse.parameters[\"scope\"];\r\n var consentedScopes = scope.split(\" \");\r\n var accessTokenCacheItems = this._cacheStorage.getAllAccessTokens(this.clientId, authority);\r\n for (var i = 0; i < accessTokenCacheItems.length; i++) {\r\n var accessTokenCacheItem = accessTokenCacheItems[i];\r\n if (accessTokenCacheItem.key.userIdentifier === user.userIdentifier) {\r\n var cachedScopes = accessTokenCacheItem.key.scopes.split(\" \");\r\n if (Utils_1.Utils.isIntersectingScopes(cachedScopes, consentedScopes)) {\r\n this._cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n }\r\n }\r\n }\r\n var accessTokenKey = new AccessTokenKey_1.AccessTokenKey(authority, this.clientId, scope, clientObj.uid, clientObj.utid);\r\n var accessTokenValue = new AccessTokenValue_1.AccessTokenValue(tokenResponse.parameters[Constants_1.Constants.accessToken], idToken.rawIdToken, Utils_1.Utils.expiresIn(tokenResponse.parameters[Constants_1.Constants.expiresIn]).toString(), clientInfo);\r\n this._cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n }\r\n else {\r\n scope = this.clientId;\r\n var accessTokenKey = new AccessTokenKey_1.AccessTokenKey(authority, this.clientId, scope, clientObj.uid, clientObj.utid);\r\n var accessTokenValue = new AccessTokenValue_1.AccessTokenValue(tokenResponse.parameters[Constants_1.Constants.idToken], tokenResponse.parameters[Constants_1.Constants.idToken], idToken.expiration, clientInfo);\r\n this._cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n }\r\n };\r\n /*\r\n * Saves token or error received in the response from AAD in the cache. In case of id_token, it also creates the user object.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.saveTokenFromHash = function (tokenResponse) {\r\n this._logger.info(\"State status:\" + tokenResponse.stateMatch + \"; Request type:\" + tokenResponse.requestType);\r\n this._cacheStorage.setItem(Constants_1.Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, \"\");\r\n var scope = \"\";\r\n if (tokenResponse.parameters.hasOwnProperty(\"scope\")) {\r\n scope = tokenResponse.parameters[\"scope\"];\r\n }\r\n else {\r\n scope = this.clientId;\r\n }\r\n // Record error\r\n if (tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.errorDescription) || tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.error)) {\r\n this._logger.infoPii(\"Error :\" + tokenResponse.parameters[Constants_1.Constants.error] + \"; Error description:\" + tokenResponse.parameters[Constants_1.Constants.errorDescription]);\r\n this._cacheStorage.setItem(Constants_1.Constants.msalError, tokenResponse.parameters[\"error\"]);\r\n this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, tokenResponse.parameters[Constants_1.Constants.errorDescription]);\r\n if (tokenResponse.requestType === Constants_1.Constants.login) {\r\n this._loginInProgress = false;\r\n this._cacheStorage.setItem(Constants_1.Constants.loginError, tokenResponse.parameters[Constants_1.Constants.errorDescription] + \":\" + tokenResponse.parameters[Constants_1.Constants.error]);\r\n }\r\n if (tokenResponse.requestType === Constants_1.Constants.renewToken) {\r\n this._acquireTokenInProgress = false;\r\n }\r\n }\r\n else {\r\n // It must verify the state from redirect\r\n if (tokenResponse.stateMatch) {\r\n // record tokens to storage if exists\r\n this._logger.info(\"State is right\");\r\n if (tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.sessionState)) {\r\n this._cacheStorage.setItem(Constants_1.Constants.msalSessionState, tokenResponse.parameters[Constants_1.Constants.sessionState]);\r\n }\r\n var idToken;\r\n var clientInfo = \"\";\r\n if (tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.accessToken)) {\r\n this._logger.info(\"Fragment has access token\");\r\n this._acquireTokenInProgress = false;\r\n var user = void 0;\r\n if (tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.idToken)) {\r\n idToken = new IdToken_1.IdToken(tokenResponse.parameters[Constants_1.Constants.idToken]);\r\n }\r\n else {\r\n idToken = new IdToken_1.IdToken(this._cacheStorage.getItem(Constants_1.Constants.idTokenKey));\r\n }\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n var authority = void 0;\r\n if (!Utils_1.Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n authority = this._cacheStorage.getItem(authorityKey);\r\n authority = Utils_1.Utils.replaceFirstPath(authority, idToken.tenantId);\r\n }\r\n if (tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.clientInfo)) {\r\n clientInfo = tokenResponse.parameters[Constants_1.Constants.clientInfo];\r\n user = User_1.User.createUser(idToken, new ClientInfo_1.ClientInfo(clientInfo), authority);\r\n }\r\n else {\r\n this._logger.warning(\"ClientInfo not received in the response from AAD\");\r\n user = User_1.User.createUser(idToken, new ClientInfo_1.ClientInfo(clientInfo), authority);\r\n }\r\n var acquireTokenUserKey = Constants_1.Constants.acquireTokenUser + Constants_1.Constants.resourceDelimeter + user.userIdentifier + Constants_1.Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n var acquireTokenUser = void 0;\r\n if (!Utils_1.Utils.isEmpty(this._cacheStorage.getItem(acquireTokenUserKey))) {\r\n acquireTokenUser = JSON.parse(this._cacheStorage.getItem(acquireTokenUserKey));\r\n if (user && acquireTokenUser && Utils_1.Utils.compareObjects(user, acquireTokenUser)) {\r\n this.saveAccessToken(authority, tokenResponse, user, clientInfo, idToken);\r\n this._logger.info(\"The user object received in the response is the same as the one passed in the acquireToken request\");\r\n }\r\n else {\r\n this._logger.warning(\"The user object created from the response is not the same as the one passed in the acquireToken request\");\r\n }\r\n }\r\n }\r\n if (tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.idToken)) {\r\n if (scope.indexOf(this.clientId) > -1) {\r\n this._logger.info(\"Fragment has id token\");\r\n this._loginInProgress = false;\r\n idToken = new IdToken_1.IdToken(tokenResponse.parameters[Constants_1.Constants.idToken]);\r\n if (tokenResponse.parameters.hasOwnProperty(Constants_1.Constants.clientInfo)) {\r\n clientInfo = tokenResponse.parameters[Constants_1.Constants.clientInfo];\r\n }\r\n else {\r\n this._logger.warning(\"ClientInfo not received in the response from AAD\");\r\n }\r\n var authorityKey = Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter + tokenResponse.stateResponse;\r\n var authority = void 0;\r\n if (!Utils_1.Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n authority = this._cacheStorage.getItem(authorityKey);\r\n authority = Utils_1.Utils.replaceFirstPath(authority, idToken.tenantId);\r\n }\r\n this._user = User_1.User.createUser(idToken, new ClientInfo_1.ClientInfo(clientInfo), authority);\r\n if (idToken && idToken.nonce) {\r\n if (idToken.nonce !== this._cacheStorage.getItem(Constants_1.Constants.nonceIdToken)) {\r\n this._user = null;\r\n this._cacheStorage.setItem(Constants_1.Constants.loginError, \"Nonce Mismatch. Expected Nonce: \" + this._cacheStorage.getItem(Constants_1.Constants.nonceIdToken) + \",\" + \"Actual Nonce: \" + idToken.nonce);\r\n this._logger.error(\"Nonce Mismatch.Expected Nonce: \" + this._cacheStorage.getItem(Constants_1.Constants.nonceIdToken) + \",\" + \"Actual Nonce: \" + idToken.nonce);\r\n }\r\n else {\r\n this._cacheStorage.setItem(Constants_1.Constants.idTokenKey, tokenResponse.parameters[Constants_1.Constants.idToken]);\r\n this._cacheStorage.setItem(Constants_1.Constants.msalClientInfo, clientInfo);\r\n // Save idToken as access token for app itself\r\n this.saveAccessToken(authority, tokenResponse, this._user, clientInfo, idToken);\r\n }\r\n }\r\n else {\r\n this._logger.error(\"Invalid id_token received in the response\");\r\n this._cacheStorage.setItem(Constants_1.Constants.msalError, \"invalid idToken\");\r\n this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, \"Invalid idToken. idToken: \" + tokenResponse.parameters[Constants_1.Constants.idToken]);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n this._logger.error(\"State Mismatch.Expected State: \" + this._cacheStorage.getItem(Constants_1.Constants.stateLogin) + \",\" + \"Actual State: \" + tokenResponse.stateResponse);\r\n this._cacheStorage.setItem(Constants_1.Constants.msalError, \"Invalid_state\");\r\n this._cacheStorage.setItem(Constants_1.Constants.msalErrorDescription, \"Invalid_state. state: \" + tokenResponse.stateResponse);\r\n }\r\n }\r\n this._cacheStorage.setItem(Constants_1.Constants.renewStatus + scope, Constants_1.Constants.tokenRenewStatusCompleted);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants_1.Constants.acquireTokenUser, Constants_1.Constants.renewStatus);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants_1.Constants.authority + Constants_1.Constants.resourceDelimeter, Constants_1.Constants.renewStatus);\r\n };\r\n /*\r\n * Checks if the redirect response is received from the STS. In case of redirect, the url fragment has either id_token, access_token or error.\r\n * @param {string} hash - Hash passed from redirect page.\r\n * @returns {Boolean} - true if response contains id_token, access_token or error, false otherwise.\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.isCallback = function (hash) {\r\n hash = this.getHash(hash);\r\n var parameters = Utils_1.Utils.deserialize(hash);\r\n return (parameters.hasOwnProperty(Constants_1.Constants.errorDescription) ||\r\n parameters.hasOwnProperty(Constants_1.Constants.error) ||\r\n parameters.hasOwnProperty(Constants_1.Constants.accessToken) ||\r\n parameters.hasOwnProperty(Constants_1.Constants.idToken));\r\n };\r\n /*\r\n * Returns the anchor part(#) of the URL\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.getHash = function (hash) {\r\n if (hash.indexOf(\"#/\") > -1) {\r\n hash = hash.substring(hash.indexOf(\"#/\") + 2);\r\n }\r\n else if (hash.indexOf(\"#\") > -1) {\r\n hash = hash.substring(1);\r\n }\r\n return hash;\r\n };\r\n /*\r\n * Creates a requestInfo object from the URL fragment and returns it.\r\n * @param {string} hash - Hash passed from redirect page\r\n * @returns {TokenResponse} an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.getRequestInfo = function (hash) {\r\n hash = this.getHash(hash);\r\n var parameters = Utils_1.Utils.deserialize(hash);\r\n var tokenResponse = new RequestInfo_1.TokenResponse();\r\n if (parameters) {\r\n tokenResponse.parameters = parameters;\r\n if (parameters.hasOwnProperty(Constants_1.Constants.errorDescription) ||\r\n parameters.hasOwnProperty(Constants_1.Constants.error) ||\r\n parameters.hasOwnProperty(Constants_1.Constants.accessToken) ||\r\n parameters.hasOwnProperty(Constants_1.Constants.idToken)) {\r\n tokenResponse.valid = true;\r\n // which call\r\n var stateResponse = void 0;\r\n if (parameters.hasOwnProperty(\"state\")) {\r\n stateResponse = parameters.state;\r\n }\r\n else {\r\n return tokenResponse;\r\n }\r\n tokenResponse.stateResponse = stateResponse;\r\n // async calls can fire iframe and login request at the same time if developer does not use the API as expected\r\n // incoming callback needs to be looked up to find the request type\r\n if (stateResponse === this._cacheStorage.getItem(Constants_1.Constants.stateLogin)) {\r\n tokenResponse.requestType = Constants_1.Constants.login;\r\n tokenResponse.stateMatch = true;\r\n return tokenResponse;\r\n }\r\n else if (stateResponse === this._cacheStorage.getItem(Constants_1.Constants.stateAcquireToken)) {\r\n tokenResponse.requestType = Constants_1.Constants.renewToken;\r\n tokenResponse.stateMatch = true;\r\n return tokenResponse;\r\n }\r\n // external api requests may have many renewtoken requests for different resource\r\n if (!tokenResponse.stateMatch) {\r\n if (window.parent && window.parent !== window) {\r\n tokenResponse.requestType = Constants_1.Constants.renewToken;\r\n }\r\n else {\r\n tokenResponse.requestType = this._requestType;\r\n }\r\n var statesInParentContext = this._renewStates;\r\n for (var i = 0; i < statesInParentContext.length; i++) {\r\n if (statesInParentContext[i] === tokenResponse.stateResponse) {\r\n tokenResponse.stateMatch = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return tokenResponse;\r\n };\r\n /*\r\n * Extracts scope value from the state sent with the authentication request.\r\n * @returns {string} scope.\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.getScopeFromState = function (state) {\r\n if (state) {\r\n var splitIndex = state.indexOf(\"|\");\r\n if (splitIndex > -1 && splitIndex + 1 < state.length) {\r\n return state.substring(splitIndex + 1);\r\n }\r\n }\r\n return \"\";\r\n };\r\n /*\r\n * Returns whether current window is in ifram for token renewal\r\n * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.isInIframe = function () {\r\n return window.parent !== window;\r\n };\r\n tslib_1.__decorate([\r\n resolveTokenOnlyIfOutOfIframe\r\n ], UserAgentApplication.prototype, \"acquireTokenSilent\", null);\r\n return UserAgentApplication;\r\n}());\r\nexports.UserAgentApplication = UserAgentApplication;\r\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Utils_1 = __webpack_require__(0);\r\n/*\r\n * @hidden\r\n */\r\nvar AccessTokenKey = /** @class */ (function () {\r\n function AccessTokenKey(authority, clientId, scopes, uid, utid) {\r\n this.authority = authority;\r\n this.clientId = clientId;\r\n this.scopes = scopes;\r\n this.userIdentifier = Utils_1.Utils.base64EncodeStringUrlSafe(uid) + \".\" + Utils_1.Utils.base64EncodeStringUrlSafe(utid);\r\n }\r\n return AccessTokenKey;\r\n}());\r\nexports.AccessTokenKey = AccessTokenKey;\r\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * @hidden\r\n */\r\nvar AccessTokenValue = /** @class */ (function () {\r\n function AccessTokenValue(accessToken, idToken, expiresIn, clientInfo) {\r\n this.accessToken = accessToken;\r\n this.idToken = idToken;\r\n this.expiresIn = expiresIn;\r\n this.clientInfo = clientInfo;\r\n }\r\n return AccessTokenValue;\r\n}());\r\nexports.AccessTokenValue = AccessTokenValue;\r\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Utils_1 = __webpack_require__(0);\r\n/*\r\n * @hidden\r\n */\r\nvar AuthenticationRequestParameters = /** @class */ (function () {\r\n function AuthenticationRequestParameters(authority, clientId, scope, responseType, redirectUri) {\r\n this.authorityInstance = authority;\r\n this.clientId = clientId;\r\n this.scopes = scope;\r\n this.responseType = responseType;\r\n this.redirectUri = redirectUri;\r\n // randomly generated values\r\n this.correlationId = Utils_1.Utils.createNewGuid();\r\n this.state = Utils_1.Utils.createNewGuid();\r\n this.nonce = Utils_1.Utils.createNewGuid();\r\n // telemetry information\r\n this.xClientSku = \"MSAL.JS\";\r\n this.xClientVer = Utils_1.Utils.getLibraryVersion();\r\n }\r\n Object.defineProperty(AuthenticationRequestParameters.prototype, \"authority\", {\r\n get: function () {\r\n return this.authorityInstance.CanonicalAuthority;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n AuthenticationRequestParameters.prototype.createNavigateUrl = function (scopes) {\r\n if (!scopes) {\r\n scopes = [this.clientId];\r\n }\r\n if (scopes.indexOf(this.clientId) === -1) {\r\n scopes.push(this.clientId);\r\n }\r\n var str = [];\r\n str.push(\"response_type=\" + this.responseType);\r\n this.translateclientIdUsedInScope(scopes);\r\n str.push(\"scope=\" + encodeURIComponent(this.parseScope(scopes)));\r\n str.push(\"client_id=\" + encodeURIComponent(this.clientId));\r\n str.push(\"redirect_uri=\" + encodeURIComponent(this.redirectUri));\r\n str.push(\"state=\" + encodeURIComponent(this.state));\r\n str.push(\"nonce=\" + encodeURIComponent(this.nonce));\r\n str.push(\"client_info=1\");\r\n str.push(\"x-client-SKU=\" + this.xClientSku);\r\n str.push(\"x-client-Ver=\" + this.xClientVer);\r\n if (this.extraQueryParameters) {\r\n str.push(this.extraQueryParameters);\r\n }\r\n str.push(\"client-request-id=\" + encodeURIComponent(this.correlationId));\r\n var authEndpoint = this.authorityInstance.AuthorizationEndpoint;\r\n // if the endpoint already has queryparams, lets add to it, otherwise add the first one\r\n if (authEndpoint.indexOf(\"?\") < 0) {\r\n authEndpoint += \"?\";\r\n }\r\n else {\r\n authEndpoint += \"&\";\r\n }\r\n var requestUrl = \"\" + authEndpoint + str.join(\"&\");\r\n return requestUrl;\r\n };\r\n AuthenticationRequestParameters.prototype.translateclientIdUsedInScope = function (scopes) {\r\n var clientIdIndex = scopes.indexOf(this.clientId);\r\n if (clientIdIndex >= 0) {\r\n scopes.splice(clientIdIndex, 1);\r\n if (scopes.indexOf(\"openid\") === -1) {\r\n scopes.push(\"openid\");\r\n }\r\n if (scopes.indexOf(\"profile\") === -1) {\r\n scopes.push(\"profile\");\r\n }\r\n }\r\n };\r\n AuthenticationRequestParameters.prototype.parseScope = function (scopes) {\r\n var scopeList = \"\";\r\n if (scopes) {\r\n for (var i = 0; i < scopes.length; ++i) {\r\n scopeList += (i !== scopes.length - 1) ? scopes[i] + \" \" : scopes[i];\r\n }\r\n }\r\n return scopeList;\r\n };\r\n return AuthenticationRequestParameters;\r\n}());\r\nexports.AuthenticationRequestParameters = AuthenticationRequestParameters;\r\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Utils_1 = __webpack_require__(0);\r\n/*\r\n * @hidden\r\n */\r\nvar ClientInfo = /** @class */ (function () {\r\n function ClientInfo(rawClientInfo) {\r\n if (!rawClientInfo || Utils_1.Utils.isEmpty(rawClientInfo)) {\r\n this.uid = \"\";\r\n this.utid = \"\";\r\n return;\r\n }\r\n try {\r\n var decodedClientInfo = Utils_1.Utils.base64DecodeStringUrlSafe(rawClientInfo);\r\n var clientInfo = JSON.parse(decodedClientInfo);\r\n if (clientInfo) {\r\n if (clientInfo.hasOwnProperty(\"uid\")) {\r\n this.uid = clientInfo.uid;\r\n }\r\n if (clientInfo.hasOwnProperty(\"utid\")) {\r\n this.utid = clientInfo.utid;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n throw new Error(e);\r\n }\r\n }\r\n Object.defineProperty(ClientInfo.prototype, \"uid\", {\r\n get: function () {\r\n return this._uid ? this._uid : \"\";\r\n },\r\n set: function (uid) {\r\n this._uid = uid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ClientInfo.prototype, \"utid\", {\r\n get: function () {\r\n return this._utid ? this._utid : \"\";\r\n },\r\n set: function (utid) {\r\n this._utid = utid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ClientInfo;\r\n}());\r\nexports.ClientInfo = ClientInfo;\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Utils_1 = __webpack_require__(0);\r\n/*\r\n * @hidden\r\n */\r\nvar IdToken = /** @class */ (function () {\r\n function IdToken(rawIdToken) {\r\n if (Utils_1.Utils.isEmpty(rawIdToken)) {\r\n throw new Error(\"null or empty raw idtoken\");\r\n }\r\n try {\r\n this.rawIdToken = rawIdToken;\r\n this.decodedIdToken = Utils_1.Utils.extractIdToken(rawIdToken);\r\n if (this.decodedIdToken) {\r\n if (this.decodedIdToken.hasOwnProperty(\"iss\")) {\r\n this.issuer = this.decodedIdToken[\"iss\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"oid\")) {\r\n this.objectId = this.decodedIdToken['oid'];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"sub\")) {\r\n this.subject = this.decodedIdToken[\"sub\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"tid\")) {\r\n this.tenantId = this.decodedIdToken[\"tid\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"ver\")) {\r\n this.version = this.decodedIdToken[\"ver\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"preferred_username\")) {\r\n this.preferredName = this.decodedIdToken[\"preferred_username\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"name\")) {\r\n this.name = this.decodedIdToken[\"name\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"nonce\")) {\r\n this.nonce = this.decodedIdToken[\"nonce\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"exp\")) {\r\n this.expiration = this.decodedIdToken[\"exp\"];\r\n }\r\n if (this.decodedIdToken.hasOwnProperty(\"home_oid\")) {\r\n this.homeObjectId = this.decodedIdToken[\"home_oid\"];\r\n }\r\n }\r\n }\r\n catch (e) {\r\n throw new Error(\"Failed to parse the returned id token\");\r\n }\r\n }\r\n return IdToken;\r\n}());\r\nexports.IdToken = IdToken;\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar Constants_1 = __webpack_require__(5);\r\nvar AccessTokenCacheItem_1 = __webpack_require__(18);\r\n/*\r\n * @hidden\r\n */\r\nvar Storage = /** @class */ (function () {\r\n function Storage(cacheLocation) {\r\n if (Storage._instance) {\r\n return Storage._instance;\r\n }\r\n this._cacheLocation = cacheLocation;\r\n this._localStorageSupported = typeof window[this._cacheLocation] !== \"undefined\" && window[this._cacheLocation] != null;\r\n this._sessionStorageSupported = typeof window[cacheLocation] !== \"undefined\" && window[cacheLocation] != null;\r\n Storage._instance = this;\r\n if (!this._localStorageSupported && !this._sessionStorageSupported) {\r\n throw new Error(\"localStorage and sessionStorage not supported\");\r\n }\r\n return Storage._instance;\r\n }\r\n // add value to storage\r\n Storage.prototype.setItem = function (key, value) {\r\n if (window[this._cacheLocation]) {\r\n window[this._cacheLocation].setItem(key, value);\r\n }\r\n else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n };\r\n // get one item by key from storage\r\n Storage.prototype.getItem = function (key) {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].getItem(key);\r\n }\r\n else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n };\r\n // remove value from storage\r\n Storage.prototype.removeItem = function (key) {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].removeItem(key);\r\n }\r\n else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n };\r\n // clear storage (remove all items from it)\r\n Storage.prototype.clear = function () {\r\n if (window[this._cacheLocation]) {\r\n return window[this._cacheLocation].clear();\r\n }\r\n else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n };\r\n Storage.prototype.getAllAccessTokens = function (clientId, userIdentifier) {\r\n var results = [];\r\n var accessTokenCacheItem;\r\n var storage = window[this._cacheLocation];\r\n if (storage) {\r\n var key = void 0;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key)) {\r\n if (key.match(clientId) && key.match(userIdentifier)) {\r\n var value = this.getItem(key);\r\n if (value) {\r\n accessTokenCacheItem = new AccessTokenCacheItem_1.AccessTokenCacheItem(JSON.parse(key), JSON.parse(value));\r\n results.push(accessTokenCacheItem);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n return results;\r\n };\r\n Storage.prototype.removeAcquireTokenEntries = function (acquireTokenUser, acquireTokenStatus) {\r\n var storage = window[this._cacheLocation];\r\n if (storage) {\r\n var key = void 0;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key)) {\r\n if ((key.indexOf(acquireTokenUser) > -1) || (key.indexOf(acquireTokenStatus) > -1)) {\r\n this.removeItem(key);\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n };\r\n Storage.prototype.resetCacheItems = function () {\r\n var storage = window[this._cacheLocation];\r\n if (storage) {\r\n var key = void 0;\r\n for (key in storage) {\r\n if (storage.hasOwnProperty(key) && key.indexOf(Constants_1.Constants.msal) !== -1) {\r\n storage[key] = \"\";\r\n }\r\n }\r\n }\r\n else {\r\n throw new Error(\"localStorage and sessionStorage are not supported\");\r\n }\r\n };\r\n return Storage;\r\n}());\r\nexports.Storage = Storage;\r\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * @hidden\r\n */\r\nvar AccessTokenCacheItem = /** @class */ (function () {\r\n function AccessTokenCacheItem(key, value) {\r\n this.key = key;\r\n this.value = value;\r\n }\r\n return AccessTokenCacheItem;\r\n}());\r\nexports.AccessTokenCacheItem = AccessTokenCacheItem;\r\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * @hidden\r\n */\r\nvar TokenResponse = /** @class */ (function () {\r\n function TokenResponse() {\r\n this.valid = false;\r\n this.parameters = {};\r\n this.stateMatch = false;\r\n this.stateResponse = \"\";\r\n this.requestType = \"unknown\";\r\n }\r\n return TokenResponse;\r\n}());\r\nexports.TokenResponse = TokenResponse;\r\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/*\r\n * @hidden\r\n */\r\nvar Utils_1 = __webpack_require__(0);\r\nvar AadAuthority_1 = __webpack_require__(7);\r\nvar B2cAuthority_1 = __webpack_require__(21);\r\nvar Authority_1 = __webpack_require__(3);\r\nvar ErrorMessage_1 = __webpack_require__(4);\r\nvar AuthorityFactory = /** @class */ (function () {\r\n function AuthorityFactory() {\r\n }\r\n /*\r\n * Parse the url and determine the type of authority\r\n */\r\n AuthorityFactory.DetectAuthorityFromUrl = function (authorityUrl) {\r\n authorityUrl = Utils_1.Utils.CanonicalizeUri(authorityUrl);\r\n var components = Utils_1.Utils.GetUrlComponents(authorityUrl);\r\n var pathSegments = components.PathSegments;\r\n switch (pathSegments[0]) {\r\n case \"tfp\":\r\n return Authority_1.AuthorityType.B2C;\r\n case \"adfs\":\r\n return Authority_1.AuthorityType.Adfs;\r\n default:\r\n return Authority_1.AuthorityType.Aad;\r\n }\r\n };\r\n /*\r\n * Create an authority object of the correct type based on the url\r\n * Performs basic authority validation - checks to see if the authority is of a valid type (eg aad, b2c)\r\n */\r\n AuthorityFactory.CreateInstance = function (authorityUrl, validateAuthority) {\r\n var type = AuthorityFactory.DetectAuthorityFromUrl(authorityUrl);\r\n // Depending on above detection, create the right type.\r\n switch (type) {\r\n case Authority_1.AuthorityType.B2C:\r\n return new B2cAuthority_1.B2cAuthority(authorityUrl, validateAuthority);\r\n case Authority_1.AuthorityType.Aad:\r\n return new AadAuthority_1.AadAuthority(authorityUrl, validateAuthority);\r\n default:\r\n throw ErrorMessage_1.ErrorMessage.invalidAuthorityType;\r\n }\r\n };\r\n return AuthorityFactory;\r\n}());\r\nexports.AuthorityFactory = AuthorityFactory;\r\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = __webpack_require__(1);\r\nvar AadAuthority_1 = __webpack_require__(7);\r\nvar Authority_1 = __webpack_require__(3);\r\nvar ErrorMessage_1 = __webpack_require__(4);\r\nvar Utils_1 = __webpack_require__(0);\r\n/*\r\n * @hidden\r\n */\r\nvar B2cAuthority = /** @class */ (function (_super) {\r\n tslib_1.__extends(B2cAuthority, _super);\r\n function B2cAuthority(authority, validateAuthority) {\r\n var _this = _super.call(this, authority, validateAuthority) || this;\r\n var urlComponents = Utils_1.Utils.GetUrlComponents(authority);\r\n var pathSegments = urlComponents.PathSegments;\r\n if (pathSegments.length < 3) {\r\n throw ErrorMessage_1.ErrorMessage.b2cAuthorityUriInvalidPath;\r\n }\r\n _this.CanonicalAuthority = \"https://\" + urlComponents.HostNameAndPort + \"/\" + pathSegments[0] + \"/\" + pathSegments[1] + \"/\" + pathSegments[2] + \"/\";\r\n return _this;\r\n }\r\n Object.defineProperty(B2cAuthority.prototype, \"AuthorityType\", {\r\n get: function () {\r\n return Authority_1.AuthorityType.B2C;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /*\r\n * Returns a promise with the TenantDiscoveryEndpoint\r\n */\r\n B2cAuthority.prototype.GetOpenIdConfigurationEndpointAsync = function () {\r\n var _this = this;\r\n var resultPromise = new Promise(function (resolve, reject) {\r\n return resolve(_this.DefaultOpenIdConfigurationEndpoint);\r\n });\r\n if (!this.IsValidationEnabled) {\r\n return resultPromise;\r\n }\r\n if (this.IsInTrustedHostList(this.CanonicalAuthorityUrlComponents.HostNameAndPort)) {\r\n return resultPromise;\r\n }\r\n return new Promise(function (resolve, reject) {\r\n return reject(ErrorMessage_1.ErrorMessage.unsupportedAuthorityValidation);\r\n });\r\n };\r\n return B2cAuthority;\r\n}(AadAuthority_1.AadAuthority));\r\nexports.B2cAuthority = B2cAuthority;\r\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// msal.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 8eb1e34f7cca078cb254","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { IUri } from \"./IUri\";\r\nimport { User } from \"./User\";\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Utils {\r\n static compareObjects(u1: User, u2: User): boolean {\r\n if (!u1 || !u2) {\r\n return false;\r\n }\r\n if (u1.userIdentifier && u2.userIdentifier) {\r\n if (u1.userIdentifier === u2.userIdentifier) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static expiresIn(expires: string): number {\r\n // if AAD did not send \"expires_in\" property, use default expiration of 3599 seconds, for some reason AAD sends 3599 as \"expires_in\" value instead of 3600\r\n if (!expires) {\r\n expires = \"3599\";\r\n }\r\n return this.now() + parseInt(expires, 10);\r\n }\r\n\r\n static now(): number {\r\n return Math.round(new Date().getTime() / 1000.0);\r\n }\r\n\r\n static isEmpty(str: string): boolean {\r\n return (typeof str === \"undefined\" || !str || 0 === str.length);\r\n }\r\n\r\n static extractIdToken(encodedIdToken: string): any {\r\n // id token will be decoded to get the username\r\n const decodedToken = this.decodeJwt(encodedIdToken);\r\n if (!decodedToken) {\r\n return null;\r\n }\r\n try {\r\n const base64IdToken = decodedToken.JWSPayload;\r\n const base64Decoded = this.base64DecodeStringUrlSafe(base64IdToken);\r\n if (!base64Decoded) {\r\n //this._requestContext.logger.info(\"The returned id_token could not be base64 url safe decoded.\");\r\n return null;\r\n }\r\n // ECMA script has JSON built-in support\r\n return JSON.parse(base64Decoded);\r\n } catch (err) {\r\n //this._requestContext.logger.error(\"The returned id_token could not be decoded\" + err);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n static base64EncodeStringUrlSafe(input: string): string {\r\n // html5 should support atob function for decoding\r\n if (window.btoa) {\r\n return window.btoa(input);\r\n }\r\n else {\r\n return this.encode(input);\r\n }\r\n }\r\n\r\n static base64DecodeStringUrlSafe(base64IdToken: string): string {\r\n // html5 should support atob function for decoding\r\n base64IdToken = base64IdToken.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n if (window.atob) {\r\n return decodeURIComponent(window.atob(base64IdToken)); // jshint ignore:line\r\n }\r\n else {\r\n return decodeURIComponent(this.decode(base64IdToken));\r\n }\r\n }\r\n\r\n static encode(input: string): string {\r\n const keyStr: string = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n let output = \"\";\r\n let chr1: number, chr2: number, chr3: number, enc1: number, enc2: number, enc3: number, enc4: number;\r\n var i = 0;\r\n\r\n input = this.utf8Encode(input);\r\n\r\n while (i < input.length) {\r\n chr1 = input.charCodeAt(i++);\r\n chr2 = input.charCodeAt(i++);\r\n chr3 = input.charCodeAt(i++);\r\n\r\n enc1 = chr1 >> 2;\r\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\r\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\r\n enc4 = chr3 & 63;\r\n\r\n if (isNaN(chr2)) {\r\n enc3 = enc4 = 64;\r\n } else if (isNaN(chr3)) {\r\n enc4 = 64;\r\n }\r\n\r\n output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);\r\n }\r\n\r\n return output.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\r\n }\r\n\r\n static utf8Encode(input: string): string {\r\n input = input.replace(/\\r\\n/g, \"\\n\");\r\n var utftext = \"\";\r\n\r\n for (var n = 0; n < input.length; n++) {\r\n var c = input.charCodeAt(n);\r\n\r\n if (c < 128) {\r\n utftext += String.fromCharCode(c);\r\n }\r\n else if ((c > 127) && (c < 2048)) {\r\n utftext += String.fromCharCode((c >> 6) | 192);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n else {\r\n utftext += String.fromCharCode((c >> 12) | 224);\r\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\r\n utftext += String.fromCharCode((c & 63) | 128);\r\n }\r\n }\r\n\r\n return utftext;\r\n }\r\n\r\n static decode(base64IdToken: string): string {\r\n var codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\r\n base64IdToken = String(base64IdToken).replace(/=+$/, \"\");\r\n var length = base64IdToken.length;\r\n if (length % 4 === 1) {\r\n throw new Error(\"The token to be decoded is not correctly encoded.\");\r\n }\r\n let h1: number, h2: number, h3: number, h4: number, bits: number, c1: number, c2: number, c3: number, decoded = \"\";\r\n for (var i = 0; i < length; i += 4) {\r\n //Every 4 base64 encoded character will be converted to 3 byte string, which is 24 bits\r\n // then 6 bits per base64 encoded character\r\n h1 = codes.indexOf(base64IdToken.charAt(i));\r\n h2 = codes.indexOf(base64IdToken.charAt(i + 1));\r\n h3 = codes.indexOf(base64IdToken.charAt(i + 2));\r\n h4 = codes.indexOf(base64IdToken.charAt(i + 3));\r\n // For padding, if last two are \"=\"\r\n if (i + 2 === length - 1) {\r\n bits = h1 << 18 | h2 << 12 | h3 << 6;\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n decoded += String.fromCharCode(c1, c2);\r\n break;\r\n }\r\n // if last one is \"=\"\r\n else if (i + 1 === length - 1) {\r\n bits = h1 << 18 | h2 << 12;\r\n c1 = bits >> 16 & 255;\r\n decoded += String.fromCharCode(c1);\r\n break;\r\n }\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n // then convert to 3 byte chars\r\n c1 = bits >> 16 & 255;\r\n c2 = bits >> 8 & 255;\r\n c3 = bits & 255;\r\n decoded += String.fromCharCode(c1, c2, c3);\r\n }\r\n return decoded;\r\n }\r\n\r\n static decodeJwt(jwtToken: string): any {\r\n if (this.isEmpty(jwtToken)) {\r\n return null;\r\n }\r\n const idTokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n const matches = idTokenPartsRegex.exec(jwtToken);\r\n if (!matches || matches.length < 4) {\r\n //this._requestContext.logger.warn(\"The returned id_token is not parseable.\");\r\n return null;\r\n }\r\n const crackedToken = {\r\n header: matches[1],\r\n JWSPayload: matches[2],\r\n JWSSig: matches[3]\r\n };\r\n return crackedToken;\r\n }\r\n\r\n static deserialize(query: string): any {\r\n let match: Array; // Regex for replacing addition symbol with a space\r\n const pl = /\\+/g;\r\n const search = /([^&=]+)=([^&]*)/g;\r\n const decode = (s: string) => decodeURIComponent(s.replace(pl, \" \"));\r\n const obj: {} = {};\r\n match = search.exec(query);\r\n while (match) {\r\n obj[decode(match[1])] = decode(match[2]);\r\n match = search.exec(query);\r\n }\r\n return obj;\r\n }\r\n\r\n static isIntersectingScopes(cachedScopes: Array, scopes: Array): boolean {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n for (let i = 0; i < scopes.length; i++) {\r\n if (cachedScopes.indexOf(scopes[i].toLowerCase()) > -1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n static containsScope(cachedScopes: Array, scopes: Array): boolean {\r\n cachedScopes = this.convertToLowerCase(cachedScopes);\r\n return scopes.every((value: any): boolean => cachedScopes.indexOf(value.toString().toLowerCase()) >= 0);\r\n }\r\n\r\n static convertToLowerCase(scopes: Array): Array {\r\n return scopes.map(scope => scope.toLowerCase());\r\n }\r\n\r\n static removeElement(scopes: Array, scope: string): Array {\r\n return scopes.filter(value => value !== scope);\r\n }\r\n\r\n static decimalToHex(num: number): string {\r\n var hex: string = num.toString(16);\r\n while (hex.length < 2) {\r\n hex = \"0\" + hex;\r\n }\r\n return hex;\r\n }\r\n\r\n static getLibraryVersion(): string {\r\n return \"0.1.3\";\r\n }\r\n\r\n /*\r\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\r\n * @param href The url\r\n * @param tenantId The tenant id to replace\r\n */\r\n static replaceFirstPath(href: string, tenantId: string): string {\r\n var match = href.match(/^(https?\\:)\\/\\/(([^:\\/?#] *)(?:\\:([0-9]+))?)([\\/]{0,1}[^?#] *)(\\?[^#] *|)(#. *|)$/);\r\n if (match) {\r\n var urlObject = Utils.GetUrlComponents(href);\r\n var pathArray = urlObject.PathSegments;\r\n pathArray.shift();\r\n if (pathArray[0] && pathArray[0] === \"common\" || pathArray[0] === \"organizations\") {\r\n pathArray[0] = tenantId;\r\n href = urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + pathArray.join(\"/\");\r\n }\r\n }\r\n return href;\r\n }\r\n\r\n static createNewGuid(): string {\r\n // RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or\r\n // pseudo-random numbers.\r\n // The algorithm is as follows:\r\n // Set the two most significant bits (bits 6 and 7) of the\r\n // clock_seq_hi_and_reserved to zero and one, respectively.\r\n // Set the four most significant bits (bits 12 through 15) of the\r\n // time_hi_and_version field to the 4-bit version number from\r\n // Section 4.1.3. Version4\r\n // Set all the other bits to randomly (or pseudo-randomly) chosen\r\n // values.\r\n // UUID = time-low \"-\" time-mid \"-\"time-high-and-version \"-\"clock-seq-reserved and low(2hexOctet)\"-\" node\r\n // time-low = 4hexOctet\r\n // time-mid = 2hexOctet\r\n // time-high-and-version = 2hexOctet\r\n // clock-seq-and-reserved = hexOctet:\r\n // clock-seq-low = hexOctet\r\n // node = 6hexOctet\r\n // Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\r\n // y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10\r\n // y values are 8, 9, A, B\r\n\r\n const cryptoObj: Crypto = window.crypto; // for IE 11\r\n if (cryptoObj && cryptoObj.getRandomValues) {\r\n const buffer: Uint8Array = new Uint8Array(16);\r\n cryptoObj.getRandomValues(buffer);\r\n\r\n //buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).\r\n buffer[6] |= 0x40; //buffer[6] | 01000000 will set the 6 bit to 1.\r\n buffer[6] &= 0x4f; //buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = \"4\".\r\n\r\n //buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.\r\n buffer[8] |= 0x80; //buffer[8] | 10000000 will set the 7 bit to 1.\r\n buffer[8] &= 0xbf; //buffer[8] & 10111111 will set the 6 bit to 0.\r\n\r\n return Utils.decimalToHex(buffer[0]) + Utils.decimalToHex(buffer[1])\r\n + Utils.decimalToHex(buffer[2]) + Utils.decimalToHex(buffer[3])\r\n + \"-\" + Utils.decimalToHex(buffer[4]) + Utils.decimalToHex(buffer[5])\r\n + \"-\" + Utils.decimalToHex(buffer[6]) + Utils.decimalToHex(buffer[7])\r\n + \"-\" + Utils.decimalToHex(buffer[8]) + Utils.decimalToHex(buffer[9])\r\n + \"-\" + Utils.decimalToHex(buffer[10]) + Utils.decimalToHex(buffer[11])\r\n + Utils.decimalToHex(buffer[12]) + Utils.decimalToHex(buffer[13])\r\n + Utils.decimalToHex(buffer[14]) + Utils.decimalToHex(buffer[15]);\r\n }\r\n else {\r\n const guidHolder: string = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\";\r\n const hex: string = \"0123456789abcdef\";\r\n let r: number = 0;\r\n let guidResponse: string = \"\";\r\n for (let i: number = 0; i < 36; i++) {\r\n if (guidHolder[i] !== \"-\" && guidHolder[i] !== \"4\") {\r\n // each x and y needs to be random\r\n r = Math.random() * 16 | 0;\r\n }\r\n if (guidHolder[i] === \"x\") {\r\n guidResponse += hex[r];\r\n } else if (guidHolder[i] === \"y\") {\r\n // clock-seq-and-reserved first hex is filtered and remaining hex values are random\r\n r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??\r\n r |= 0x8; // set pos 3 to 1 as 1???\r\n guidResponse += hex[r];\r\n } else {\r\n guidResponse += guidHolder[i];\r\n }\r\n }\r\n return guidResponse;\r\n }\r\n }\r\n\r\n /*\r\n * Parses out the components from a url string.\r\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\r\n */\r\n static GetUrlComponents(url: string): IUri {\r\n if (!url) {\r\n throw \"Url required\";\r\n }\r\n\r\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\r\n var regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n\r\n var match = url.match(regEx);\r\n\r\n if (!match || match.length < 6) {\r\n throw \"Valid url required\";\r\n }\r\n\r\n let urlComponents = {\r\n Protocol: match[1],\r\n HostNameAndPort: match[4],\r\n AbsolutePath: match[5]\r\n };\r\n\r\n let pathSegments = urlComponents.AbsolutePath.split(\"/\");\r\n pathSegments = pathSegments.filter((val) => val && val.length > 0); // remove empty elements\r\n urlComponents.PathSegments = pathSegments;\r\n return urlComponents;\r\n }\r\n\r\n /*\r\n * Given a url or path, append a trailing slash if one doesnt exist\r\n */\r\n static CanonicalizeUri(url: string): string {\r\n if (url) {\r\n url = url.toLowerCase();\r\n }\r\n\r\n if (url && !Utils.endsWith(url, \"/\")) {\r\n url += \"/\";\r\n }\r\n\r\n return url;\r\n }\r\n\r\n /*\r\n * Checks to see if the url ends with the suffix\r\n * Required because we are compiling for es5 instead of es6\r\n * @param url\r\n * @param str\r\n */\r\n static endsWith(url: string, suffix: string): boolean {\r\n if (!url || !suffix) {\r\n return false;\r\n }\r\n\r\n return url.indexOf(suffix, url.length - suffix.length) !== -1;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Utils.ts","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/tslib/tslib.es6.js\n// module id = 1\n// module chunks = 0 1","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Utils } from \"./Utils\";\r\n\r\nexport interface ILoggerCallback {\r\n (level: LogLevel, message: string, containsPii: boolean): void;\r\n}\r\n\r\nexport enum LogLevel {\r\n Error,\r\n Warning,\r\n Info,\r\n Verbose\r\n}\r\n\r\nexport class Logger {// Singleton Class\r\n\r\n /*\r\n * @hidden\r\n */\r\n private static _instance: Logger;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _correlationId: string;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _level: LogLevel = LogLevel.Info;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _piiLoggingEnabled: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _localCallback: ILoggerCallback;\r\n\r\n constructor(localCallback: ILoggerCallback,\r\n options:\r\n {\r\n correlationId?: string,\r\n level?: LogLevel,\r\n piiLoggingEnabled?: boolean,\r\n } = {}) {\r\n const {\r\n correlationId = \"\",\r\n level = LogLevel.Info,\r\n piiLoggingEnabled = false\r\n } = options;\r\n\r\n this._localCallback = localCallback;\r\n this._correlationId = correlationId;\r\n this._level = level;\r\n this._piiLoggingEnabled = piiLoggingEnabled;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n private logMessage(logLevel: LogLevel, logMessage: string, containsPii: boolean): void {\r\n if ((logLevel > this._level) || (!this._piiLoggingEnabled && containsPii)) {\r\n return;\r\n }\r\n var timestamp = new Date().toUTCString();\r\n var log: string;\r\n if (!Utils.isEmpty(this._correlationId)) {\r\n log = timestamp + \":\" + this._correlationId + \"-\" + Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n else {\r\n log = timestamp + \":\" + Utils.getLibraryVersion() + \"-\" + LogLevel[logLevel] + \" \" + logMessage;\r\n }\r\n this.executeCallback(logLevel, log, containsPii);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n executeCallback(level: LogLevel, message: string, containsPii: boolean) {\r\n if (this._localCallback) {\r\n this._localCallback(level, message, containsPii);\r\n }\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n error(message: string): void {\r\n this.logMessage(LogLevel.Error, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n errorPii(message: string): void {\r\n this.logMessage(LogLevel.Error, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n warning(message: string): void {\r\n this.logMessage(LogLevel.Warning, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n warningPii(message: string): void {\r\n this.logMessage(LogLevel.Warning, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n info(message: string): void {\r\n this.logMessage(LogLevel.Info, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n infoPii(message: string): void {\r\n this.logMessage(LogLevel.Info, message, true);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n verbose(message: string): void {\r\n this.logMessage(LogLevel.Verbose, message, false);\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n verbosePii(message: string): void {\r\n this.logMessage(LogLevel.Verbose, message, true);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Logger.ts","import { IUri } from \"./IUri\";\r\nimport { Utils } from \"./Utils\";\r\nimport { ITenantDiscoveryResponse } from \"./ITenantDiscoveryResponse\";\r\nimport { ErrorMessage } from \"./ErrorMessage\";\r\nimport { XhrClient } from \"./XHRClient\";\r\n\r\n/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport enum AuthorityType {\r\n Aad,\r\n Adfs,\r\n B2C\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport abstract class Authority {\r\n constructor(authority: string, validateAuthority: boolean) {\r\n this.IsValidationEnabled = validateAuthority;\r\n this.CanonicalAuthority = authority;\r\n\r\n this.validateAsUri();\r\n }\r\n\r\n public abstract get AuthorityType(): AuthorityType;\r\n\r\n public IsValidationEnabled: boolean;\r\n\r\n public get Tenant(): string {\r\n return this.CanonicalAuthorityUrlComponents.PathSegments[0];\r\n }\r\n\r\n private tenantDiscoveryResponse: ITenantDiscoveryResponse;\r\n\r\n public get AuthorizationEndpoint(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n public get EndSessionEndpoint(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.EndSessionEndpoint.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n public get SelfSignedJwtAudience(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.Issuer.replace(\"{tenant}\", this.Tenant);\r\n }\r\n\r\n private validateResolved() {\r\n if (!this.tenantDiscoveryResponse) {\r\n throw \"Please call ResolveEndpointsAsync first\";\r\n }\r\n }\r\n\r\n /*\r\n * A URL that is the authority set by the developer\r\n */\r\n public get CanonicalAuthority(): string {\r\n return this.canonicalAuthority;\r\n }\r\n\r\n public set CanonicalAuthority(url: string) {\r\n this.canonicalAuthority = Utils.CanonicalizeUri(url);\r\n this.canonicalAuthorityUrlComponents = null;\r\n }\r\n\r\n private canonicalAuthority: string;\r\n private canonicalAuthorityUrlComponents: IUri;\r\n\r\n public get CanonicalAuthorityUrlComponents(): IUri {\r\n if (!this.canonicalAuthorityUrlComponents) {\r\n this.canonicalAuthorityUrlComponents = Utils.GetUrlComponents(this.CanonicalAuthority);\r\n }\r\n\r\n return this.canonicalAuthorityUrlComponents;\r\n }\r\n\r\n /*\r\n * // http://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\r\n */\r\n protected get DefaultOpenIdConfigurationEndpoint(): string {\r\n return `${this.CanonicalAuthority}v2.0/.well-known/openid-configuration`;\r\n }\r\n\r\n /*\r\n * Given a string, validate that it is of the form https://domain/path\r\n */\r\n private validateAsUri() {\r\n let components;\r\n try {\r\n components = this.CanonicalAuthorityUrlComponents;\r\n } catch (e) {\r\n throw ErrorMessage.invalidAuthorityType;\r\n }\r\n\r\n if (!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\r\n throw ErrorMessage.authorityUriInsecure;\r\n }\r\n\r\n if (!components.PathSegments || components.PathSegments.length < 1) {\r\n throw ErrorMessage.authorityUriInvalidPath;\r\n }\r\n }\r\n\r\n /*\r\n * Calls the OIDC endpoint and returns the response\r\n */\r\n private DiscoverEndpoints(openIdConfigurationEndpoint: string): Promise {\r\n let client = new XhrClient();\r\n return client.sendRequestAsync(openIdConfigurationEndpoint, \"GET\", /*enableCaching: */ true)\r\n .then((response: any) => {\r\n return {\r\n AuthorizationEndpoint: response.authorization_endpoint,\r\n EndSessionEndpoint: response.end_session_endpoint,\r\n Issuer: response.issuer\r\n };\r\n });\r\n }\r\n\r\n /*\r\n * Returns a promise.\r\n * Checks to see if the authority is in the cache\r\n * Discover endpoints via openid-configuration\r\n * If successful, caches the endpoint for later use in OIDC\r\n */\r\n public ResolveEndpointsAsync(): Promise {\r\n let openIdConfigurationEndpoint = \"\";\r\n return this.GetOpenIdConfigurationEndpointAsync().then(openIdConfigurationEndpointResponse => {\r\n openIdConfigurationEndpoint = openIdConfigurationEndpointResponse;\r\n return this.DiscoverEndpoints(openIdConfigurationEndpoint);\r\n }).then((tenantDiscoveryResponse: ITenantDiscoveryResponse) => {\r\n this.tenantDiscoveryResponse = tenantDiscoveryResponse;\r\n return this;\r\n });\r\n }\r\n\r\n /*\r\n * Returns a promise with the TenantDiscoveryEndpoint\r\n */\r\n public abstract GetOpenIdConfigurationEndpointAsync(): Promise;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Authority.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorMessage {\r\n static get authorityUriInvalidPath(): string { return \"AuthorityUriInvalidPath\"; }\r\n static get authorityUriInsecure(): string { return \"AuthorityUriInsecure\"; }\r\n static get invalidAuthorityType(): string { return \"InvalidAuthorityType\"; }\r\n static get unsupportedAuthorityValidation(): string { return \"UnsupportedAuthorityValidation\"; }\r\n static get b2cAuthorityUriInvalidPath(): string { return \"B2cAuthorityUriInvalidPath\"; }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/ErrorMessage.ts","/*\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class Constants {\r\n static get errorDescription(): string { return \"error_description\"; }\r\n static get error(): string { return \"error\"; }\r\n static get scope(): string { return \"scope\"; }\r\n static get acquireTokenUser(): string { return \"msal_acquireTokenUser\"; }\r\n static get clientInfo(): string { return \"client_info\"; }\r\n static get clientId(): string { return \"clientId\"; }\r\n static get authority(): string { return \"authority\"; }\r\n static get idToken(): string { return \"id_token\"; }\r\n static get accessToken(): string { return \"access_token\"; }\r\n static get expiresIn(): string { return \"expires_in\"; }\r\n static get sessionState(): string { return \"session_state\"; }\r\n static get msalClientInfo(): string { return \"msal.client.info\"; }\r\n static get msalError(): string { return \"msal.error\"; }\r\n static get msalErrorDescription(): string { return \"msal.error.description\"; }\r\n static get msalSessionState(): string { return \"msal.session.state\"; }\r\n static get tokenKeys(): string { return \"msal.token.keys\"; }\r\n static get accessTokenKey(): string { return \"msal.access.token.key\"; }\r\n static get expirationKey(): string { return \"msal.expiration.key\"; }\r\n static get stateLogin(): string { return \"msal.state.login\"; }\r\n static get stateAcquireToken(): string { return \"msal.state.acquireToken\"; }\r\n static get stateRenew(): string { return \"msal.state.renew\"; }\r\n static get nonceIdToken(): string { return \"msal.nonce.idtoken\"; }\r\n static get userName(): string { return \"msal.username\"; }\r\n static get idTokenKey(): string { return \"msal.idtoken\"; }\r\n static get loginRequest(): string { return \"msal.login.request\"; }\r\n static get loginError(): string { return \"msal.login.error\"; }\r\n static get renewStatus(): string { return \"msal.token.renew.status\"; }\r\n static get msal(): string { return \"msal\"; }\r\n static get resourceDelimeter(): string { return \"|\"; }\r\n static get tokenRenewStatusCancelled(): string { return \"Canceled\"; }\r\n static get tokenRenewStatusCompleted(): string { return \"Completed\"; }\r\n static get tokenRenewStatusInProgress(): string { return \"In Progress\"; }\r\n private static _popUpWidth: number = 483;\r\n static get popUpWidth(): number { return this._popUpWidth; }\r\n static set popUpWidth(width: number) {\r\n this._popUpWidth = width;\r\n }\r\n private static _popUpHeight: number = 600;\r\n static get popUpHeight(): number { return this._popUpHeight; }\r\n static set popUpHeight(height: number) {\r\n this._popUpHeight = height;\r\n }\r\n static get login(): string { return \"LOGIN\"; }\r\n static get renewToken(): string { return \"renewToken\"; }\r\n static get unknown(): string { return \"UNKNOWN\"; }\r\n static get urlHash(): string { return \"msal.urlHash\"; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorCodes {\r\n static get loginProgressError(): string { return \"login_progress_error\"; }\r\n static get acquireTokenProgressError(): string { return \"acquiretoken_progress_error\"; }\r\n static get inputScopesError(): string { return \"input_scopes_error\"; }\r\n static get endpointResolutionError(): string { return \"endpoints_resolution_error\"; }\r\n static get popUpWindowError(): string { return \"popup_window_error\"; }\r\n static get userLoginError(): string { return \"user_login_error\"; }\r\n static get userCancelledError(): string { return \"user_cancelled\"; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nexport class ErrorDescription {\r\n static get loginProgressError(): string { return \"Login is in progress\"; }\r\n static get acquireTokenProgressError(): string { return \"Acquire token is in progress\"; }\r\n static get inputScopesError(): string { return \"Invalid value of input scopes provided\"; }\r\n static get endpointResolutionError(): string { return \"Endpoints cannot be resolved\"; }\r\n static get popUpWindowError(): string { return \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"; }\r\n static get userLoginError(): string { return \"User login is required\"; }\r\n static get userCancelledError(): string { return \"User closed the popup window window and cancelled the flow\"; }\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Constants.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { Utils } from \"./Utils\";\r\n\r\nexport class User {\r\n\r\n displayableId: string;\r\n name: string;\r\n identityProvider: string;\r\n userIdentifier: string;\r\n idToken: Object\r\n\r\n /*\r\n * @hidden\r\n */\r\n constructor(displayableId: string, name: string, identityProvider: string, userIdentifier: string, idToken:Object) {\r\n this.displayableId = displayableId;\r\n this.name = name;\r\n this.identityProvider = identityProvider;\r\n this.userIdentifier = userIdentifier;\r\n this.idToken = idToken;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n static createUser(idToken: IdToken, clientInfo: ClientInfo, authority: string): User {\r\n let uid: string;\r\n let utid: string;\r\n if (!clientInfo) {\r\n uid = \"\";\r\n utid = \"\";\r\n }\r\n else {\r\n uid = clientInfo.uid;\r\n utid = clientInfo.utid;\r\n }\r\n\r\n const userIdentifier = Utils.base64EncodeStringUrlSafe(uid) + \".\" + Utils.base64EncodeStringUrlSafe(utid);\r\n return new User(idToken.preferredName, idToken.name, idToken.issuer, userIdentifier, idToken.decodedIdToken);\r\n }\r\n}\n\n\n// WEBPACK FOOTER //\n// ./src/User.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { Authority, AuthorityType } from \"./Authority\";\r\nimport { XhrClient } from \"./XHRClient\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class AadAuthority extends Authority {\r\n private static readonly AadInstanceDiscoveryEndpoint: string = \"https://login.microsoftonline.com/common/discovery/instance\";\r\n\r\n private get AadInstanceDiscoveryEndpointUrl(): string {\r\n return `${AadAuthority.AadInstanceDiscoveryEndpoint}?api-version=1.0&authorization_endpoint=${this.CanonicalAuthority}oauth2/v2.0/authorize`;\r\n }\r\n\r\n public constructor(authority: string, validateAuthority: boolean) {\r\n super(authority, validateAuthority);\r\n }\r\n\r\n public get AuthorityType(): AuthorityType {\r\n return AuthorityType.Aad;\r\n }\r\n\r\n private static readonly TrustedHostList: any = {\r\n \"login.windows.net\": \"login.windows.net\",\r\n \"login.chinacloudapi.cn\": \"login.chinacloudapi.cn\",\r\n \"login.cloudgovapi.us\": \"login.cloudgovapi.us\",\r\n \"login.microsoftonline.com\": \"login.microsoftonline.com\",\r\n \"login.microsoftonline.de\": \"login.microsoftonline.de\",\r\n \"login.microsoftonline.us\": \"login.microsoftonline.us\"\r\n };\r\n\r\n /**\r\n * Returns a promise which resolves to the OIDC endpoint\r\n * Only responds with the endpoint\r\n */\r\n public GetOpenIdConfigurationEndpointAsync(): Promise {\r\n var resultPromise: Promise = new Promise((resolve, reject) =>\r\n resolve(this.DefaultOpenIdConfigurationEndpoint));\r\n\r\n if (!this.IsValidationEnabled) {\r\n return resultPromise;\r\n }\r\n\r\n let host: string = this.CanonicalAuthorityUrlComponents.HostNameAndPort;\r\n if (this.IsInTrustedHostList(host)) {\r\n return resultPromise;\r\n }\r\n\r\n let client: XhrClient = new XhrClient();\r\n\r\n return client.sendRequestAsync(this.AadInstanceDiscoveryEndpointUrl, \"GET\", true)\r\n .then((response) => {\r\n return response.tenant_discovery_endpoint;\r\n });\r\n }\r\n\r\n /**\r\n * Checks to see if the host is in a list of trusted hosts\r\n * @param {string} The host to look up\r\n */\r\n public IsInTrustedHostList(host: string): boolean {\r\n return AadAuthority.TrustedHostList[host.toLowerCase()];\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/AadAuthority.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\n/*\r\n * XHR client for JSON endpoints\r\n * https://www.npmjs.com/package/async-promise\r\n * @hidden\r\n */\r\nexport class XhrClient {\r\n public sendRequestAsync(url: string, method: string, enableCaching?: boolean): Promise {\r\n return new Promise((resolve, reject) => {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url, /*async: */ true);\r\n if (enableCaching) {\r\n // TODO: (shivb) ensure that this can be cached\r\n // xhr.setRequestHeader(\"Cache-Control\", \"Public\");\r\n }\r\n\r\n xhr.onload = (ev) => {\r\n if (xhr.status < 200 || xhr.status >= 300) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n\r\n try {\r\n var jsonResponse = JSON.parse(xhr.responseText);\r\n } catch (e) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n\r\n resolve(jsonResponse);\r\n };\r\n\r\n xhr.onerror = (ev) => {\r\n reject(xhr.status);\r\n };\r\n\r\n if (method === \"GET\") {\r\n xhr.send();\r\n }\r\n else {\r\n throw \"not implemented\";\r\n }\r\n });\r\n }\r\n\r\n protected handleError(responseText: string): any {\r\n var jsonResponse;\r\n try {\r\n jsonResponse = JSON.parse(responseText);\r\n if (jsonResponse.error) {\r\n return jsonResponse.error;\r\n } else {\r\n throw responseText;\r\n }\r\n } catch (e) {\r\n return responseText;\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/XHRClient.ts","export { UserAgentApplication } from \"./UserAgentApplication\";\r\nexport { Logger } from \"./Logger\";\r\nexport { LogLevel } from \"./Logger\";\r\nexport { User } from \"./User\";\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.ts","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All Rights Reserved\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the 'Software'), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify,\r\n * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\r\n * permit persons to whom the Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS\r\n * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\r\n * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nimport { AccessTokenCacheItem } from \"./AccessTokenCacheItem\";\r\nimport { AccessTokenKey } from \"./AccessTokenKey\";\r\nimport { AccessTokenValue } from \"./AccessTokenValue\";\r\nimport { AuthenticationRequestParameters } from \"./AuthenticationRequestParameters\";\r\nimport { Authority } from \"./Authority\";\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { Constants, ErrorCodes, ErrorDescription } from \"./Constants\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { Logger } from \"./Logger\";\r\nimport { Storage } from \"./Storage\";\r\nimport { TokenResponse } from \"./RequestInfo\";\r\nimport { User } from \"./User\";\r\nimport { Utils } from \"./Utils\";\r\nimport { AuthorityFactory } from \"./AuthorityFactory\";\r\n\r\ndeclare global {\r\n interface Window {\r\n msal: Object;\r\n callBackMappedToRenewStates: Object;\r\n callBacksMappedToRenewStates: Object; }\r\n}\r\n\r\n/*\r\n * @hidden\r\n */\r\nlet ResponseTypes = {\r\n id_token: \"id_token\",\r\n token: \"token\",\r\n id_token_token: \"id_token token\"\r\n};\r\n\r\n/*\r\n * @hidden\r\n */\r\ninterface CacheResult {\r\n errorDesc: string;\r\n token: string;\r\n error: string;\r\n}\r\n\r\n/*\r\n * A type alias of for a tokenReceivedCallback function.\r\n * @param tokenReceivedCallback.errorDesc error description returned from the STS if API call fails.\r\n * @param tokenReceivedCallback.token token returned from STS if token request is successful.\r\n * @param tokenReceivedCallback.error error code returned from the STS if API call fails.\r\n * @param tokenReceivedCallback.tokenType tokenType returned from the STS if API call is successful. Possible values are: id_token OR access_token.\r\n */\r\nexport type tokenReceivedCallback = (errorDesc: string, token: string, error: string, tokenType: string) => void;\r\nconst resolveTokenOnlyIfOutOfIframe = (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\r\n const tokenAcquisitionMethod = descriptor.value;\r\n descriptor.value = function (...args: any[]) {\r\n return this.isInIframe()\r\n ? new Promise(() => { })\r\n : tokenAcquisitionMethod.apply(this, args);\r\n };\r\n return descriptor;\r\n};\r\nexport class UserAgentApplication {\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheLocations = {\r\n localStorage: \"localStorage\",\r\n sessionStorage: \"sessionStorage\"\r\n };\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheLocation: string;\r\n\r\n /*\r\n * Used to get the cache location\r\n */\r\n get cacheLocation(): string {\r\n return this._cacheLocation;\r\n }\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _logger: Logger;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _loginInProgress: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _acquireTokenInProgress: boolean;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _renewStates: Array;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _activeRenewals: Object;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _clockSkew = 300;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _cacheStorage: Storage;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _tokenReceivedCallback: tokenReceivedCallback = null;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private _user: User;\r\n\r\n /*\r\n * Client ID assigned to your app by Azure Active Directory.\r\n */\r\n clientId: string;\r\n\r\n /*\r\n * @hidden\r\n */\r\n private authorityInstance: Authority;\r\n\r\n /*\r\n * Used to set the authority.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<tenant>/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenant>//\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n */\r\n public set authority(val) {\r\n this.authorityInstance = AuthorityFactory.CreateInstance(val, this.validateAuthority);\r\n }\r\n\r\n /*\r\n * Used to get the authority.\r\n */\r\n public get authority(): string {\r\n return this.authorityInstance.CanonicalAuthority;\r\n }\r\n\r\n /*\r\n * Used to turn authority validation on/off.\r\n * When set to true (default), MSAL will compare the application\"s authority against well-known URLs templates representing well-formed authorities. It is useful when the authority is obtained at run time to prevent MSAL from displaying authentication prompts from malicious pages.\r\n */\r\n validateAuthority: boolean;\r\n\r\n /*\r\n * The redirect URI of the application, this should be same as the value in the application registration portal.\r\n * Defaults to `window.location.href`.\r\n */\r\n private _redirectUri: string;\r\n\r\n /*\r\n * Used to redirect the user to this location after logout.\r\n * Defaults to `window.location.href`.\r\n */\r\n private _postLogoutredirectUri: string;\r\n\r\n /*\r\n * Used to keep track of opened popup windows.\r\n */\r\n private _openedWindows: Array;\r\n\r\n /*\r\n * Used to track the authentication request.\r\n */\r\n private _requestType: string;\r\n\r\n loadFrameTimeout: number;\r\n\r\n private _navigateToLoginRequestUrl: boolean;\r\n\r\n /*\r\n * Initialize a UserAgentApplication with a given clientId and authority.\r\n * @constructor\r\n * @param {string} clientId - The clientID of your application, you should get this from the application registration portal.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://<instance>/<tenant>,\\ where <instance> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://<instance>/tfp/<tenantId>/<policyName>/\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param _tokenReceivedCallback - The function that will get the call back once this API is completed (either successfully or with a failure).\r\n * @param {boolean} validateAuthority - boolean to turn authority validation on/off.\r\n */\r\n constructor(\r\n clientId: string,\r\n authority: string | null,\r\n tokenReceivedCallback: tokenReceivedCallback,\r\n options:\r\n {\r\n validateAuthority?: boolean,\r\n cacheLocation?: string,\r\n redirectUri?: string,\r\n postLogoutRedirectUri?: string,\r\n logger?: Logger,\r\n loadFrameTimeout?: number,\r\n navigateToLoginRequestUrl?: boolean,\r\n } = {}) {\r\n const {\r\n validateAuthority = true,\r\n cacheLocation = \"sessionStorage\",\r\n redirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0],\r\n postLogoutRedirectUri = window.location.href.split(\"?\")[0].split(\"#\")[0],\r\n logger = new Logger(null),\r\n loadFrameTimeout = 6000,\r\n navigateToLoginRequestUrl = true\r\n } = options;\r\n\r\n this.loadFrameTimeout = loadFrameTimeout;\r\n this.clientId = clientId;\r\n this.validateAuthority = validateAuthority;\r\n this.authority = authority || \"https://login.microsoftonline.com/common\";\r\n this._tokenReceivedCallback = tokenReceivedCallback;\r\n this._redirectUri = redirectUri;\r\n this._postLogoutredirectUri = postLogoutRedirectUri;\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n this._renewStates = [];\r\n this._activeRenewals = {};\r\n this._cacheLocation = cacheLocation;\r\n this._navigateToLoginRequestUrl = navigateToLoginRequestUrl;\r\n if (!this._cacheLocations[cacheLocation]) {\r\n throw new Error(\"Cache Location is not valid. Provided value:\" + this._cacheLocation + \".Possible values are: \" + this._cacheLocations.localStorage + \", \" + this._cacheLocations.sessionStorage);\r\n }\r\n\r\n this._cacheStorage = new Storage(this._cacheLocation); //cache keys msal\r\n this._logger = logger;\r\n this._openedWindows = [];\r\n window.msal = this;\r\n window.callBackMappedToRenewStates = {};\r\n window.callBacksMappedToRenewStates = {};\r\n var urlHash = window.location.hash;\r\n var isCallback = this.isCallback(urlHash);\r\n \r\n if (isCallback) {\r\n this.handleAuthenticationResponse.call(this, urlHash);\r\n }\r\n else {\r\n var pendingCallback = this._cacheStorage.getItem(Constants.urlHash);\r\n if (pendingCallback) {\r\n this.processCallBack(pendingCallback);\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * Used to call the constructor callback with the token/error\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n * @hidden\r\n */\r\n private processCallBack(hash: string): void {\r\n this._logger.info('Processing the callback from redirect response');\r\n const requestInfo = this.getRequestInfo(hash);\r\n this.saveTokenFromHash(requestInfo);\r\n const token = requestInfo.parameters[Constants.accessToken] || requestInfo.parameters[Constants.idToken];\r\n const errorDesc = requestInfo.parameters[Constants.errorDescription];\r\n const error = requestInfo.parameters[Constants.error];\r\n var tokenType: string;\r\n\r\n if (requestInfo.parameters[Constants.accessToken]) {\r\n tokenType = Constants.accessToken;\r\n }\r\n else {\r\n tokenType = Constants.idToken;\r\n }\r\n\r\n this._cacheStorage.removeItem(Constants.urlHash);\r\n\r\n try {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback.call(this, errorDesc, token, error, tokenType);\r\n }\r\n\r\n } catch (err) {\r\n this._logger.error(\"Error occurred in token received callback function: \" + err);\r\n }\r\n }\r\n\r\n \r\n /*\r\n * Initiate the login process by redirecting the user to the STS authorization endpoint.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the authentication server during the interactive authentication flow.\r\n */\r\n loginRedirect(scopes?: Array, extraQueryParameters?: string): void {\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n if (this._loginInProgress) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(\"Login is in progress\", null, null, Constants.idToken);\r\n return;\r\n }\r\n }\r\n\r\n if (scopes) {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n if (this._tokenReceivedCallback) {\r\n this._tokenReceivedCallback(isValidScope, null, null, Constants.idToken);\r\n return;\r\n }\r\n }\r\n scopes = this.filterScopes(scopes);\r\n }\r\n\r\n this.authorityInstance.ResolveEndpointsAsync()\r\n .then(() => {\r\n const authenticationRequest = new AuthenticationRequestParameters(this.authorityInstance, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.loginRequest, window.location.href);\r\n this._cacheStorage.setItem(Constants.loginError, \"\");\r\n this._cacheStorage.setItem(Constants.stateLogin, authenticationRequest.state);\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, this.authority);\r\n }\r\n\r\n const urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n this._loginInProgress = true;\r\n this._requestType = Constants.login;\r\n this.promptUser(urlNavigate);\r\n });\r\n }\r\n\r\n /*\r\n * Initiate the login process by opening a popup window.\r\n * @param {Array.} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the interactive authentication flow.\r\n * @returns {Promise.} - A Promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the token or error.\r\n */\r\n loginPopup(scopes: Array, extraQueryParameters?: string): Promise {\r\n /*\r\n 1. Create navigate url\r\n 2. saves value in cache\r\n 3. redirect user to AAD\r\n */\r\n return new Promise((resolve, reject) => {\r\n if (this._loginInProgress) {\r\n reject(ErrorCodes.loginProgressError + \":\" + ErrorDescription.loginProgressError);\r\n return;\r\n }\r\n\r\n if (scopes) {\r\n const isValidScope = this.validateInputScope(scopes);\r\n if (isValidScope && !Utils.isEmpty(isValidScope)) {\r\n reject(ErrorCodes.inputScopesError + \":\" + ErrorDescription.inputScopesError);\r\n return;\r\n }\r\n\r\n scopes = this.filterScopes(scopes);\r\n }\r\n else {\r\n scopes = [this.clientId];\r\n }\r\n\r\n const scope = scopes.join(\" \").toLowerCase();\r\n var popUpWindow = this.openWindow(\"about:blank\", \"_blank\", 1, this, resolve, reject);\r\n if (!popUpWindow) {\r\n return;\r\n }\r\n\r\n this.authorityInstance.ResolveEndpointsAsync().then(() => {\r\n const authenticationRequest = new AuthenticationRequestParameters(this.authorityInstance, this.clientId, scopes, ResponseTypes.id_token, this._redirectUri);\r\n if (extraQueryParameters) {\r\n authenticationRequest.extraQueryParameters = extraQueryParameters;\r\n }\r\n\r\n this._cacheStorage.setItem(Constants.loginRequest, window.location.href);\r\n this._cacheStorage.setItem(Constants.loginError, \"\");\r\n this._cacheStorage.setItem(Constants.nonceIdToken, authenticationRequest.nonce);\r\n this._cacheStorage.setItem(Constants.msalError, \"\");\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, \"\");\r\n const authorityKey = Constants.authority + Constants.resourceDelimeter + authenticationRequest.state;\r\n if (Utils.isEmpty(this._cacheStorage.getItem(authorityKey))) {\r\n this._cacheStorage.setItem(authorityKey, this.authority);\r\n }\r\n\r\n const urlNavigate = authenticationRequest.createNavigateUrl(scopes) + \"&prompt=select_account\" + \"&response_mode=fragment\";\r\n this._renewStates.push(authenticationRequest.state);\r\n this.registerCallback(authenticationRequest.state, scope, resolve, reject);\r\n this._requestType = Constants.login;\r\n this._loginInProgress = true;\r\n if (popUpWindow) {\r\n this._logger.infoPii(\"Navigated Popup window to:\" + urlNavigate);\r\n popUpWindow.location.href = urlNavigate;\r\n }\r\n\r\n }, () => {\r\n this._logger.info(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.endpointResolutionError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.endpointResolutionError);\r\n if (reject) {\r\n reject(ErrorCodes.endpointResolutionError + \":\" + ErrorDescription.endpointResolutionError);\r\n }\r\n\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n });\r\n });\r\n }\r\n\r\n /*\r\n * Used to redirect the browser to the STS authorization endpoint\r\n * @param {string} urlNavigate - URL of the authorization endpoint\r\n * @hidden\r\n */\r\n private promptUser(urlNavigate: string) {\r\n if (urlNavigate && !Utils.isEmpty(urlNavigate)) {\r\n this._logger.infoPii(\"Navigate to:\" + urlNavigate);\r\n window.location.replace(urlNavigate);\r\n } else {\r\n this._logger.info(\"Navigate url is empty\");\r\n }\r\n }\r\n\r\n /*\r\n * Used to send the user to the redirect_uri after authentication is complete. The user\"s bearer token is attached to the URI fragment as an id_token/access_token field.\r\n * This function also closes the popup window after redirection.\r\n * @hidden\r\n * @ignore\r\n */\r\n private openWindow(urlNavigate: string, title: string, interval: number, instance: this, resolve?: Function, reject?: Function): Window {\r\n var popupWindow = this.openPopup(urlNavigate, title, Constants.popUpWidth, Constants.popUpHeight);\r\n if (popupWindow == null) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n this._logger.info(ErrorCodes.popUpWindowError + \":\" + ErrorDescription.popUpWindowError);\r\n this._cacheStorage.setItem(Constants.msalError, ErrorCodes.popUpWindowError);\r\n this._cacheStorage.setItem(Constants.msalErrorDescription, ErrorDescription.popUpWindowError);\r\n if (reject) {\r\n reject(ErrorCodes.popUpWindowError + \":\" + ErrorDescription.popUpWindowError);\r\n }\r\n return null;\r\n }\r\n\r\n this._openedWindows.push(popupWindow);\r\n var pollTimer = window.setInterval(() => {\r\n if (popupWindow && popupWindow.closed && instance._loginInProgress) {\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n if (reject) {\r\n reject(ErrorCodes.userCancelledError + \":\" + ErrorDescription.userCancelledError);\r\n }\r\n window.clearInterval(pollTimer);\r\n }\r\n\r\n try {\r\n var popUpWindowLocation = popupWindow.location;\r\n if (popUpWindowLocation.href.indexOf(this._redirectUri) !== -1) {\r\n window.clearInterval(pollTimer);\r\n instance._loginInProgress = false;\r\n instance._acquireTokenInProgress = false;\r\n this._logger.info(\"Closing popup window\");\r\n }\r\n } catch (e) {\r\n //Cross Domain url check error. Will be thrown until AAD redirects the user back to the app\"s root page with the token. No need to log or throw this error as it will create unnecessary traffic.\r\n }\r\n },\r\n interval);\r\n\r\n return popupWindow;\r\n }\r\n\r\n /*\r\n * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Defaults behaviour is to redirect the user to `window.location.href`.\r\n */\r\n logout(): void {\r\n this.clearCache();\r\n this._user = null;\r\n let logout = \"\";\r\n if (this._postLogoutredirectUri) {\r\n logout = \"post_logout_redirect_uri=\" + encodeURIComponent(this._postLogoutredirectUri);\r\n }\r\n\r\n const urlNavigate = this.authority + \"/oauth2/v2.0/logout?\" + logout;\r\n this.promptUser(urlNavigate);\r\n }\r\n\r\n /*\r\n * Used to configure the popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n private clearCache(): void {\r\n this._renewStates = [];\r\n const accessTokenItems = this._cacheStorage.getAllAccessTokens(Constants.clientId, Constants.authority);\r\n for (let i = 0; i < accessTokenItems.length; i++) {\r\n this._cacheStorage.removeItem(JSON.stringify(accessTokenItems[i].key));\r\n }\r\n\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.acquireTokenUser, Constants.renewStatus);\r\n this._cacheStorage.removeAcquireTokenEntries(Constants.authority + Constants.resourceDelimeter, Constants.renewStatus);\r\n this._cacheStorage.resetCacheItems();\r\n }\r\n\r\n /*\r\n * Configures popup window for login.\r\n * @ignore\r\n * @hidden\r\n */\r\n private openPopup(urlNavigate: string, title: string, popUpWidth: number, popUpHeight: number) {\r\n try {\r\n /*\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n const winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n const winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /*\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n const height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n const left = ((width / 2) - (popUpWidth / 2)) + winLeft;\r\n const top = ((height / 2) - (popUpHeight / 2)) + winTop;\r\n\r\n const popupWindow = window.open(urlNavigate, title, \"width=\" + popUpWidth + \", height=\" + popUpHeight + \", top=\" + top + \", left=\" + left);\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n\r\n return popupWindow;\r\n } catch (e) {\r\n this._logger.error(\"error opening popup \" + e.message);\r\n this._loginInProgress = false;\r\n this._acquireTokenInProgress = false;\r\n return null;\r\n }\r\n }\r\n\r\n /*\r\n * Used to validate the scopes input parameter requested by the developer.\r\n * @param {Array} scopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @ignore\r\n * @hidden\r\n */\r\n private validateInputScope(scopes: Array): string {\r\n if (!scopes || scopes.length < 1) {\r\n return \"Scopes cannot be passed as an empty array\";\r\n }\r\n\r\n if (!Array.isArray(scopes)) {\r\n throw new Error(\"API does not accept non-array scopes\");\r\n }\r\n\r\n if (scopes.indexOf(this.clientId) > -1) {\r\n if (scopes.length > 1) {\r\n return \"ClientId can only be provided as a single scope\";\r\n }\r\n }\r\n return \"\";\r\n }\r\n\r\n /*\r\n * Used to remove openid and profile from the list of scopes passed by the developer.These scopes are added by default\r\n * @hidden\r\n */\r\n private filterScopes(scopes: Array): Array {\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"openid\";\r\n });\r\n\r\n scopes = scopes.filter(function (element) {\r\n return element !== \"profile\";\r\n });\r\n\r\n return scopes;\r\n }\r\n /*\r\n * Used to add the developer requested callback to the array of callbacks for the specified scopes. The updated array is stored on the window object\r\n * @param {string} scope - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {string} expectedState - Unique state identifier (guid).\r\n * @param {Function} resolve - The resolve function of the promise object.\r\n * @param {Function} reject - The reject function of the promise object.\r\n * @ignore\r\n * @hidden\r\n */\r\n private registerCallback(expectedState: string, scope: string, resolve: Function, reject: Function): void {\r\n this._activeRenewals[scope] = expectedState;\r\n if (!window.callBacksMappedToRenewStates[expectedState]) {\r\n window.callBacksMappedToRenewStates[expectedState] = [];\r\n }\r\n window.callBacksMappedToRenewStates[expectedState].push({ resolve: resolve, reject: reject });\r\n if (!window.callBackMappedToRenewStates[expectedState]) {\r\n window.callBackMappedToRenewStates[expectedState] =\r\n (errorDesc: string, token: string, error: string, tokenType: string) => {\r\n this._activeRenewals[scope] = null;\r\n for (let i = 0; i < window.callBacksMappedToRenewStates[expectedState].length; ++i) {\r\n try {\r\n if (errorDesc || error) {\r\n window.callBacksMappedToRenewStates[expectedState][i].reject(errorDesc + \": \" + error);\r\n }\r\n else if (token) {\r\n window.callBacksMappedToRenewStates[expectedState][i].resolve(token);\r\n }\r\n } catch (e) {\r\n this._logger.warning(e);\r\n }\r\n }\r\n window.callBacksMappedToRenewStates[expectedState] = null;\r\n window.callBackMappedToRenewStates[expectedState] = null;\r\n };\r\n }\r\n }\r\n\r\n /*\r\n * Used to get token for the specified set of scopes from the cache\r\n * @param {AuthenticationRequestParameters} authenticationRequest - Request sent to the STS to obtain an id_token/access_token\r\n * @param {User} user - User for which the scopes were requested\r\n * @hidden\r\n */\r\n private getCachedToken(authenticationRequest: AuthenticationRequestParameters, user: User): CacheResult {\r\n let accessTokenCacheItem: AccessTokenCacheItem = null;\r\n const scopes = authenticationRequest.scopes;\r\n const tokenCacheItems = this._cacheStorage.getAllAccessTokens(this.clientId, user.userIdentifier); //filter by clientId and user\r\n if (tokenCacheItems.length === 0) { // No match found after initial filtering\r\n return null;\r\n }\r\n\r\n const filteredItems: Array = [];\r\n //if no authority passed\r\n if (!authenticationRequest.authority) {\r\n //filter by scope\r\n for (let i = 0; i < tokenCacheItems.length; i++) {\r\n const cacheItem = tokenCacheItems[i];\r\n const cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils.containsScope(cachedScopes, scopes)) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n\r\n //if only one cached token found\r\n if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n\r\n authenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(accessTokenCacheItem.key.authority, this.validateAuthority);\r\n }\r\n else if (filteredItems.length > 1) {\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n else {\r\n //no match found. check if there was a single authority used\r\n const authorityList = this.getUniqueAuthority(tokenCacheItems, \"authority\");\r\n if (authorityList.length > 1) {\r\n return {\r\n errorDesc: \"Multiple authorities found in the cache. Pass authority in the API overload.\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n\r\n authenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(authorityList[0], this.validateAuthority);\r\n }\r\n }\r\n else {\r\n //authority was passed in the API, filter by authority and scope\r\n for (let i = 0; i < tokenCacheItems.length; i++) {\r\n const cacheItem = tokenCacheItems[i];\r\n const cachedScopes = cacheItem.key.scopes.split(\" \");\r\n if (Utils.containsScope(cachedScopes, scopes) && cacheItem.key.authority === authenticationRequest.authority) {\r\n filteredItems.push(cacheItem);\r\n }\r\n }\r\n\r\n //no match\r\n if (filteredItems.length === 0) {\r\n return null;\r\n }\r\n //only one cachedToken Found\r\n else if (filteredItems.length === 1) {\r\n accessTokenCacheItem = filteredItems[0];\r\n }\r\n else {\r\n //more than one match found.\r\n return {\r\n errorDesc: \"The cache contains multiple tokens satisfying the requirements.Call AcquireToken again providing more requirements like authority\",\r\n token: null,\r\n error: \"multiple_matching_tokens_detected\"\r\n };\r\n }\r\n }\r\n\r\n if (accessTokenCacheItem != null) {\r\n const expired = Number(accessTokenCacheItem.value.expiresIn);\r\n // If expiration is within offset, it will force renew\r\n const offset = this._clockSkew || 300;\r\n if (expired && (expired > Utils.now() + offset)) {\r\n return {\r\n errorDesc: null,\r\n token: accessTokenCacheItem.value.accessToken,\r\n error: null\r\n };\r\n } else {\r\n this._cacheStorage.removeItem(JSON.stringify(filteredItems[0].key));\r\n return null;\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n /*\r\n * Used to filter all cached items and return a list of unique users based on userIdentifier.\r\n * @param {Array} Users - users saved in the cache.\r\n */\r\n getAllUsers(): Array {\r\n const users: Array = [];\r\n const accessTokenCacheItems = this._cacheStorage.getAllAccessTokens(Constants.clientId, Constants.authority);\r\n for (let i = 0; i < accessTokenCacheItems.length; i++) {\r\n const idToken = new IdToken(accessTokenCacheItems[i].value.idToken);\r\n const clientInfo = new ClientInfo(accessTokenCacheItems[i].value.clientInfo);\r\n const user = User.createUser(idToken, clientInfo, this.authority);\r\n users.push(user);\r\n }\r\n\r\n return this.getUniqueUsers(users);\r\n }\r\n\r\n /*\r\n * Used to filter users based on userIdentifier\r\n * @param {Array} Users - users saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n private getUniqueUsers(users: Array): Array {\r\n if (!users || users.length <= 1) {\r\n return users;\r\n }\r\n\r\n const flags: Array = [];\r\n const uniqueUsers: Array = [];\r\n for (let index = 0; index < users.length; ++index) {\r\n if (users[index].userIdentifier && flags.indexOf(users[index].userIdentifier) === -1) {\r\n flags.push(users[index].userIdentifier);\r\n uniqueUsers.push(users[index]);\r\n }\r\n }\r\n\r\n return uniqueUsers;\r\n }\r\n\r\n /*\r\n * Used to get a unique list of authoritues from the cache\r\n * @param {Array} accessTokenCacheItems - accessTokenCacheItems saved in the cache\r\n * @ignore\r\n * @hidden\r\n */\r\n private getUniqueAuthority(accessTokenCacheItems: Array, property: string): Array {\r\n const authorityList: Array = [];\r\n const flags: Array = [];\r\n accessTokenCacheItems.forEach(element => {\r\n if (element.key.hasOwnProperty(property) && (flags.indexOf(element.key[property]) === -1)) {\r\n flags.push(element.key[property]);\r\n authorityList.push(element.key[property]);\r\n }\r\n });\r\n return authorityList;\r\n }\r\n\r\n /*\r\n * Adds login_hint to authorization URL which is used to pre-fill the username field of sign in page for the user if known ahead of time\r\n * domain_hint can be one of users/organisations which when added skips the email based discovery process of the user\r\n * domain_req utid received as part of the clientInfo\r\n * login_req uid received as part of clientInfo\r\n * @param {string} urlNavigate - Authentication request url\r\n * @param {User} user - User for which the token is requested\r\n * @ignore\r\n * @hidden\r\n */\r\n private addHintParameters(urlNavigate: string, user: User): string {\r\n const userObject = user ? user : this.getUser();\r\n const decodedClientInfo = userObject.userIdentifier.split(\".\");\r\n const uid = Utils.base64DecodeStringUrlSafe(decodedClientInfo[0]);\r\n const utid = Utils.base64DecodeStringUrlSafe(decodedClientInfo[1]);\r\n if (!this.urlContainsQueryStringParameter(\"login_hint\", urlNavigate) && userObject.displayableId && !Utils.isEmpty(userObject.displayableId)) {\r\n urlNavigate += \"&login_hint=\" + encodeURIComponent(user.displayableId);\r\n }\r\n\r\n if (!Utils.isEmpty(uid) && !Utils.isEmpty(utid)) {\r\n if (!this.urlContainsQueryStringParameter(\"domain_req\", urlNavigate) && !Utils.isEmpty(utid)) {\r\n urlNavigate += \"&domain_req=\" + encodeURIComponent(utid);\r\n }\r\n\r\n if (!this.urlContainsQueryStringParameter(\"login_req\", urlNavigate) && !Utils.isEmpty(uid)) {\r\n urlNavigate += \"&login_req=\" + encodeURIComponent(uid);\r\n }\r\n\r\n if (!this.urlContainsQueryStringParameter(\"domain_hint\", urlNavigate) && !Utils.isEmpty(utid)) {\r\n if (utid === \"9188040d-6c67-4c5b-b112-36a304b66dad\") {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"consumers\");\r\n } else {\r\n urlNavigate += \"&domain_hint=\" + encodeURIComponent(\"organizations\");\r\n }\r\n }\r\n }\r\n\r\n return urlNavigate;\r\n }\r\n\r\n /*\r\n * Checks if the authorization endpoint URL contains query string parameters\r\n * @ignore\r\n * @hidden\r\n */\r\n private urlContainsQueryStringParameter(name: string, url: string): boolean {\r\n // regex to detect pattern of a ? or & followed by the name parameter and an equals character\r\n const regex = new RegExp(\"[\\\\?&]\" + name + \"=\");\r\n return regex.test(url);\r\n }\r\n\r\n /*\r\n * Used to obtain an access_token by redirecting the user to the authorization endpoint.\r\n * To renew idToken, clientId should be passed as the only scope in the scopes array.\r\n * @param {Array} scopes - Permissions you want included in the access token. Not all scopes are guaranteed to be included in the access token. Scopes like \"openid\" and \"profile\" are sent with every request.\r\n * @param {string} authority - A URL indicating a directory that MSAL can use to obtain tokens.\r\n * - In Azure AD, it is of the form https://{instance}/<tenant>, where <tenant> is the directory host (e.g. https://login.microsoftonline.com) and <tenant> is a identifier within the directory itself (e.g. a domain associated to the tenant, such as contoso.onmicrosoft.com, or the GUID representing the TenantID property of the directory)\r\n * - In Azure B2C, it is of the form https://{instance}/tfp/<tenant>/\r\n * - Default value is: \"https://login.microsoftonline.com/common\"\r\n * @param {User} user - The user for which the scopes are requested.The default user is the logged in user.\r\n * @param {string} extraQueryParameters - Key-value pairs to pass to the STS during the authentication flow.\r\n */\r\n acquireTokenRedirect(scopes: Array): void;\r\n acquireTokenRedirect(scopes: Array, authority: string): void;\r\n acquireTokenRedirect(scopes: Array, authority: string, user: User): void;\r\n acquireTokenRedirect(scopes: Array, authority: string, user: User, extraQueryParameters: string): void;\r\n acquireTokenRedirect(scopes: Array