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AC,OAAO,CAAC,YAAY,KAAK,UAAU,EAAE;YAC1D,4BAA4B;YAC5B,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAG,aAAa,CAAC,QAAQ,CAAC,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAQ,CAAC,CAAC;SACxH;IACL,CAAC;IA7UD;;;;OAIG;IACY,+BAAmB,GAAG,EAAE,CAAC;IAyU5C,kBAAC;CAAA;AA/UY,kCAAW;;;;;;;UCZxB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;ACtBA;;;GAGG;;AAEH;;;GAGG;AAEH,sDAAkI;AAAzH,iJAAoB;AAAE,iJAAoB;AAAE,mJAAqB;AAAE,mJAAqB;AACjG,uCAAkC;AAAzB,uGAAM;AACf,uCAAoC;AAA3B,2GAAQ;AACjB,yCAAoC;AAA3B,0GAAO;AAChB,0CAAmE;AAA1D,gHAAS;AAAE,oIAAmB;AACvC,2CAAkD;AAAzC,gHAAS;AAClB,sDAAqD;AAA5C,+HAAW;AACpB,+CAA+D;AAAtD,4HAAa;AAAE,4HAAa;AACrC,0DAAsE;AAA7D,6JAAwB;AACjC,8CAA8C;AAArC,yHAAY;AACrB,6CAAkD;AAAzC,sHAAW;AACpB,0CAA4C;AAAnC,6GAAQ;AACjB,6CAAkD;AAAzC,sHAAW;AAEpB,SAAS;AACT,2CAA8C;AAArC,gHAAS;AAClB,iDAA0D;AAAjD,kIAAe;AACxB,6CAAkD;AAAzC,sHAAW;AACpB,0DAA4E;AAAnE,6JAAwB;AACjC,8DAAoF;AAA3E,yKAA4B;AACrC,iDAA4C;AAAnC,kHAAO","sources":["webpack://Msal/webpack/universalModuleDefinition","webpack://Msal/./node_modules/tslib/tslib.es6.js","webpack://Msal/./src/Account.ts","webpack://Msal/./src/AuthResponse.ts","webpack://Msal/./src/AuthenticationParameters.ts","webpack://Msal/./src/ClientInfo.ts","webpack://Msal/./src/Configuration.ts","webpack://Msal/./src/IdToken.ts","webpack://Msal/./src/Logger.ts","webpack://Msal/./src/ScopeSet.ts","webpack://Msal/./src/ServerRequestParameters.ts","webpack://Msal/./src/UserAgentApplication.ts","webpack://Msal/./src/XHRClient.ts","webpack://Msal/./src/authority/Authority.ts","webpack://Msal/./src/authority/AuthorityFactory.ts","webpack://Msal/./src/authority/TrustedAuthority.ts","webpack://Msal/./src/cache/AccessTokenCacheItem.ts","webpack://Msal/./src/cache/AccessTokenKey.ts","webpack://Msal/./src/cache/AccessTokenValue.ts","webpack://Msal/./src/cache/AuthCache.ts","webpack://Msal/./src/cache/BrowserStorage.ts","webpack://Msal/./src/error/AuthError.ts","webpack://Msal/./src/error/ClientAuthError.ts","webpack://Msal/./src/error/ClientConfigurationError.ts","webpack://Msal/./src/error/InteractionRequiredAuthError.ts","webpack://Msal/./src/error/ServerError.ts","webpack://Msal/./src/packageMetadata.ts","webpack://Msal/./src/telemetry/ApiEvent.ts","webpack://Msal/./src/telemetry/DefaultEvent.ts","webpack://Msal/./src/telemetry/HttpEvent.ts","webpack://Msal/./src/telemetry/TelemetryConstants.ts","webpack://Msal/./src/telemetry/TelemetryEvent.ts","webpack://Msal/./src/telemetry/TelemetryManager.ts","webpack://Msal/./src/telemetry/TelemetryUtils.ts","webpack://Msal/./src/utils/AuthCacheUtils.ts","webpack://Msal/./src/utils/Constants.ts","webpack://Msal/./src/utils/CryptoUtils.ts","webpack://Msal/./src/utils/RequestUtils.ts","webpack://Msal/./src/utils/ResponseUtils.ts","webpack://Msal/./src/utils/StringUtils.ts","webpack://Msal/./src/utils/TimeUtils.ts","webpack://Msal/./src/utils/TokenUtils.ts","webpack://Msal/./src/utils/UrlUtils.ts","webpack://Msal/./src/utils/WindowUtils.ts","webpack://Msal/webpack/bootstrap","webpack://Msal/./src/index.ts"],"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})(self, function() {\nreturn ","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n 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 return extendStatics(d, b);\r\n};\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 = function() {\r\n __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 return __assign.apply(this, arguments);\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++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\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 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\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) : adopt(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 = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, 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 __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") 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 throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\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 __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\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) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\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], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\nimport { StringDict } from \"./MsalTypes\";\r\n\r\n/**\r\n * accountIdentifier combination of idToken.uid and idToken.utid\r\n * homeAccountIdentifier combination of clientInfo.uid and clientInfo.utid\r\n * userName idToken.preferred_username\r\n * name idToken.name\r\n * idToken idToken\r\n * sid idToken.sid - session identifier\r\n * environment idtoken.issuer (the authority that issues the token)\r\n */\r\nexport class Account {\r\n\r\n accountIdentifier: string;\r\n homeAccountIdentifier: string;\r\n userName: string;\r\n name: string;\r\n idToken: StringDict; // will be deprecated soon\r\n idTokenClaims: StringDict;\r\n sid: string;\r\n environment: string;\r\n\r\n /**\r\n * Creates an Account Object\r\n * @praram accountIdentifier\r\n * @param homeAccountIdentifier\r\n * @param userName\r\n * @param name\r\n * @param idToken\r\n * @param sid\r\n * @param environment\r\n */\r\n constructor(accountIdentifier: string, homeAccountIdentifier: string, userName: string, name: string, idTokenClaims: StringDict, sid: string, environment: string) {\r\n this.accountIdentifier = accountIdentifier;\r\n this.homeAccountIdentifier = homeAccountIdentifier;\r\n this.userName = userName;\r\n this.name = name;\r\n // will be deprecated soon\r\n this.idToken = idTokenClaims;\r\n this.idTokenClaims = idTokenClaims;\r\n this.sid = sid;\r\n this.environment = environment;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @param idToken\r\n * @param clientInfo\r\n */\r\n static createAccount(idToken: IdToken, clientInfo: ClientInfo): Account {\r\n\r\n // create accountIdentifier\r\n const accountIdentifier: string = idToken.objectId || idToken.subject;\r\n\r\n // create homeAccountIdentifier\r\n const uid: string = clientInfo ? clientInfo.uid : \"\";\r\n const utid: string = clientInfo ? clientInfo.utid : \"\";\r\n\r\n let homeAccountIdentifier: string;\r\n if (!StringUtils.isEmpty(uid)) {\r\n homeAccountIdentifier = StringUtils.isEmpty(utid)? CryptoUtils.base64Encode(uid): CryptoUtils.base64Encode(uid) + \".\" + CryptoUtils.base64Encode(utid);\r\n }\r\n return new Account(accountIdentifier, homeAccountIdentifier, idToken.preferredName, idToken.name, idToken.claims, idToken.sid, idToken.issuer);\r\n }\r\n\r\n /**\r\n * Utils function to compare two Account objects - used to check if the same user account is logged in\r\n *\r\n * @param a1: Account object\r\n * @param a2: Account object\r\n */\r\n static compareAccounts(a1: Account, a2: Account): boolean {\r\n if (!a1 || !a2) {\r\n return false;\r\n }\r\n if (a1.homeAccountIdentifier && a2.homeAccountIdentifier) {\r\n if (a1.homeAccountIdentifier === a2.homeAccountIdentifier) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Account } from \"./Account\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { StringDict } from \"./MsalTypes\";\r\n\r\nexport type AuthResponse = {\r\n uniqueId: string;\r\n tenantId: string;\r\n tokenType: string;\r\n idToken: IdToken;\r\n idTokenClaims: StringDict;\r\n accessToken: string;\r\n scopes: Array;\r\n expiresOn: Date;\r\n account: Account;\r\n accountState: string;\r\n fromCache: boolean\r\n};\r\n\r\nexport function buildResponseStateOnly(state: string) : AuthResponse {\r\n return {\r\n uniqueId: \"\",\r\n tenantId: \"\",\r\n tokenType: \"\",\r\n idToken: null,\r\n idTokenClaims: null,\r\n accessToken: \"\",\r\n scopes: null,\r\n expiresOn: null,\r\n account: null,\r\n accountState: state,\r\n fromCache: false\r\n };\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Account } from \"./Account\";\r\nimport { ClientConfigurationError } from \"./error/ClientConfigurationError\";\r\nimport { StringDict } from \"./MsalTypes\";\r\n\r\n/**\r\n * @link AuthenticationParameters}AuthenticationParameters\r\n */\r\nexport type AuthenticationParameters = {\r\n scopes?: Array;\r\n extraScopesToConsent?: Array;\r\n prompt?: string;\r\n extraQueryParameters?: StringDict;\r\n claimsRequest?: string;\r\n authority?: string;\r\n state?: string;\r\n correlationId?: string;\r\n account?: Account;\r\n sid?: string;\r\n loginHint?: string;\r\n forceRefresh?: boolean;\r\n redirectUri?: string;\r\n redirectStartPage?: string;\r\n authorityMetadata?: string;\r\n onRedirectNavigate?: ((url: string) => void | boolean)\r\n};\r\n\r\nexport function validateClaimsRequest(request: AuthenticationParameters): void {\r\n if (!request.claimsRequest) {\r\n return;\r\n }\r\n try {\r\n JSON.parse(request.claimsRequest);\r\n } catch (e) {\r\n throw ClientConfigurationError.createClaimsRequestParsingError(e);\r\n }\r\n\r\n // TODO: More validation will be added when the server team tells us how they have actually implemented claims\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { ClientAuthError } from \"./error/ClientAuthError\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\nimport { IdToken } from \"./IdToken\";\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 static createClientInfoFromIdToken(idToken:IdToken, authority: string): ClientInfo {\r\n const clientInfo = {\r\n uid: idToken.subject, \r\n utid: \"\"\r\n };\r\n\r\n return new ClientInfo(CryptoUtils.base64Encode(JSON.stringify(clientInfo)), authority);\r\n }\r\n\r\n constructor(rawClientInfo: string, authority: string) {\r\n if (!rawClientInfo || StringUtils.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 = CryptoUtils.base64Decode(rawClientInfo);\r\n const clientInfo: ClientInfo = JSON.parse(decodedClientInfo);\r\n if (clientInfo) {\r\n if (clientInfo.hasOwnProperty(\"uid\")) {\r\n this.uid = authority ? ClientInfo.stripPolicyFromUid(clientInfo.uid, authority): 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 ClientAuthError.createClientInfoDecodingError(e);\r\n }\r\n }\r\n\r\n static stripPolicyFromUid(uid: string, authority: string): string {\r\n const uidSegments = uid.split(\"-\");\r\n // Reverse the url segments so the last one is more easily accessible\r\n const urlSegments = authority.split(\"/\").reverse();\r\n let policy = \"\";\r\n\r\n if (!StringUtils.isEmpty(urlSegments[0])) {\r\n policy = urlSegments[0];\r\n } else if (urlSegments.length > 1) {\r\n // If the original url had a trailing slash, urlSegments[0] would be \"\" so take the next element\r\n policy = urlSegments[1];\r\n }\r\n\r\n if (uidSegments[uidSegments.length - 1] === policy) {\r\n // If the last segment of uid matches the last segment of authority url, remove the last segment of uid\r\n return uidSegments.slice(0, uidSegments.length - 1).join(\"-\");\r\n }\r\n\r\n return uid;\r\n }\r\n\r\n public encodeClientInfo(): string {\r\n const clientInfo = JSON.stringify({uid: this.uid, utid: this.utid});\r\n\r\n return CryptoUtils.base64Encode(clientInfo);\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Logger } from \"./Logger\";\r\nimport { UrlUtils } from \"./utils/UrlUtils\";\r\nimport { TelemetryEmitter } from \"./telemetry/TelemetryTypes\";\r\n\r\n/**\r\n * Cache location options supported by MSAL are:\r\n * - local storage: MSAL uses browsers local storage to store its cache\r\n * - session storage: MSAL uses the browsers session storage to store its cache\r\n */\r\nexport type CacheLocation = \"localStorage\" | \"sessionStorage\";\r\n\r\n/**\r\n * Defaults for the Configuration Options\r\n */\r\nconst FRAME_TIMEOUT = 6000;\r\nconst OFFSET = 300;\r\nconst NAVIGATE_FRAME_WAIT = 500;\r\n\r\n/**\r\n * @type AuthOptions: Use this to configure the auth options in the Configuration object\r\n *\r\n * - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\r\n * - authority - You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\r\n * - validateAuthority - Used to turn authority validation on/off. 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 * - authorityMetadata - OpenID configuration metadata for the configured authority. Must be passed as a JSON string.\r\n * - knownAuthorities - If validateAuthority is set to True, this will be used to set the Trusted Host list. Defaults to empty array\r\n * - redirectUri - The redirect URI of the application, this should be same as the value in the application registration portal.Defaults to `window.location.href`.\r\n * - postLogoutRedirectUri - Used to redirect the user to this location after logout. Defaults to `window.location.href`.\r\n * - navigateToLoginRequestUrl - Used to turn off default navigation to start page after login. Default is true. This is used only for redirect flows.\r\n *\r\n */\r\nexport type AuthOptions = {\r\n clientId: string;\r\n authority?: string;\r\n validateAuthority?: boolean;\r\n authorityMetadata?: string;\r\n knownAuthorities?: Array;\r\n redirectUri?: string | (() => string);\r\n postLogoutRedirectUri?: string | (() => string);\r\n navigateToLoginRequestUrl?: boolean;\r\n};\r\n\r\n/**\r\n * Use this to configure the below cache configuration options:\r\n *\r\n * - cacheLocation - Used to specify the cacheLocation user wants to set. Valid values are \"localStorage\" and \"sessionStorage\"\r\n * - storeAuthStateInCookie - If set, MSAL store's the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.\r\n */\r\nexport type CacheOptions = {\r\n cacheLocation?: CacheLocation;\r\n storeAuthStateInCookie?: boolean;\r\n};\r\n\r\n/**\r\n * Telemetry Config Options\r\n * - applicationName - Name of the consuming apps application\r\n * - applicationVersion - Verison of the consuming application\r\n * - telemetryEmitter - Function where telemetry events are flushed to\r\n */\r\nexport type TelemetryOptions = {\r\n applicationName: string;\r\n applicationVersion: string;\r\n telemetryEmitter: TelemetryEmitter\r\n // TODO, add onlyAddFailureTelemetry option\r\n};\r\n\r\n/**\r\n * Library Specific Options\r\n *\r\n * - logger - Used to initialize the Logger object; TODO: Expand on logger details or link to the documentation on logger\r\n * - loadFrameTimeout - maximum time the library should wait for a frame to load\r\n * - tokenRenewalOffsetSeconds - sets the window of offset needed to renew the token before expiry\r\n * - navigateFrameWait - sets the wait time for hidden iFrame navigation\r\n */\r\nexport type SystemOptions = {\r\n logger?: Logger;\r\n loadFrameTimeout?: number;\r\n tokenRenewalOffsetSeconds?: number;\r\n navigateFrameWait?: number;\r\n telemetry?: TelemetryOptions\r\n};\r\n\r\n/**\r\n * App/Framework specific environment support\r\n *\r\n * - isAngular - flag set to determine if it is Angular Framework. MSAL uses this to broadcast tokens. More to come here: detangle this dependency from core.\r\n * - unprotectedResources - Array of URI's which are unprotected resources. MSAL will not attach a token to outgoing requests that have these URI. Defaults to 'null'.\r\n * - protectedResourceMap - This is mapping of resources to scopes used by MSAL for automatically attaching access tokens in web API calls.A single access token is obtained for the resource. So you can map a specific resource path as follows: {\"https://graph.microsoft.com/v1.0/me\", [\"user.read\"]}, or the app URL of the resource as: {\"https://graph.microsoft.com/\", [\"user.read\", \"mail.send\"]}. This is required for CORS calls.\r\n *\r\n */\r\nexport type FrameworkOptions = {\r\n isAngular?: boolean;\r\n unprotectedResources?: Array;\r\n protectedResourceMap?: Map>;\r\n};\r\n\r\n/**\r\n * Use the configuration object to configure MSAL and initialize the UserAgentApplication.\r\n *\r\n * This object allows you to configure important elements of MSAL functionality:\r\n * - auth: this is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform\r\n * - cache: this is where you configure cache location and whether to store cache in cookies\r\n * - system: this is where you can configure the logger, frame timeout etc.\r\n * - framework: this is where you can configure the running mode of angular. More to come here soon.\r\n */\r\nexport type Configuration = {\r\n auth: AuthOptions,\r\n cache?: CacheOptions,\r\n system?: SystemOptions,\r\n framework?: FrameworkOptions\r\n};\r\n\r\nconst DEFAULT_AUTH_OPTIONS: AuthOptions = {\r\n clientId: \"\",\r\n authority: null,\r\n validateAuthority: true,\r\n authorityMetadata: \"\",\r\n knownAuthorities: [],\r\n redirectUri: () => UrlUtils.getCurrentUrl(),\r\n postLogoutRedirectUri: () => UrlUtils.getCurrentUrl(),\r\n navigateToLoginRequestUrl: true\r\n};\r\n\r\nconst DEFAULT_CACHE_OPTIONS: CacheOptions = {\r\n cacheLocation: \"sessionStorage\",\r\n storeAuthStateInCookie: false\r\n};\r\n\r\nconst DEFAULT_SYSTEM_OPTIONS: SystemOptions = {\r\n logger: new Logger(null),\r\n loadFrameTimeout: FRAME_TIMEOUT,\r\n tokenRenewalOffsetSeconds: OFFSET,\r\n navigateFrameWait: NAVIGATE_FRAME_WAIT\r\n};\r\n\r\nconst DEFAULT_FRAMEWORK_OPTIONS: FrameworkOptions = {\r\n isAngular: false,\r\n unprotectedResources: new Array(),\r\n protectedResourceMap: new Map>()\r\n};\r\n\r\n/**\r\n * MSAL function that sets the default options when not explicitly configured from app developer\r\n *\r\n * @param TAuthOptions\r\n * @param TCacheOptions\r\n * @param TSystemOptions\r\n * @param TFrameworkOptions\r\n * @param TAuthorityDataOptions\r\n *\r\n * @returns TConfiguration object\r\n */\r\n\r\nexport function buildConfiguration({ auth, cache = {}, system = {}, framework = {}}: Configuration): Configuration {\r\n const overlayedConfig: Configuration = {\r\n auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },\r\n cache: { ...DEFAULT_CACHE_OPTIONS, ...cache },\r\n system: { ...DEFAULT_SYSTEM_OPTIONS, ...system },\r\n framework: { ...DEFAULT_FRAMEWORK_OPTIONS, ...framework }\r\n };\r\n return overlayedConfig;\r\n}\r\n\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientAuthError } from \"./error/ClientAuthError\";\r\nimport { TokenUtils } from \"./utils/TokenUtils\";\r\nimport { StringDict } from \"./MsalTypes\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\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 claims: StringDict;\r\n sid: string;\r\n cloudInstance: string;\r\n /* tslint:disable:no-string-literal */\r\n constructor(rawIdToken: string) {\r\n if (StringUtils.isEmpty(rawIdToken)) {\r\n throw ClientAuthError.createIdTokenNullOrEmptyError(rawIdToken);\r\n }\r\n try {\r\n this.rawIdToken = rawIdToken;\r\n this.claims = TokenUtils.extractIdToken(rawIdToken) as StringDict;\r\n if (this.claims) {\r\n if (this.claims.hasOwnProperty(\"iss\")) {\r\n this.issuer = this.claims[\"iss\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"oid\")) {\r\n this.objectId = this.claims[\"oid\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"sub\")) {\r\n this.subject = this.claims[\"sub\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"tid\")) {\r\n this.tenantId = this.claims[\"tid\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"ver\")) {\r\n this.version = this.claims[\"ver\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"preferred_username\")) {\r\n this.preferredName = this.claims[\"preferred_username\"];\r\n } else if (this.claims.hasOwnProperty(\"upn\")) {\r\n this.preferredName = this.claims[\"upn\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"name\")) {\r\n this.name = this.claims[\"name\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"nonce\")) {\r\n this.nonce = this.claims[\"nonce\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"exp\")) {\r\n this.expiration = this.claims[\"exp\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"home_oid\")) {\r\n this.homeObjectId = this.claims[\"home_oid\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"sid\")) {\r\n this.sid = this.claims[\"sid\"];\r\n }\r\n\r\n if (this.claims.hasOwnProperty(\"cloud_instance_host_name\")) {\r\n this.cloudInstance = this.claims[\"cloud_instance_host_name\"];\r\n }\r\n /* tslint:enable:no-string-literal */\r\n }\r\n } catch (e) {\r\n /*\r\n * TODO: This error here won't really every be thrown, since extractIdToken() returns null if the decodeJwt() fails.\r\n * Need to add better error handling here to account for being unable to decode jwts.\r\n */\r\n throw ClientAuthError.createIdTokenParsingError(e);\r\n }\r\n }\r\n\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\nimport { version as libraryVersion } from \"./packageMetadata\";\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 // TODO: This does not seem to be a singleton!! Change or Delete.\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 const timestamp = new Date().toUTCString();\r\n let log: string;\r\n if (!StringUtils.isEmpty(this.correlationId)) {\r\n log = timestamp + \":\" + this.correlationId + \"-\" + libraryVersion + \"-\" + LogLevel[logLevel] + (containsPii ? \"-pii\" : \"\") + \" \" + logMessage;\r\n }\r\n else {\r\n log = timestamp + \":\" + libraryVersion + \"-\" + LogLevel[logLevel] + (containsPii ? \"-pii\" : \"\") + \" \" + 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): void {\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 isPiiLoggingEnabled(): boolean {\r\n return this.piiLoggingEnabled;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientConfigurationError } from \"./error/ClientConfigurationError\";\r\nimport { Constants } from \"./utils/Constants\";\r\n\r\nexport class ScopeSet {\r\n\r\n /**\r\n * Check if there are dup scopes in a given request\r\n *\r\n * @param cachedScopes\r\n * @param scopes\r\n */\r\n // TODO: Rename this, intersecting scopes isn't a great name for duplicate checker\r\n static isIntersectingScopes(cachedScopes: Array, scopes: Array): boolean {\r\n const convertedCachedScopes = this.trimAndConvertArrayToLowerCase([...cachedScopes]);\r\n const requestScopes = this.trimAndConvertArrayToLowerCase([...scopes]);\r\n for (let i = 0; i < requestScopes.length; i++) {\r\n if (convertedCachedScopes.indexOf(requestScopes[i].toLowerCase()) > -1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if a given scope is present in the request\r\n *\r\n * @param cachedScopes\r\n * @param scopes\r\n */\r\n static containsScope(cachedScopes: Array, scopes: Array): boolean {\r\n const convertedCachedScopes = this.trimAndConvertArrayToLowerCase([...cachedScopes]);\r\n const requestScopes = this.trimAndConvertArrayToLowerCase([...scopes]);\r\n return requestScopes.every((value: string): boolean => convertedCachedScopes.indexOf(value.toString().toLowerCase()) >= 0);\r\n }\r\n\r\n /**\r\n * Trims and converts string to lower case\r\n *\r\n * @param scopes\r\n */\r\n // TODO: Rename this, too generic name for a function that only deals with scopes\r\n static trimAndConvertToLowerCase(scope: string): string {\r\n return scope.trim().toLowerCase();\r\n }\r\n\r\n /**\r\n * Performs trimAndConvertToLowerCase on string array\r\n * @param scopes \r\n */\r\n static trimAndConvertArrayToLowerCase(scopes: Array): Array {\r\n return scopes.map(scope => this.trimAndConvertToLowerCase(scope));\r\n }\r\n\r\n /**\r\n * Trims each scope in scopes array\r\n * @param scopes \r\n */\r\n static trimScopes(scopes: Array): Array {\r\n return scopes.map(scope => scope.trim());\r\n }\r\n\r\n /**\r\n * Remove one element from a scope array\r\n *\r\n * @param scopes\r\n * @param scope\r\n */\r\n // TODO: Rename this, too generic name for a function that only deals with scopes\r\n static removeElement(scopes: Array, scope: string): Array {\r\n const scopeVal = this.trimAndConvertToLowerCase(scope);\r\n return scopes.filter(value => value !== scopeVal);\r\n }\r\n\r\n /**\r\n * Parse the scopes into a formatted scopeList\r\n * @param scopes\r\n */\r\n static 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 /**\r\n * @hidden\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 * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not\r\n * @ignore\r\n */\r\n static validateInputScope(scopes: Array, scopesRequired: boolean): void {\r\n if (!scopes) {\r\n if (scopesRequired) {\r\n throw ClientConfigurationError.createScopesRequiredError(scopes);\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n // Check that scopes is an array object (also throws error if scopes == null)\r\n if (!Array.isArray(scopes)) {\r\n throw ClientConfigurationError.createScopesNonArrayError(scopes);\r\n }\r\n\r\n // Check that scopes is not an empty array\r\n if (scopes.length < 1 && scopesRequired) {\r\n throw ClientConfigurationError.createEmptyScopesArrayError(scopes.toString());\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Extracts scope value from the state sent with the authentication request.\r\n * @param {string} state\r\n * @returns {string} scope.\r\n * @ignore\r\n */\r\n static getScopeFromState(state: string): string {\r\n if (state) {\r\n const splitIndex = state.indexOf(Constants.resourceDelimiter);\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 * @ignore\r\n * Appends extraScopesToConsent if passed\r\n * @param {@link AuthenticationParameters}\r\n */\r\n static appendScopes(reqScopes: Array, reqExtraScopesToConsent: Array): Array {\r\n if (reqScopes) {\r\n const convertedExtraScopes = reqExtraScopesToConsent ? this.trimAndConvertArrayToLowerCase([...reqExtraScopesToConsent]) : null;\r\n const convertedReqScopes = this.trimAndConvertArrayToLowerCase([...reqScopes]);\r\n return convertedExtraScopes ? [...convertedReqScopes, ...convertedExtraScopes] : convertedReqScopes;\r\n }\r\n return null;\r\n }\r\n\r\n // #endregion\r\n\r\n /**\r\n * @ignore\r\n * Returns true if the scopes array only contains openid and/or profile\r\n */\r\n static onlyContainsOidcScopes(scopes: Array): boolean {\r\n const scopesCount = scopes.length;\r\n let oidcScopesFound = 0;\r\n\r\n if (scopes.indexOf(Constants.openidScope) > -1) {\r\n oidcScopesFound += 1;\r\n }\r\n\r\n if (scopes.indexOf(Constants.profileScope) > -1) {\r\n oidcScopesFound += 1;\r\n }\r\n\r\n return (scopesCount > 0 && scopesCount === oidcScopesFound);\r\n }\r\n\r\n /**\r\n * @ignore\r\n * Returns true if the scopes array only contains openid and/or profile\r\n */\r\n static containsAnyOidcScopes(scopes: Array): boolean {\r\n const containsOpenIdScope = scopes.indexOf(Constants.openidScope) > -1;\r\n const containsProfileScope = scopes.indexOf(Constants.profileScope) > -1;\r\n\r\n return (containsOpenIdScope || containsProfileScope);\r\n }\r\n\r\n /**\r\n * @ignore\r\n * Returns true if the clientId is the only scope in the array\r\n */\r\n static onlyContainsClientId(scopes: Array, clientId: string): boolean {\r\n // Double negation to force false value returned in case scopes is null\r\n return !!scopes && (scopes.indexOf(clientId) > -1 && scopes.length === 1);\r\n }\r\n\r\n /**\r\n * @ignore\r\n * Adds missing OIDC scopes to scopes array without duplication. Since STS requires OIDC scopes for\r\n * all implicit flow requests, 'openid' and 'profile' should always be included in the final request\r\n */\r\n static appendDefaultScopes(scopes: Array): Array {\r\n const extendedScopes = scopes;\r\n if (extendedScopes.indexOf(Constants.openidScope) === -1) {\r\n extendedScopes.push(Constants.openidScope);\r\n }\r\n\r\n if(extendedScopes.indexOf(Constants.profileScope) === -1) {\r\n extendedScopes.push(Constants.profileScope);\r\n }\r\n\r\n return extendedScopes;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * Removes present OIDC scopes from scopes array.\r\n */\r\n static removeDefaultScopes(scopes: Array): Array {\r\n return scopes.filter(scope => {\r\n return (scope !== Constants.openidScope && scope !== Constants.profileScope);\r\n });\r\n }\r\n\r\n /**\r\n * @ignore\r\n * Removes clientId from scopes array if included as only scope. If it's not the only scope, it is treated as a resource scope.\r\n * @param scopes Array: Pre-normalized scopes array\r\n * @param clientId string: The application's clientId that is searched for in the scopes array\r\n */\r\n static translateClientIdIfSingleScope(scopes: Array, clientId: string): Array {\r\n return this.onlyContainsClientId(scopes, clientId) ? Constants.oidcScopes : scopes;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Authority } from \"./authority/Authority\";\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { AuthenticationParameters } from \"./AuthenticationParameters\";\r\nimport { StringDict } from \"./MsalTypes\";\r\nimport { Account } from \"./Account\";\r\nimport { SSOTypes, Constants, PromptState, ResponseTypes } from \"./utils/Constants\";\r\nimport { ScopeSet } from \"./ScopeSet\";\r\nimport { version as libraryVersion } from \"./packageMetadata\";\r\n\r\n/**\r\n * Nonce: OIDC Nonce definition: https://openid.net/specs/openid-connect-core-1_0.html#IDToken\r\n * State: OAuth Spec: https://tools.ietf.org/html/rfc6749#section-10.12\r\n * @hidden\r\n */\r\nexport class ServerRequestParameters {\r\n\r\n authorityInstance: Authority;\r\n clientId: string;\r\n scopes: Array;\r\n\r\n nonce: string;\r\n state: string;\r\n\r\n // telemetry information\r\n xClientVer: string;\r\n xClientSku: string;\r\n correlationId: string;\r\n\r\n responseType: string;\r\n redirectUri: string;\r\n\r\n promptValue: string;\r\n claimsValue: string;\r\n\r\n queryParameters: string;\r\n extraQueryParameters: string;\r\n\r\n public get authority(): string {\r\n return this.authorityInstance ? this.authorityInstance.CanonicalAuthority : null;\r\n }\r\n\r\n /**\r\n * Constructor\r\n * @param authority\r\n * @param clientId\r\n * @param scope\r\n * @param responseType\r\n * @param redirectUri\r\n * @param state\r\n */\r\n constructor (authority: Authority, clientId: string, responseType: string, redirectUri: string, scopes: Array, state: string, correlationId: string) {\r\n this.authorityInstance = authority;\r\n this.clientId = clientId;\r\n this.nonce = CryptoUtils.createNewGuid();\r\n\r\n // set scope to clientId if null\r\n this.scopes = scopes ? [ ...scopes] : Constants.oidcScopes;\r\n this.scopes = ScopeSet.trimScopes(this.scopes);\r\n\r\n // set state (already set at top level)\r\n this.state = state;\r\n\r\n // set correlationId\r\n this.correlationId = correlationId;\r\n\r\n // telemetry information\r\n this.xClientSku = \"MSAL.JS\";\r\n this.xClientVer = libraryVersion;\r\n\r\n this.responseType = responseType;\r\n this.redirectUri = redirectUri;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Utility to populate QueryParameters and ExtraQueryParameters to ServerRequestParamerers\r\n * @param request\r\n * @param serverAuthenticationRequest\r\n */\r\n populateQueryParams(account: Account, request: AuthenticationParameters|null, adalIdTokenObject?: object, silentCall?: boolean): void {\r\n let queryParameters: StringDict = {};\r\n\r\n if (request) {\r\n // add the prompt parameter to serverRequestParameters if passed\r\n if (request.prompt) {\r\n this.promptValue = request.prompt;\r\n }\r\n\r\n // Add claims challenge to serverRequestParameters if passed\r\n if (request.claimsRequest) {\r\n this.claimsValue = request.claimsRequest;\r\n }\r\n\r\n // if the developer provides one of these, give preference to developer choice\r\n if (ServerRequestParameters.isSSOParam(request)) {\r\n queryParameters = this.constructUnifiedCacheQueryParameter(request, null);\r\n }\r\n }\r\n\r\n if (adalIdTokenObject) {\r\n queryParameters = this.constructUnifiedCacheQueryParameter(null, adalIdTokenObject);\r\n }\r\n\r\n /*\r\n * adds sid/login_hint if not populated\r\n * this.logger.verbose(\"Calling addHint parameters\");\r\n */\r\n queryParameters = this.addHintParameters(account, queryParameters);\r\n\r\n // sanity check for developer passed extraQueryParameters\r\n const eQParams: StringDict|null = request ? request.extraQueryParameters : null;\r\n\r\n // Populate the extraQueryParameters to be sent to the server\r\n this.queryParameters = ServerRequestParameters.generateQueryParametersString(queryParameters);\r\n this.extraQueryParameters = ServerRequestParameters.generateQueryParametersString(eQParams, silentCall);\r\n }\r\n\r\n // #region QueryParam helpers\r\n\r\n /**\r\n * Constructs extraQueryParameters to be sent to the server for the AuthenticationParameters set by the developer\r\n * in any login() or acquireToken() calls\r\n * @param idTokenObject\r\n * @param extraQueryParameters\r\n * @param sid\r\n * @param loginHint\r\n */\r\n // TODO: check how this behaves when domain_hint only is sent in extraparameters and idToken has no upn.\r\n private constructUnifiedCacheQueryParameter(request: AuthenticationParameters, idTokenObject: object): StringDict {\r\n\r\n // preference order: account > sid > login_hint\r\n let ssoType;\r\n let ssoData;\r\n let serverReqParam: StringDict = {};\r\n // if account info is passed, account.login_hint claim > account.sid > account.username\r\n if (request) {\r\n if (request.account) {\r\n const account: Account = request.account;\r\n if (account.idTokenClaims?.login_hint) {\r\n ssoType = SSOTypes.LOGIN_HINT;\r\n ssoData = account.idTokenClaims.login_hint;\r\n } else if (account.sid) {\r\n ssoType = SSOTypes.SID;\r\n ssoData = account.sid;\r\n }\r\n else if (account.userName) {\r\n ssoType = SSOTypes.LOGIN_HINT;\r\n ssoData = account.userName;\r\n }\r\n }\r\n // sid from request\r\n else if (request.sid) {\r\n ssoType = SSOTypes.SID;\r\n ssoData = request.sid;\r\n }\r\n // loginHint from request\r\n else if (request.loginHint) {\r\n ssoType = SSOTypes.LOGIN_HINT;\r\n ssoData = request.loginHint;\r\n }\r\n }\r\n // adalIdToken retrieved from cache\r\n else if (idTokenObject) {\r\n if (idTokenObject.hasOwnProperty(Constants.upn)) {\r\n ssoType = SSOTypes.ID_TOKEN;\r\n ssoData = idTokenObject[\"upn\"];\r\n }\r\n }\r\n\r\n serverReqParam = this.addSSOParameter(ssoType, ssoData);\r\n return serverReqParam;\r\n }\r\n\r\n /**\r\n * @hidden\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 if added skips the email based discovery process of the user - only supported for interactive calls in implicit_flow\r\n * domain_req utid received as part of the clientInfo\r\n * login_req uid received as part of clientInfo\r\n * Also does a sanity check for extraQueryParameters passed by the user to ensure no repeat queryParameters\r\n *\r\n * @param {@link Account} account - Account for which the token is requested\r\n * @param queryparams\r\n * @param {@link ServerRequestParameters}\r\n * @ignore\r\n */\r\n private addHintParameters(account: Account, params: StringDict): StringDict {\r\n /*\r\n * This is a final check for all queryParams added so far; preference order: sid > login_hint\r\n * sid cannot be passed along with login_hint or domain_hint, hence we check both are not populated yet in queryParameters\r\n */\r\n let qParams = params;\r\n if (account) {\r\n if (!qParams[SSOTypes.SID] && !qParams[SSOTypes.LOGIN_HINT]) {\r\n if (account.idTokenClaims?.login_hint) {\r\n // Use login_hint claim if available over sid or email/upn\r\n qParams = this.addSSOParameter(SSOTypes.LOGIN_HINT, account.idTokenClaims?.login_hint, qParams);\r\n } else if (account.sid && this.promptValue === PromptState.NONE) {\r\n // sid - populate only if login_hint is not already populated and the account has sid\r\n qParams = this.addSSOParameter(SSOTypes.SID, account.sid, qParams);\r\n } else if (account.userName) {\r\n // Add username/upn as loginHint if nothing else available\r\n qParams = this.addSSOParameter(SSOTypes.LOGIN_HINT, account.userName, qParams);\r\n }\r\n }\r\n }\r\n\r\n return qParams;\r\n }\r\n\r\n /**\r\n * Add SID to extraQueryParameters\r\n * @param sid\r\n */\r\n private addSSOParameter(ssoType: string, ssoData: string, params?: StringDict): StringDict {\r\n const ssoParam = params || {};\r\n\r\n if (!ssoData) {\r\n return ssoParam;\r\n }\r\n\r\n switch (ssoType) {\r\n case SSOTypes.SID: {\r\n ssoParam[SSOTypes.SID] = ssoData;\r\n break;\r\n }\r\n case SSOTypes.ID_TOKEN: {\r\n ssoParam[SSOTypes.LOGIN_HINT] = ssoData;\r\n break;\r\n }\r\n case SSOTypes.LOGIN_HINT: {\r\n ssoParam[SSOTypes.LOGIN_HINT] = ssoData;\r\n break;\r\n }\r\n }\r\n\r\n return ssoParam;\r\n }\r\n\r\n /**\r\n * Utility to generate a QueryParameterString from a Key-Value mapping of extraQueryParameters passed\r\n * @param extraQueryParameters\r\n */\r\n static generateQueryParametersString(queryParameters?: StringDict, silentCall?: boolean): string|null {\r\n let paramsString: string|null = null;\r\n\r\n if (queryParameters) {\r\n Object.keys(queryParameters).forEach((key: string) => {\r\n // sid cannot be passed along with login_hint or domain_hint\r\n if(key === Constants.domain_hint && (silentCall || queryParameters[SSOTypes.SID])) {\r\n return;\r\n }\r\n\r\n if (!paramsString) {\r\n paramsString = `${key}=${encodeURIComponent(queryParameters[key])}`;\r\n }\r\n else {\r\n paramsString += `&${key}=${encodeURIComponent(queryParameters[key])}`;\r\n }\r\n });\r\n }\r\n\r\n return paramsString;\r\n }\r\n // #endregion\r\n\r\n /**\r\n * Check to see if there are SSO params set in the Request\r\n * @param request\r\n */\r\n static isSSOParam(request: AuthenticationParameters): boolean {\r\n return !!(request && (request.account || request.sid || request.loginHint));\r\n }\r\n\r\n /**\r\n * Returns the correct response_type string attribute for an acquireToken request configuration\r\n * @param accountsMatch boolean: Determines whether the account in the request matches the cached account\r\n * @param scopes Array: AuthenticationRequest scopes configuration\r\n * @param loginScopesOnly boolean: True if the scopes array ONLY contains the clientId or any combination of OIDC scopes, without resource scopes\r\n */\r\n static determineResponseType(accountsMatch: boolean, scopes: Array): string {\r\n // Supports getting an id_token by sending in clientId as only scope or OIDC scopes as only scopes\r\n if (ScopeSet.onlyContainsOidcScopes(scopes)) {\r\n return ResponseTypes.id_token;\r\n }\r\n // If accounts match, check if OIDC scopes are included, otherwise return id_token_token\r\n return (accountsMatch) ? this.responseTypeForMatchingAccounts(scopes) : ResponseTypes.id_token_token;\r\n }\r\n\r\n /**\r\n * Returns the correct response_type string attribute for an acquireToken request configuration that contains an\r\n * account that matches the account in the MSAL cache.\r\n * @param scopes Array: AuthenticationRequest scopes configuration\r\n */\r\n private static responseTypeForMatchingAccounts(scopes: Array): string {\r\n // Opt-into also requesting an ID token by sending in 'openid', 'profile' or both along with resource scopes when login is not necessary.\r\n return (ScopeSet.containsAnyOidcScopes(scopes)) ? ResponseTypes.id_token_token : ResponseTypes.token;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AccessTokenCacheItem } from \"./cache/AccessTokenCacheItem\";\r\nimport { AccessTokenKey } from \"./cache/AccessTokenKey\";\r\nimport { AccessTokenValue } from \"./cache/AccessTokenValue\";\r\nimport { ServerRequestParameters } from \"./ServerRequestParameters\";\r\nimport { Authority, AuthorityType } from \"./authority/Authority\";\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { Logger } from \"./Logger\";\r\nimport { AuthCache } from \"./cache/AuthCache\";\r\nimport { Account } from \"./Account\";\r\nimport { ScopeSet } from \"./ScopeSet\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\nimport { WindowUtils } from \"./utils/WindowUtils\";\r\nimport { TokenUtils } from \"./utils/TokenUtils\";\r\nimport { TimeUtils } from \"./utils/TimeUtils\";\r\nimport { UrlUtils } from \"./utils/UrlUtils\";\r\nimport { RequestUtils } from \"./utils/RequestUtils\";\r\nimport { ResponseUtils } from \"./utils/ResponseUtils\";\r\nimport { AuthorityFactory } from \"./authority/AuthorityFactory\";\r\nimport { Configuration, buildConfiguration, TelemetryOptions } from \"./Configuration\";\r\nimport { AuthenticationParameters } from \"./AuthenticationParameters\";\r\nimport { ClientConfigurationError } from \"./error/ClientConfigurationError\";\r\nimport { AuthError } from \"./error/AuthError\";\r\nimport { ClientAuthError, ClientAuthErrorMessage } from \"./error/ClientAuthError\";\r\nimport { ServerError } from \"./error/ServerError\";\r\nimport { InteractionRequiredAuthError } from \"./error/InteractionRequiredAuthError\";\r\nimport { AuthResponse, buildResponseStateOnly } from \"./AuthResponse\";\r\nimport TelemetryManager from \"./telemetry/TelemetryManager\";\r\nimport { TelemetryPlatform, TelemetryConfig } from \"./telemetry/TelemetryTypes\";\r\nimport ApiEvent, { API_EVENT_IDENTIFIER } from \"./telemetry/ApiEvent\";\r\n\r\nimport { Constants,\r\n ServerHashParamKeys,\r\n InteractionType,\r\n ResponseTypes,\r\n TemporaryCacheKeys,\r\n PersistentCacheKeys,\r\n ErrorCacheKeys,\r\n FramePrefix\r\n} from \"./utils/Constants\";\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { TrustedAuthority } from \"./authority/TrustedAuthority\";\r\nimport { AuthCacheUtils } from \"./utils/AuthCacheUtils\";\r\n\r\n// default authority\r\nconst DEFAULT_AUTHORITY = \"https://login.microsoftonline.com/common\";\r\n\r\n/**\r\n * Interface to handle iFrame generation, Popup Window creation and redirect handling\r\n */\r\ndeclare global {\r\n // eslint-disable-next-line\r\n interface Window {\r\n msal: Object;\r\n CustomEvent: CustomEvent;\r\n Event: Event;\r\n activeRenewals: {};\r\n renewStates: Array;\r\n callbackMappedToRenewStates : {};\r\n promiseMappedToRenewStates: {};\r\n openedWindows: Array;\r\n requestType: string;\r\n }\r\n}\r\n\r\n/**\r\n * @hidden\r\n * @ignore\r\n */\r\nexport interface CacheResult {\r\n errorDesc: string;\r\n token: string;\r\n error: string;\r\n}\r\n\r\n/**\r\n * @hidden\r\n * @ignore\r\n * Data type to hold information about state returned from the server\r\n */\r\nexport type ResponseStateInfo = {\r\n state: string;\r\n timestamp: number,\r\n method: string;\r\n stateMatch: boolean;\r\n requestType: string;\r\n};\r\n\r\n/**\r\n * A type alias for an authResponseCallback function.\r\n * {@link (authResponseCallback:type)}\r\n * @param authErr error created for failure cases\r\n * @param response response containing token strings in success cases, or just state value in error cases\r\n */\r\nexport type authResponseCallback = (authErr: AuthError, response?: AuthResponse) => void;\r\n\r\n/**\r\n * A type alias for a tokenReceivedCallback function.\r\n * {@link (tokenReceivedCallback:type)}\r\n * @returns response of type {@link (AuthResponse:type)}\r\n * The function that will get the call back once this API is completed (either successfully or with a failure).\r\n */\r\nexport type tokenReceivedCallback = (response: AuthResponse) => void;\r\n\r\n/**\r\n * A type alias for a errorReceivedCallback function.\r\n * {@link (errorReceivedCallback:type)}\r\n * @returns response of type {@link (AuthError:class)}\r\n * @returns {string} account state\r\n */\r\nexport type errorReceivedCallback = (authErr: AuthError, accountState: string) => void;\r\n\r\n/**\r\n * UserAgentApplication class\r\n *\r\n * Object Instance that the developer can use to make loginXX OR acquireTokenXX functions\r\n */\r\nexport class UserAgentApplication {\r\n\r\n // input Configuration by the developer/user\r\n private config: Configuration;\r\n\r\n // callbacks for token/error\r\n private authResponseCallback: authResponseCallback = null;\r\n private tokenReceivedCallback: tokenReceivedCallback = null;\r\n private errorReceivedCallback: errorReceivedCallback = null;\r\n\r\n // Added for readability as these params are very frequently used\r\n private logger: Logger;\r\n private clientId: string;\r\n private inCookie: boolean;\r\n private telemetryManager: TelemetryManager;\r\n\r\n // Cache and Account info referred across token grant flow\r\n protected cacheStorage: AuthCache;\r\n private account: Account;\r\n\r\n // state variables\r\n private silentAuthenticationState: string;\r\n private silentLogin: boolean;\r\n private redirectResponse: AuthResponse;\r\n private redirectError: AuthError;\r\n\r\n // Authority Functionality\r\n protected authorityInstance: Authority;\r\n\r\n /**\r\n * setter for the authority URL\r\n * @param {string} authority\r\n */\r\n // If the developer passes an authority, create an instance\r\n public set authority(val: string) {\r\n this.authorityInstance = AuthorityFactory.CreateInstance(val, this.config.auth.validateAuthority);\r\n }\r\n\r\n /**\r\n * Method to manage the authority URL.\r\n *\r\n * @returns {string} authority\r\n */\r\n public get authority(): string {\r\n return this.authorityInstance.CanonicalAuthority;\r\n }\r\n\r\n /**\r\n * Get the current authority instance from the MSAL configuration object\r\n *\r\n * @returns {@link Authority} authority instance\r\n */\r\n public getAuthorityInstance(): Authority {\r\n return this.authorityInstance;\r\n }\r\n\r\n /**\r\n * @constructor\r\n * Constructor for the UserAgentApplication used to instantiate the UserAgentApplication object\r\n *\r\n * Important attributes in the Configuration object for auth are:\r\n * - clientID: the application ID of your application.\r\n * You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\r\n * - authority: the authority URL for your application.\r\n *\r\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\r\n * It is of the form https://login.microsoftonline.com/<Enter_the_Tenant_Info_Here>.\r\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\r\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\r\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\r\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\r\n *\r\n *\r\n * In Azure B2C, authority is of the form https://<instance>/tfp/<tenant>/<policyName>/\r\n *\r\n * @param {@link (Configuration:type)} configuration object for the MSAL UserAgentApplication instance\r\n */\r\n constructor(configuration: Configuration) {\r\n \r\n // Set the Configuration\r\n this.config = buildConfiguration(configuration);\r\n\r\n this.logger = this.config.system.logger;\r\n this.clientId = this.config.auth.clientId;\r\n this.inCookie = this.config.cache.storeAuthStateInCookie;\r\n\r\n this.telemetryManager = this.getTelemetryManagerFromConfig(this.config.system.telemetry, this.clientId);\r\n\r\n TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.validateAuthority, this.config.auth.knownAuthorities);\r\n AuthorityFactory.saveMetadataFromConfig(this.config.auth.authority, this.config.auth.authorityMetadata);\r\n\r\n // if no authority is passed, set the default: \"https://login.microsoftonline.com/common\"\r\n this.authority = this.config.auth.authority || DEFAULT_AUTHORITY;\r\n // cache keys msal - typescript throws an error if any value other than \"localStorage\" or \"sessionStorage\" is passed\r\n this.cacheStorage = new AuthCache(this.clientId, this.config.cache.cacheLocation, this.inCookie);\r\n\r\n // Initialize window handling code\r\n if (!window.activeRenewals) {\r\n window.activeRenewals = {};\r\n }\r\n if (!window.renewStates) {\r\n window.renewStates = [];\r\n }\r\n if (!window.callbackMappedToRenewStates) {\r\n window.callbackMappedToRenewStates = {};\r\n }\r\n if (!window.promiseMappedToRenewStates) {\r\n window.promiseMappedToRenewStates = {};\r\n }\r\n window.msal = this;\r\n\r\n const urlHash = window.location.hash;\r\n const urlContainsHash = UrlUtils.urlContainsHash(urlHash);\r\n\r\n // check if back button is pressed\r\n WindowUtils.checkIfBackButtonIsPressed(this.cacheStorage);\r\n\r\n // On the server 302 - Redirect, handle this\r\n if (urlContainsHash && this.cacheStorage.isInteractionInProgress(true)) {\r\n const stateInfo = this.getResponseState(urlHash);\r\n if (stateInfo.method === Constants.interactionTypeRedirect) {\r\n this.handleRedirectAuthenticationResponse(urlHash);\r\n }\r\n }\r\n }\r\n\r\n // #region Redirect Callbacks\r\n /**\r\n * @hidden\r\n * @ignore\r\n * Set the callback functions for the redirect flow to send back the success or error object.\r\n * @param {@link (tokenReceivedCallback:type)} successCallback - Callback which contains the AuthResponse object, containing data from the server.\r\n * @param {@link (errorReceivedCallback:type)} errorCallback - Callback which contains a AuthError object, containing error data from either the server\r\n * or the library, depending on the origin of the error.\r\n */\r\n handleRedirectCallback(tokenReceivedCallback: tokenReceivedCallback, errorReceivedCallback: errorReceivedCallback): void;\r\n handleRedirectCallback(authCallback: authResponseCallback): void;\r\n handleRedirectCallback(authOrTokenCallback: authResponseCallback | tokenReceivedCallback, errorReceivedCallback?: errorReceivedCallback): void {\r\n if (!authOrTokenCallback) {\r\n throw ClientConfigurationError.createInvalidCallbackObjectError(authOrTokenCallback);\r\n }\r\n\r\n // Set callbacks\r\n if (errorReceivedCallback) {\r\n this.tokenReceivedCallback = authOrTokenCallback as tokenReceivedCallback;\r\n this.errorReceivedCallback = errorReceivedCallback;\r\n this.logger.warning(\"This overload for callback is deprecated - please change the format of the callbacks to a single callback as shown: (err: AuthError, response: AuthResponse).\");\r\n } else {\r\n this.authResponseCallback = authOrTokenCallback as authResponseCallback;\r\n }\r\n\r\n if (this.redirectError) {\r\n this.authErrorHandler(Constants.interactionTypeRedirect, this.redirectError, this.redirectResponse);\r\n } else if (this.redirectResponse) {\r\n this.authResponseHandler(Constants.interactionTypeRedirect, this.redirectResponse);\r\n }\r\n }\r\n\r\n /**\r\n * Public API to verify if the URL contains the hash with known properties\r\n * @param hash\r\n */\r\n public urlContainsHash(hash: string): boolean {\r\n this.logger.verbose(\"UrlContainsHash has been called\");\r\n return UrlUtils.urlContainsHash(hash);\r\n }\r\n\r\n private authResponseHandler(interactionType: InteractionType, response: AuthResponse, resolve?: Function) : void {\r\n this.logger.verbose(\"AuthResponseHandler has been called\");\r\n\r\n this.cacheStorage.setInteractionInProgress(false);\r\n if (interactionType === Constants.interactionTypeRedirect) {\r\n this.logger.verbose(\"Interaction type is redirect\");\r\n if (this.errorReceivedCallback) {\r\n this.logger.verbose(\"Two callbacks were provided to handleRedirectCallback, calling success callback with response\");\r\n this.tokenReceivedCallback(response);\r\n } else if (this.authResponseCallback) {\r\n this.logger.verbose(\"One callback was provided to handleRedirectCallback, calling authResponseCallback with response\");\r\n this.authResponseCallback(null, response);\r\n }\r\n } else if (interactionType === Constants.interactionTypePopup) {\r\n this.logger.verbose(\"Interaction type is popup, resolving\");\r\n resolve(response);\r\n } else {\r\n throw ClientAuthError.createInvalidInteractionTypeError();\r\n }\r\n }\r\n\r\n private authErrorHandler(interactionType: InteractionType, authErr: AuthError, response: AuthResponse, reject?: Function) : void {\r\n this.logger.verbose(\"AuthErrorHandler has been called\");\r\n\r\n // set interaction_status to complete\r\n this.cacheStorage.setInteractionInProgress(false);\r\n if (interactionType === Constants.interactionTypeRedirect) {\r\n this.logger.verbose(\"Interaction type is redirect\");\r\n if (this.errorReceivedCallback) {\r\n this.logger.verbose(\"Two callbacks were provided to handleRedirectCallback, calling error callback\");\r\n this.errorReceivedCallback(authErr, response.accountState);\r\n } else if (this.authResponseCallback) {\r\n this.logger.verbose(\"One callback was provided to handleRedirectCallback, calling authResponseCallback with error\");\r\n this.authResponseCallback(authErr, response);\r\n } else {\r\n this.logger.verbose(\"handleRedirectCallback has not been called and no callbacks are registered, throwing error\");\r\n throw authErr;\r\n }\r\n } else if (interactionType === Constants.interactionTypePopup) {\r\n this.logger.verbose(\"Interaction type is popup, rejecting\");\r\n reject(authErr);\r\n } else {\r\n throw ClientAuthError.createInvalidInteractionTypeError();\r\n }\r\n }\r\n\r\n // #endregion\r\n /**\r\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint.\r\n * @param {@link (AuthenticationParameters:type)}\r\n */\r\n loginRedirect(userRequest?: AuthenticationParameters): void {\r\n this.logger.verbose(\"LoginRedirect has been called\");\r\n\r\n // validate request\r\n const request: AuthenticationParameters = RequestUtils.validateRequest(userRequest, true, this.clientId, Constants.interactionTypeRedirect);\r\n this.acquireTokenInteractive(Constants.interactionTypeRedirect, true, request, null, null);\r\n }\r\n\r\n /**\r\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint.\r\n * @param {@link (AuthenticationParameters:type)}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\r\n */\r\n acquireTokenRedirect(userRequest: AuthenticationParameters): void {\r\n this.logger.verbose(\"AcquireTokenRedirect has been called\");\r\n\r\n // validate request\r\n const request: AuthenticationParameters = RequestUtils.validateRequest(userRequest, false, this.clientId, Constants.interactionTypeRedirect);\r\n this.acquireTokenInteractive(Constants.interactionTypeRedirect, false, request, null, null);\r\n }\r\n\r\n /**\r\n * Use when initiating the login process via opening a popup window in the user's browser\r\n *\r\n * @param {@link (AuthenticationParameters:type)}\r\n *\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\r\n */\r\n loginPopup(userRequest?: AuthenticationParameters): Promise {\r\n this.logger.verbose(\"LoginPopup has been called\");\r\n\r\n // validate request\r\n const request: AuthenticationParameters = RequestUtils.validateRequest(userRequest, true, this.clientId, Constants.interactionTypePopup);\r\n const apiEvent: ApiEvent = this.telemetryManager.createAndStartApiEvent(request.correlationId, API_EVENT_IDENTIFIER.LoginPopup);\r\n\r\n return new Promise((resolve, reject) => {\r\n this.acquireTokenInteractive(Constants.interactionTypePopup, true, request, resolve, reject);\r\n })\r\n .then((resp) => {\r\n this.logger.verbose(\"Successfully logged in\");\r\n this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, true);\r\n return resp;\r\n })\r\n .catch((error: AuthError) => {\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, false, error.errorCode);\r\n throw error;\r\n });\r\n }\r\n\r\n /**\r\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\r\n * @param {@link AuthenticationParameters}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\r\n */\r\n acquireTokenPopup(userRequest: AuthenticationParameters): Promise {\r\n this.logger.verbose(\"AcquireTokenPopup has been called\");\r\n\r\n // validate request\r\n const request: AuthenticationParameters = RequestUtils.validateRequest(userRequest, false, this.clientId, Constants.interactionTypePopup);\r\n const apiEvent: ApiEvent = this.telemetryManager.createAndStartApiEvent(request.correlationId, API_EVENT_IDENTIFIER.AcquireTokenPopup);\r\n\r\n return new Promise((resolve, reject) => {\r\n this.acquireTokenInteractive(Constants.interactionTypePopup, false, request, resolve, reject);\r\n })\r\n .then((resp) => {\r\n this.logger.verbose(\"Successfully acquired token\");\r\n this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, true);\r\n return resp;\r\n })\r\n .catch((error: AuthError) => {\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, false, error.errorCode);\r\n throw error;\r\n });\r\n }\r\n\r\n // #region Acquire Token\r\n\r\n /**\r\n * Use when initiating the login process or when you want to obtain an access_token for your API,\r\n * either by redirecting the user's browser window to the authorization endpoint or via opening a popup window in the user's browser.\r\n * @param {@link (AuthenticationParameters:type)}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\r\n */\r\n private acquireTokenInteractive(interactionType: InteractionType, isLoginCall: boolean, request: AuthenticationParameters, resolve?: Function, reject?: Function): void {\r\n this.logger.verbose(\"AcquireTokenInteractive has been called\");\r\n\r\n // block the request if made from the hidden iframe\r\n WindowUtils.blockReloadInHiddenIframes();\r\n\r\n try {\r\n this.cacheStorage.setInteractionInProgress(true);\r\n } catch (e) {\r\n // If already in progress, do not proceed\r\n const thrownError = isLoginCall ? ClientAuthError.createLoginInProgressError() : ClientAuthError.createAcquireTokenInProgressError();\r\n const stateOnlyResponse = buildResponseStateOnly(this.getAccountState(request.state));\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.authErrorHandler(interactionType,\r\n thrownError,\r\n stateOnlyResponse,\r\n reject);\r\n return;\r\n }\r\n\r\n if(interactionType === Constants.interactionTypeRedirect) {\r\n this.cacheStorage.setItem(TemporaryCacheKeys.REDIRECT_REQUEST, `${Constants.inProgress}${Constants.resourceDelimiter}${request.state}`);\r\n }\r\n\r\n // Get the account object if a session exists\r\n let account: Account;\r\n if (request && request.account && !isLoginCall) {\r\n account = request.account;\r\n this.logger.verbose(\"Account set from request\");\r\n } else {\r\n account = this.getAccount();\r\n this.logger.verbose(\"Account set from MSAL Cache\");\r\n }\r\n\r\n // If no session exists, prompt the user to login.\r\n if (!account && !ServerRequestParameters.isSSOParam(request)) {\r\n if (isLoginCall) {\r\n // extract ADAL id_token if exists\r\n const adalIdToken = this.extractADALIdToken();\r\n\r\n // silent login if ADAL id_token is retrieved successfully - SSO\r\n if (adalIdToken && !request.scopes) {\r\n this.logger.info(\"ADAL's idToken exists. Extracting login information from ADAL's idToken\");\r\n const tokenRequest: AuthenticationParameters = this.buildIDTokenRequest(request);\r\n\r\n this.silentLogin = true;\r\n this.acquireTokenSilent(tokenRequest).then(response => {\r\n this.silentLogin = false;\r\n this.logger.info(\"Unified cache call is successful\");\r\n\r\n this.authResponseHandler(interactionType, response, resolve);\r\n return;\r\n }, (error) => {\r\n this.silentLogin = false;\r\n this.logger.error(\"Error occurred during unified cache ATS: \" + error);\r\n\r\n // proceed to login since ATS failed\r\n this.acquireTokenHelper(null, interactionType, isLoginCall, request, resolve, reject);\r\n });\r\n }\r\n // No ADAL token found, proceed to login\r\n else {\r\n this.logger.verbose(\"Login call but no token found, proceed to login\");\r\n this.acquireTokenHelper(null, interactionType, isLoginCall, request, resolve, reject);\r\n }\r\n }\r\n // AcquireToken call, but no account or context given, so throw error\r\n else {\r\n this.logger.verbose(\"AcquireToken call, no context or account given\");\r\n this.logger.info(\"User login is required\");\r\n const stateOnlyResponse = buildResponseStateOnly(this.getAccountState(request.state));\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.authErrorHandler(interactionType,\r\n ClientAuthError.createUserLoginRequiredError(),\r\n stateOnlyResponse,\r\n reject);\r\n return;\r\n }\r\n }\r\n // User session exists\r\n else {\r\n this.logger.verbose(\"User session exists, login not required\");\r\n this.acquireTokenHelper(account, interactionType, isLoginCall, request, resolve, reject);\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n * Helper function to acquireToken\r\n *\r\n */\r\n private async acquireTokenHelper(account: Account, interactionType: InteractionType, isLoginCall: boolean, request: AuthenticationParameters, resolve?: Function, reject?: Function): Promise {\r\n this.logger.verbose(\"AcquireTokenHelper has been called\");\r\n this.logger.verbose(`Interaction type: ${interactionType}. isLoginCall: ${isLoginCall}`);\r\n\r\n const requestSignature = request.scopes ? request.scopes.join(\" \").toLowerCase() : Constants.oidcScopes.join(\" \");\r\n this.logger.verbosePii(`Request signature: ${requestSignature}`);\r\n\r\n let serverAuthenticationRequest: ServerRequestParameters;\r\n const acquireTokenAuthority = (request && request.authority) ? AuthorityFactory.CreateInstance(request.authority, this.config.auth.validateAuthority, request.authorityMetadata) : this.authorityInstance;\r\n let popUpWindow: Window;\r\n\r\n try {\r\n if (!acquireTokenAuthority.hasCachedMetadata()) {\r\n this.logger.verbose(\"No cached metadata for authority\");\r\n await AuthorityFactory.saveMetadataFromNetwork(acquireTokenAuthority, this.telemetryManager, request.correlationId);\r\n } else {\r\n this.logger.verbose(\"Cached metadata found for authority\");\r\n }\r\n\r\n // On Fulfillment\r\n const responseType: string = isLoginCall ? ResponseTypes.id_token : this.getTokenType(account, request.scopes);\r\n\r\n const loginStartPage = request.redirectStartPage || window.location.href;\r\n\r\n serverAuthenticationRequest = new ServerRequestParameters(\r\n acquireTokenAuthority,\r\n this.clientId,\r\n responseType,\r\n this.getRedirectUri(request && request.redirectUri),\r\n request.scopes,\r\n request.state,\r\n request.correlationId\r\n );\r\n this.logger.verbose(\"Finished building server authentication request\");\r\n\r\n this.updateCacheEntries(serverAuthenticationRequest, account, isLoginCall, loginStartPage);\r\n this.logger.verbose(\"Updating cache entries\");\r\n\r\n // populate QueryParameters (sid/login_hint) and any other extraQueryParameters set by the developer\r\n serverAuthenticationRequest.populateQueryParams(account, request);\r\n this.logger.verbose(\"Query parameters populated from account\");\r\n\r\n // Construct urlNavigate\r\n const urlNavigate = UrlUtils.createNavigateUrl(serverAuthenticationRequest) + Constants.response_mode_fragment;\r\n // set state in cache\r\n if (interactionType === Constants.interactionTypeRedirect) {\r\n if (!isLoginCall) {\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_ACQ_TOKEN, request.state), serverAuthenticationRequest.state, this.inCookie);\r\n this.logger.verbose(\"State cached for redirect\");\r\n this.logger.verbosePii(`State cached: ${serverAuthenticationRequest.state}`);\r\n } else {\r\n this.logger.verbose(\"Interaction type redirect but login call is true. State not cached\");\r\n }\r\n } else if (interactionType === Constants.interactionTypePopup) {\r\n window.renewStates.push(serverAuthenticationRequest.state);\r\n window.requestType = isLoginCall ? Constants.login : Constants.renewToken;\r\n this.logger.verbose(\"State saved to window\");\r\n this.logger.verbosePii(`State saved: ${serverAuthenticationRequest.state}`);\r\n\r\n // Register callback to capture results from server\r\n this.registerCallback(serverAuthenticationRequest.state, requestSignature, resolve, reject);\r\n } else {\r\n this.logger.verbose(\"Invalid interaction error. State not cached\");\r\n throw ClientAuthError.createInvalidInteractionTypeError();\r\n }\r\n\r\n if (interactionType === Constants.interactionTypePopup) {\r\n this.logger.verbose(\"Interaction type is popup. Generating popup window\");\r\n // Generate a popup window\r\n try {\r\n popUpWindow = this.openPopup(urlNavigate, \"msal\", Constants.popUpWidth, Constants.popUpHeight);\r\n \r\n // Push popup window handle onto stack for tracking\r\n WindowUtils.trackPopup(popUpWindow);\r\n } catch (e) {\r\n this.logger.info(ClientAuthErrorMessage.popUpWindowError.code + \":\" + ClientAuthErrorMessage.popUpWindowError.desc);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, ClientAuthErrorMessage.popUpWindowError.code);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, ClientAuthErrorMessage.popUpWindowError.desc);\r\n if (reject) {\r\n reject(ClientAuthError.createPopupWindowError());\r\n return;\r\n }\r\n }\r\n \r\n // popUpWindow will be null for redirects, so we dont need to attempt to monitor the window\r\n if (popUpWindow) {\r\n try {\r\n const hash = await WindowUtils.monitorPopupForHash(popUpWindow, this.config.system.loadFrameTimeout, urlNavigate, this.logger);\r\n\r\n this.handleAuthenticationResponse(hash);\r\n\r\n // Request completed successfully, set to completed\r\n this.cacheStorage.setInteractionInProgress(false);\r\n this.logger.info(\"Closing popup window\");\r\n\r\n // TODO: Check how this can be extracted for any framework specific code?\r\n if (this.config.framework.isAngular) {\r\n this.broadcast(\"msal:popUpHashChanged\", hash);\r\n }\r\n \r\n WindowUtils.closePopups();\r\n } catch (error) {\r\n if (reject) {\r\n reject(error);\r\n }\r\n\r\n if (this.config.framework.isAngular) {\r\n this.broadcast(\"msal:popUpClosed\", error.errorCode + Constants.resourceDelimiter + error.errorMessage);\r\n } else {\r\n // Request failed, set to canceled\r\n this.cacheStorage.setInteractionInProgress(false);\r\n popUpWindow.close();\r\n }\r\n }\r\n }\r\n } else {\r\n // If onRedirectNavigate is implemented, invoke it and provide urlNavigate\r\n if (request.onRedirectNavigate) {\r\n this.logger.verbose(\"Invoking onRedirectNavigate callback\");\r\n\r\n const navigate = request.onRedirectNavigate(urlNavigate);\r\n\r\n // Returning false from onRedirectNavigate will stop navigation\r\n if (navigate !== false) {\r\n this.logger.verbose(\"onRedirectNavigate did not return false, navigating\");\r\n this.navigateWindow(urlNavigate);\r\n } else {\r\n this.logger.verbose(\"onRedirectNavigate returned false, stopping navigation\");\r\n }\r\n } else {\r\n // Otherwise, perform navigation\r\n this.logger.verbose(\"Navigating window to urlNavigate\");\r\n this.navigateWindow(urlNavigate);\r\n }\r\n }\r\n } catch (err) {\r\n this.logger.error(err);\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.authErrorHandler(interactionType, ClientAuthError.createEndpointResolutionError(err.toString), buildResponseStateOnly(request.state), reject);\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * API interfacing idToken request when applications already have a session/hint acquired by authorization client applications\r\n * @param request\r\n */\r\n ssoSilent(request: AuthenticationParameters): Promise {\r\n this.logger.verbose(\"ssoSilent has been called\");\r\n \r\n // throw an error on an empty request\r\n if (!request) {\r\n throw ClientConfigurationError.createEmptyRequestError();\r\n }\r\n\r\n // throw an error on no hints passed\r\n if (!request.sid && !request.loginHint) {\r\n throw ClientConfigurationError.createSsoSilentError();\r\n }\r\n\r\n return this.acquireTokenSilent({\r\n ...request,\r\n scopes: Constants.oidcScopes\r\n });\r\n }\r\n\r\n /**\r\n * Use this function to obtain a token before every call to the API / resource provider\r\n *\r\n * MSAL return's a cached token when available\r\n * Or it send's a request to the STS to obtain a new token using a hidden iframe.\r\n *\r\n * @param {@link AuthenticationParameters}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\r\n *\r\n */\r\n acquireTokenSilent(userRequest: AuthenticationParameters): Promise {\r\n this.logger.verbose(\"AcquireTokenSilent has been called\");\r\n\r\n // validate the request\r\n const request = RequestUtils.validateRequest(userRequest, false, this.clientId, Constants.interactionTypeSilent);\r\n const apiEvent: ApiEvent = this.telemetryManager.createAndStartApiEvent(request.correlationId, API_EVENT_IDENTIFIER.AcquireTokenSilent);\r\n const requestSignature = RequestUtils.createRequestSignature(request);\r\n\r\n return new Promise(async (resolve, reject) => {\r\n\r\n // block the request if made from the hidden iframe\r\n WindowUtils.blockReloadInHiddenIframes();\r\n\r\n const scope = request.scopes.join(\" \").toLowerCase();\r\n this.logger.verbosePii(`Serialized scopes: ${scope}`);\r\n\r\n // if the developer passes an account, give that account the priority\r\n let account: Account;\r\n if (request.account) {\r\n account = request.account;\r\n this.logger.verbose(\"Account set from request\");\r\n } else {\r\n account = this.getAccount();\r\n this.logger.verbose(\"Account set from MSAL Cache\");\r\n }\r\n\r\n // Extract adalIdToken if stashed in the cache to allow for seamless ADAL to MSAL migration\r\n const adalIdToken = this.cacheStorage.getItem(Constants.adalIdToken);\r\n\r\n // In the event of no account being passed in the config, no session id, and no pre-existing adalIdToken, user will need to log in\r\n if (!account && !(request.sid || request.loginHint) && StringUtils.isEmpty(adalIdToken) ) {\r\n this.logger.info(\"User login is required\");\r\n // The promise rejects with a UserLoginRequiredError, which should be caught and user should be prompted to log in interactively\r\n return reject(ClientAuthError.createUserLoginRequiredError());\r\n }\r\n\r\n // set the response type based on the current cache status / scopes set\r\n const responseType = this.getTokenType(account, request.scopes);\r\n this.logger.verbose(`Response type: ${responseType}`);\r\n\r\n // create a serverAuthenticationRequest populating the `queryParameters` to be sent to the Server\r\n const serverAuthenticationRequest = new ServerRequestParameters(\r\n AuthorityFactory.CreateInstance(request.authority, this.config.auth.validateAuthority, request.authorityMetadata),\r\n this.clientId,\r\n responseType,\r\n this.getRedirectUri(request.redirectUri),\r\n request.scopes,\r\n request.state,\r\n request.correlationId,\r\n );\r\n\r\n this.logger.verbose(\"Finished building server authentication request\");\r\n\r\n // populate QueryParameters (sid/login_hint) and any other extraQueryParameters set by the developer\r\n if (ServerRequestParameters.isSSOParam(request) || account) {\r\n serverAuthenticationRequest.populateQueryParams(account, request, null, true);\r\n this.logger.verbose(\"Query parameters populated from existing SSO or account\");\r\n }\r\n // if user didn't pass login_hint/sid and adal's idtoken is present, extract the login_hint from the adalIdToken\r\n else if (!account && !StringUtils.isEmpty(adalIdToken)) {\r\n // if adalIdToken exists, extract the SSO info from the same\r\n const adalIdTokenObject = TokenUtils.extractIdToken(adalIdToken);\r\n this.logger.verbose(\"ADAL's idToken exists. Extracting login information from ADAL's idToken to populate query parameters\");\r\n serverAuthenticationRequest.populateQueryParams(account, null, adalIdTokenObject, true);\r\n }\r\n else {\r\n this.logger.verbose(\"No additional query parameters added\");\r\n }\r\n\r\n const userContainedClaims = request.claimsRequest || serverAuthenticationRequest.claimsValue;\r\n\r\n let authErr: AuthError;\r\n let cacheResultResponse;\r\n\r\n // If request.forceRefresh is set to true, force a request for a new token instead of getting it from the cache\r\n if (!userContainedClaims && !request.forceRefresh) {\r\n try {\r\n cacheResultResponse = this.getCachedToken(serverAuthenticationRequest, account);\r\n } catch (e) {\r\n authErr = e;\r\n }\r\n }\r\n \r\n // resolve/reject based on cacheResult\r\n if (cacheResultResponse) {\r\n this.logger.verbose(\"Token found in cache lookup\");\r\n this.logger.verbosePii(`Scopes found: ${JSON.stringify(cacheResultResponse.scopes)}`);\r\n resolve(cacheResultResponse);\r\n return null;\r\n }\r\n else if (authErr) {\r\n this.logger.infoPii(authErr.errorCode + \":\" + authErr.errorMessage);\r\n reject(authErr);\r\n return null;\r\n }\r\n // else proceed with login\r\n else {\r\n \r\n let logMessage;\r\n if (userContainedClaims) {\r\n logMessage = \"Skipped cache lookup since claims were given\";\r\n } else if (request.forceRefresh) {\r\n logMessage = \"Skipped cache lookup since request.forceRefresh option was set to true\";\r\n } else {\r\n logMessage = \"No valid token found in cache lookup\";\r\n }\r\n this.logger.verbose(logMessage);\r\n \r\n // Cache result can return null if cache is empty. In that case, set authority to default value if no authority is passed to the API.\r\n if (!serverAuthenticationRequest.authorityInstance) {\r\n serverAuthenticationRequest.authorityInstance = request.authority ? \r\n AuthorityFactory.CreateInstance(request.authority, this.config.auth.validateAuthority, request.authorityMetadata)\r\n : this.authorityInstance;\r\n } \r\n this.logger.verbosePii(`Authority instance: ${serverAuthenticationRequest.authority}`);\r\n \r\n try {\r\n if (!serverAuthenticationRequest.authorityInstance.hasCachedMetadata()) {\r\n this.logger.verbose(\"No cached metadata for authority\");\r\n await AuthorityFactory.saveMetadataFromNetwork(serverAuthenticationRequest.authorityInstance, this.telemetryManager, request.correlationId);\r\n this.logger.verbose(\"Authority has been updated with endpoint discovery response\");\r\n } else {\r\n this.logger.verbose(\"Cached metadata found for authority\");\r\n }\r\n\r\n /*\r\n * refresh attempt with iframe\r\n * Already renewing for this scope, callback when we get the token.\r\n */\r\n if (window.activeRenewals[requestSignature]) {\r\n this.logger.verbose(\"Renewing token in progress. Registering callback\");\r\n // Active renewals contains the state for each renewal.\r\n this.registerCallback(window.activeRenewals[requestSignature], requestSignature, resolve, reject);\r\n }\r\n else {\r\n if (request.scopes && ScopeSet.onlyContainsOidcScopes(request.scopes)) {\r\n /*\r\n * App uses idToken to send to api endpoints\r\n * Default scope is tracked as OIDC scopes to store this token\r\n */\r\n this.logger.verbose(\"OpenID Connect scopes only, renewing idToken\");\r\n this.silentLogin = true;\r\n this.renewIdToken(requestSignature, resolve, reject, account, serverAuthenticationRequest);\r\n } else {\r\n // renew access token\r\n this.logger.verbose(\"Renewing access token\");\r\n this.renewToken(requestSignature, resolve, reject, account, serverAuthenticationRequest);\r\n }\r\n }\r\n } catch (err) {\r\n this.logger.error(err);\r\n reject(ClientAuthError.createEndpointResolutionError(err.toString()));\r\n return null;\r\n }\r\n }\r\n })\r\n .then(res => {\r\n this.logger.verbose(\"Successfully acquired token\");\r\n this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, true);\r\n return res;\r\n })\r\n .catch((error: AuthError) => {\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, false, error.errorCode);\r\n throw error;\r\n });\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Popup Window Creation\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Configures popup window for login.\r\n *\r\n * @param urlNavigate\r\n * @param title\r\n * @param popUpWidth\r\n * @param popUpHeight\r\n * @ignore\r\n * @hidden\r\n */\r\n private openPopup(urlNavigate: string, title: string, popUpWidth: number, popUpHeight: number) {\r\n this.logger.verbose(\"OpenPopup has been called\");\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 // open the window\r\n const popupWindow = window.open(urlNavigate, title, \"width=\" + popUpWidth + \", height=\" + popUpHeight + \", top=\" + top + \", left=\" + left + \", scrollbars=yes\");\r\n if (!popupWindow) {\r\n throw ClientAuthError.createPopupWindowError();\r\n }\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n\r\n return popupWindow;\r\n } catch (e) {\r\n this.cacheStorage.setInteractionInProgress(false);\r\n throw ClientAuthError.createPopupWindowError(e.toString());\r\n }\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Iframe Management\r\n\r\n /**\r\n * @hidden\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 */\r\n private async loadIframeTimeout(urlNavigate: string, frameName: string, requestSignature: string): Promise {\r\n // set iframe session to pending\r\n const expectedState = window.activeRenewals[requestSignature];\r\n this.logger.verbosePii(\"Set loading state to pending for: \" + requestSignature + \":\" + expectedState);\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, expectedState), Constants.inProgress);\r\n\r\n // render the iframe synchronously if app chooses no timeout, else wait for the set timer to expire\r\n const iframe: HTMLIFrameElement = this.config.system.navigateFrameWait ?\r\n await WindowUtils.loadFrame(urlNavigate, frameName, this.config.system.navigateFrameWait, this.logger):\r\n WindowUtils.loadFrameSync(urlNavigate, frameName, this.logger);\r\n\r\n try {\r\n const hash = await WindowUtils.monitorIframeForHash(iframe.contentWindow, this.config.system.loadFrameTimeout, urlNavigate, this.logger);\r\n\r\n if (hash) {\r\n this.handleAuthenticationResponse(hash);\r\n }\r\n } catch (error) {\r\n if (this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, expectedState)) === Constants.inProgress) {\r\n // fail the iframe session if it's in pending state\r\n this.logger.verbose(\"Loading frame has timed out after: \" + (this.config.system.loadFrameTimeout / 1000) + \" seconds for scope/authority \" + requestSignature + \":\" + expectedState);\r\n // Error after timeout\r\n if (expectedState && window.callbackMappedToRenewStates[expectedState]) {\r\n window.callbackMappedToRenewStates[expectedState](null, error);\r\n }\r\n\r\n this.cacheStorage.removeItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, expectedState));\r\n }\r\n WindowUtils.removeHiddenIframe(iframe);\r\n throw error;\r\n }\r\n WindowUtils.removeHiddenIframe(iframe);\r\n }\r\n\r\n // #endregion\r\n\r\n // #region General Helpers\r\n\r\n /**\r\n * @hidden\r\n * Used to redirect the browser to the STS authorization endpoint\r\n * @param {string} urlNavigate - URL of the authorization endpoint\r\n */\r\n private navigateWindow(urlNavigate: string, popupWindow?: Window) {\r\n // Navigate if valid URL\r\n if (urlNavigate && !StringUtils.isEmpty(urlNavigate)) {\r\n const navigateWindow: Window = popupWindow ? popupWindow : window;\r\n const logMessage: string = popupWindow ? \"Navigated Popup window to:\" + urlNavigate : \"Navigate to:\" + urlNavigate;\r\n this.logger.infoPii(logMessage);\r\n navigateWindow.location.assign(urlNavigate);\r\n }\r\n else {\r\n this.logger.info(\"Navigate url is empty\");\r\n throw AuthError.createUnexpectedError(\"Navigate url is empty\");\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\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} expectedState - Unique state identifier (guid).\r\n * @param {string} scope - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\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 */\r\n private registerCallback(expectedState: string, requestSignature: string, resolve: Function, reject: Function): void {\r\n // track active renewals\r\n window.activeRenewals[requestSignature] = expectedState;\r\n\r\n // initialize callbacks mapped array\r\n if (!window.promiseMappedToRenewStates[expectedState]) {\r\n window.promiseMappedToRenewStates[expectedState] = [];\r\n }\r\n // indexing on the current state, push the callback params to callbacks mapped\r\n window.promiseMappedToRenewStates[expectedState].push({ resolve: resolve, reject: reject });\r\n\r\n // Store the server response in the current window??\r\n if (!window.callbackMappedToRenewStates[expectedState]) {\r\n window.callbackMappedToRenewStates[expectedState] = (response: AuthResponse, error: AuthError) => {\r\n // reset active renewals\r\n delete window.activeRenewals[requestSignature];\r\n\r\n // for all promiseMappedtoRenewStates for a given 'state' - call the reject/resolve with error/token respectively\r\n for (let i = 0; i < window.promiseMappedToRenewStates[expectedState].length; ++i) {\r\n try {\r\n if (error) {\r\n window.promiseMappedToRenewStates[expectedState][i].reject(error);\r\n } else if (response) {\r\n window.promiseMappedToRenewStates[expectedState][i].resolve(response);\r\n } else {\r\n this.cacheStorage.resetTempCacheItems(expectedState);\r\n throw AuthError.createUnexpectedError(\"Error and response are both null\");\r\n }\r\n } catch (e) {\r\n this.logger.warning(e);\r\n }\r\n }\r\n\r\n // reset\r\n delete window.promiseMappedToRenewStates[expectedState];\r\n delete window.callbackMappedToRenewStates[expectedState];\r\n };\r\n }\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Logout\r\n\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n */\r\n logout(correlationId?: string): void {\r\n this.logger.verbose(\"Logout has been called\");\r\n this.logoutAsync(correlationId);\r\n }\r\n\r\n /**\r\n * Async version of logout(). Use to log out the current user.\r\n * @param correlationId Request correlationId\r\n */\r\n private async logoutAsync(correlationId?: string): Promise {\r\n const requestCorrelationId = correlationId || CryptoUtils.createNewGuid();\r\n const apiEvent = this.telemetryManager.createAndStartApiEvent(requestCorrelationId, API_EVENT_IDENTIFIER.Logout);\r\n\r\n this.clearCache();\r\n this.account = null;\r\n\r\n try {\r\n if (!this.authorityInstance.hasCachedMetadata()) {\r\n this.logger.verbose(\"No cached metadata for authority\");\r\n await AuthorityFactory.saveMetadataFromNetwork(this.authorityInstance, this.telemetryManager, correlationId);\r\n } else {\r\n this.logger.verbose(\"Cached metadata found for authority\");\r\n }\r\n\r\n const correlationIdParam = `client-request-id=${requestCorrelationId}`;\r\n\r\n let postLogoutQueryParam: string;\r\n if (this.getPostLogoutRedirectUri()) {\r\n postLogoutQueryParam = `&post_logout_redirect_uri=${encodeURIComponent(this.getPostLogoutRedirectUri())}`;\r\n this.logger.verbose(\"redirectUri found and set\");\r\n } else {\r\n postLogoutQueryParam = \"\";\r\n this.logger.verbose(\"No redirectUri set for app. postLogoutQueryParam is empty\");\r\n }\r\n\r\n let urlNavigate: string;\r\n if (this.authorityInstance.EndSessionEndpoint) {\r\n urlNavigate = `${this.authorityInstance.EndSessionEndpoint}?${correlationIdParam}${postLogoutQueryParam}`;\r\n this.logger.verbose(\"EndSessionEndpoint found and urlNavigate set\");\r\n this.logger.verbosePii(`urlNavigate set to: ${this.authorityInstance.EndSessionEndpoint}`);\r\n } else {\r\n urlNavigate = `${this.authority}oauth2/v2.0/logout?${correlationIdParam}${postLogoutQueryParam}`;\r\n this.logger.verbose(\"No endpoint, urlNavigate set to default\");\r\n }\r\n\r\n this.telemetryManager.stopAndFlushApiEvent(requestCorrelationId, apiEvent, true);\r\n\r\n this.logger.verbose(\"Navigating window to urlNavigate\");\r\n this.navigateWindow(urlNavigate);\r\n } catch (error) {\r\n this.telemetryManager.stopAndFlushApiEvent(requestCorrelationId, apiEvent, false, error.errorCode);\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Clear all access tokens and ID tokens in the cache.\r\n * @ignore\r\n */\r\n protected clearCache(): void {\r\n this.logger.verbose(\"Clearing cache\");\r\n window.renewStates = [];\r\n const tokenCacheItems = this.cacheStorage.getAllTokens(Constants.clientId, Constants.homeAccountIdentifier);\r\n for (let i = 0; i < tokenCacheItems.length; i++) {\r\n this.cacheStorage.removeItem(JSON.stringify(tokenCacheItems[i].key));\r\n }\r\n this.cacheStorage.resetCacheItems();\r\n this.cacheStorage.clearMsalCookie();\r\n this.logger.verbose(\"Cache cleared\");\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Clear a given access token from the cache.\r\n *\r\n * @param accessToken\r\n */\r\n protected clearCacheForScope(accessToken: string): void {\r\n this.logger.verbose(\"Clearing access token from cache\");\r\n const accessTokenItems = this.cacheStorage.getAllAccessTokens(Constants.clientId, Constants.homeAccountIdentifier);\r\n for (let i = 0; i < accessTokenItems.length; i++) {\r\n const token = accessTokenItems[i];\r\n if (token.value.accessToken === accessToken) {\r\n this.cacheStorage.removeItem(JSON.stringify(token.key));\r\n this.logger.verbosePii(`Access token removed: ${token.key}`);\r\n }\r\n }\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Response\r\n\r\n /**\r\n * @hidden\r\n * @ignore\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 */\r\n isCallback(hash: string): boolean {\r\n this.logger.info(\"isCallback will be deprecated in favor of urlContainsHash in MSAL.js v2.0.\");\r\n this.logger.verbose(\"isCallback has been called\");\r\n return UrlUtils.urlContainsHash(hash);\r\n }\r\n\r\n /**\r\n * @hidden\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 */\r\n private processCallBack(hash: string, respStateInfo: ResponseStateInfo, parentCallback?: Function): void {\r\n this.logger.info(\"ProcessCallBack has been called. Processing callback from redirect response\");\r\n\r\n // get the state info from the hash\r\n let stateInfo = respStateInfo;\r\n if (!stateInfo) {\r\n this.logger.verbose(\"StateInfo is null, getting stateInfo from hash\");\r\n stateInfo = this.getResponseState(hash);\r\n }\r\n\r\n let response : AuthResponse;\r\n let authErr : AuthError;\r\n // Save the token info from the hash\r\n try {\r\n response = this.saveTokenFromHash(hash, stateInfo);\r\n } catch (err) {\r\n authErr = err;\r\n }\r\n\r\n try {\r\n // Clear the cookie in the hash\r\n this.cacheStorage.clearMsalCookie(stateInfo.state);\r\n const accountState: string = this.getAccountState(stateInfo.state);\r\n if (response) {\r\n if ((stateInfo.requestType === Constants.renewToken) || response.accessToken) {\r\n if (window.parent !== window) {\r\n this.logger.verbose(\"Window is in iframe, acquiring token silently\");\r\n } else {\r\n this.logger.verbose(\"Acquiring token interactive in progress\");\r\n }\r\n this.logger.verbose(`Response tokenType set to ${ServerHashParamKeys.ACCESS_TOKEN}`);\r\n response.tokenType = ServerHashParamKeys.ACCESS_TOKEN;\r\n }\r\n else if (stateInfo.requestType === Constants.login) {\r\n this.logger.verbose(`Response tokenType set to ${ServerHashParamKeys.ID_TOKEN}`);\r\n response.tokenType = ServerHashParamKeys.ID_TOKEN;\r\n }\r\n if (!parentCallback) {\r\n this.logger.verbose(\"Setting redirectResponse\");\r\n this.redirectResponse = response;\r\n return;\r\n }\r\n } else if (!parentCallback) {\r\n this.logger.verbose(\"Response is null, setting redirectResponse with state\");\r\n this.redirectResponse = buildResponseStateOnly(accountState);\r\n this.redirectError = authErr;\r\n this.cacheStorage.resetTempCacheItems(stateInfo.state);\r\n return;\r\n }\r\n\r\n this.logger.verbose(\"Calling callback provided to processCallback\");\r\n parentCallback(response, authErr);\r\n } catch (err) {\r\n this.logger.error(\"Error occurred in token received callback function: \" + err);\r\n throw ClientAuthError.createErrorInCallbackFunction(err.toString());\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * This method must be called for processing the response received from the STS if using popups or iframes. It extracts the hash, processes the token or error\r\n * information and saves it in the cache. It then resolves the promises with the result.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n */\r\n private handleAuthenticationResponse(hash: string): void {\r\n this.logger.verbose(\"HandleAuthenticationResponse has been called\");\r\n\r\n // retrieve the hash\r\n const locationHash = hash || window.location.hash;\r\n\r\n // if (window.parent !== window), by using self, window.parent becomes equal to window in getResponseState method specifically\r\n const stateInfo = this.getResponseState(locationHash);\r\n this.logger.verbose(\"Obtained state from response\");\r\n\r\n const tokenResponseCallback = window.callbackMappedToRenewStates[stateInfo.state];\r\n this.processCallBack(locationHash, stateInfo, tokenResponseCallback);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * This method must be called for processing the response received from the STS when using redirect flows. It extracts the hash, processes the token or error\r\n * information and saves it in the cache. The result can then be accessed by user registered callbacks.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n */\r\n private handleRedirectAuthenticationResponse(hash: string): void {\r\n this.logger.info(\"Returned from redirect url\");\r\n this.logger.verbose(\"HandleRedirectAuthenticationResponse has been called\");\r\n\r\n // clear hash from window\r\n WindowUtils.clearUrlFragment(window);\r\n this.logger.verbose(\"Window.location.hash cleared\");\r\n\r\n // if (window.parent !== window), by using self, window.parent becomes equal to window in getResponseState method specifically\r\n const stateInfo = this.getResponseState(hash);\r\n \r\n // if set to navigate to loginRequest page post login\r\n if (this.config.auth.navigateToLoginRequestUrl && window.parent === window) {\r\n this.logger.verbose(\"Window.parent is equal to window, not in popup or iframe. Navigation to login request url after login turned on\");\r\n const loginRequestUrl = this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.LOGIN_REQUEST, stateInfo.state), this.inCookie);\r\n\r\n // Redirect to home page if login request url is null (real null or the string null)\r\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\r\n this.logger.error(\"Unable to get valid login request url from cache, redirecting to home page\");\r\n window.location.assign(\"/\");\r\n return;\r\n } else {\r\n this.logger.verbose(\"Valid login request url obtained from cache\");\r\n const currentUrl = UrlUtils.removeHashFromUrl(window.location.href);\r\n const finalRedirectUrl = UrlUtils.removeHashFromUrl(loginRequestUrl);\r\n if (currentUrl !== finalRedirectUrl) {\r\n this.logger.verbose(\"Current url is not login request url, navigating\");\r\n this.logger.verbosePii(`CurrentUrl: ${currentUrl}, finalRedirectUrl: ${finalRedirectUrl}`);\r\n window.location.assign(`${finalRedirectUrl}${hash}`);\r\n return;\r\n } else {\r\n this.logger.verbose(\"Current url matches login request url\");\r\n const loginRequestUrlComponents = UrlUtils.GetUrlComponents(loginRequestUrl);\r\n if (loginRequestUrlComponents.Hash){\r\n this.logger.verbose(\"Login request url contains hash, resetting non-msal hash\");\r\n window.location.hash = loginRequestUrlComponents.Hash;\r\n }\r\n }\r\n }\r\n } else if (!this.config.auth.navigateToLoginRequestUrl) {\r\n this.logger.verbose(\"Default navigation to start page after login turned off\");\r\n }\r\n\r\n this.processCallBack(hash, stateInfo, null);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Creates a stateInfo 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 */\r\n protected getResponseState(hash: string): ResponseStateInfo {\r\n this.logger.verbose(\"GetResponseState has been called\");\r\n\r\n const parameters = UrlUtils.deserializeHash(hash);\r\n let stateResponse: ResponseStateInfo;\r\n if (!parameters) {\r\n throw AuthError.createUnexpectedError(\"Hash was not parsed correctly.\");\r\n }\r\n if (parameters.hasOwnProperty(ServerHashParamKeys.STATE)) {\r\n this.logger.verbose(\"Hash contains state. Creating stateInfo object\");\r\n const parsedState = RequestUtils.parseLibraryState(parameters[\"state\"]);\r\n\r\n stateResponse = {\r\n requestType: Constants.unknown,\r\n state: parameters[\"state\"],\r\n timestamp: parsedState.ts,\r\n method: parsedState.method,\r\n stateMatch: false\r\n };\r\n } else {\r\n throw AuthError.createUnexpectedError(\"Hash does not contain state.\");\r\n }\r\n /*\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 */\r\n\r\n // loginRedirect\r\n if (stateResponse.state === this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, stateResponse.state), this.inCookie) || stateResponse.state === this.silentAuthenticationState) {\r\n this.logger.verbose(\"State matches cached state, setting requestType to login\");\r\n stateResponse.requestType = Constants.login;\r\n stateResponse.stateMatch = true;\r\n return stateResponse;\r\n }\r\n // acquireTokenRedirect\r\n else if (stateResponse.state === this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_ACQ_TOKEN, stateResponse.state), this.inCookie)) {\r\n this.logger.verbose(\"State matches cached state, setting requestType to renewToken\");\r\n stateResponse.requestType = Constants.renewToken;\r\n stateResponse.stateMatch = true;\r\n return stateResponse;\r\n }\r\n\r\n // external api requests may have many renewtoken requests for different resource\r\n if (!stateResponse.stateMatch) {\r\n this.logger.verbose(\"State does not match cached state, setting requestType to type from window\");\r\n stateResponse.requestType = window.requestType;\r\n const statesInParentContext = window.renewStates;\r\n for (let i = 0; i < statesInParentContext.length; i++) {\r\n if (statesInParentContext[i] === stateResponse.state) {\r\n this.logger.verbose(\"Matching state found for request\");\r\n stateResponse.stateMatch = true;\r\n break;\r\n }\r\n }\r\n if (!stateResponse.stateMatch) {\r\n this.logger.verbose(\"Matching state not found for request\");\r\n }\r\n }\r\n\r\n return stateResponse;\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Token Processing (Extract to TokenProcessing.ts)\r\n\r\n /**\r\n * @hidden\r\n * Used to get token for the specified set of scopes from the cache\r\n * @param {@link ServerRequestParameters} - Request sent to the STS to obtain an id_token/access_token\r\n * @param {Account} account - Account for which the scopes were requested\r\n */\r\n private getCachedToken(serverAuthenticationRequest: ServerRequestParameters, account: Account): AuthResponse {\r\n this.logger.verbose(\"GetCachedToken has been called\");\r\n const scopes = serverAuthenticationRequest.scopes;\r\n\r\n /**\r\n * Id Token should be returned in every acquireTokenSilent call. The only exception is a response_type = token\r\n * request when a valid ID Token is not present in the cache.\r\n */\r\n const idToken = this.getCachedIdToken(serverAuthenticationRequest, account);\r\n const authResponse = this.getCachedAccessToken(serverAuthenticationRequest, account, scopes);\r\n const accountState = this.getAccountState(serverAuthenticationRequest.state);\r\n return ResponseUtils.buildAuthResponse(idToken, authResponse, serverAuthenticationRequest, account, scopes, accountState);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * \r\n * Uses passed in authority to further filter an array of tokenCacheItems until only the token being searched for remains, then returns that tokenCacheItem.\r\n * This method will throw if authority filtering still yields multiple matching tokens and will return null if not tokens match the authority passed in.\r\n * \r\n * @param authority \r\n * @param tokenCacheItems \r\n * @param request \r\n * @param requestScopes \r\n * @param tokenType \r\n */\r\n private getTokenCacheItemByAuthority(authority: string, tokenCacheItems: Array, requestScopes: Array, tokenType: string): AccessTokenCacheItem {\r\n let filteredAuthorityItems: Array;\r\n \r\n if (UrlUtils.isCommonAuthority(authority) || UrlUtils.isOrganizationsAuthority(authority) || UrlUtils.isConsumersAuthority(authority)) {\r\n filteredAuthorityItems = AuthCacheUtils.filterTokenCacheItemsByDomain(tokenCacheItems, UrlUtils.GetUrlComponents(authority).HostNameAndPort);\r\n } else {\r\n filteredAuthorityItems = AuthCacheUtils.filterTokenCacheItemsByAuthority(tokenCacheItems, authority);\r\n }\r\n if (filteredAuthorityItems.length === 1) {\r\n return filteredAuthorityItems[0];\r\n }\r\n else if (filteredAuthorityItems.length > 1) {\r\n this.logger.warning(\"Multiple matching tokens found. Cleaning cache and requesting a new token.\");\r\n filteredAuthorityItems.forEach((accessTokenCacheItem) => {\r\n this.cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n });\r\n return null;\r\n }\r\n else {\r\n this.logger.verbose(`No matching tokens of type ${tokenType} found`);\r\n return null;\r\n } \r\n }\r\n\r\n /**\r\n * \r\n * @hidden\r\n * \r\n * Searches the token cache for an ID Token that matches the request parameter and returns it as an IdToken object.\r\n * \r\n * @param serverAuthenticationRequest \r\n * @param account \r\n */\r\n private getCachedIdToken(serverAuthenticationRequest: ServerRequestParameters, account: Account): IdToken {\r\n this.logger.verbose(\"Getting all cached tokens of type ID Token\");\r\n const idTokenCacheItems = this.cacheStorage.getAllIdTokens(this.clientId, account ? account.homeAccountIdentifier : null);\r\n const matchAuthority = serverAuthenticationRequest.authority || this.authority;\r\n const idTokenCacheItem = this.getTokenCacheItemByAuthority(matchAuthority, idTokenCacheItems, null, ServerHashParamKeys.ID_TOKEN);\r\n \r\n if (idTokenCacheItem) {\r\n this.logger.verbose(\"Evaluating ID token found\");\r\n const idTokenIsStillValid = this.evaluateTokenExpiration(idTokenCacheItem);\r\n\r\n if (idTokenIsStillValid) {\r\n this.logger.verbose(\"ID token expiration is within offset, using ID token found in cache\");\r\n const idTokenValue = idTokenCacheItem.value;\r\n if (idTokenValue) {\r\n this.logger.verbose(\"ID Token found in cache is valid and unexpired\");\r\n } else {\r\n this.logger.verbose(\"ID Token found in cache is invalid\");\r\n }\r\n \r\n return (idTokenValue) ? new IdToken(idTokenValue.idToken) : null;\r\n } else {\r\n this.logger.verbose(\"Cached ID token is expired, removing from cache\");\r\n this.cacheStorage.removeItem(JSON.stringify(idTokenCacheItem.key));\r\n return null;\r\n }\r\n } else {\r\n this.logger.verbose(\"No tokens found\");\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * @hidden\r\n * \r\n * Searches the token cache for an access token that matches the request parameters and returns it as an AuthResponse.\r\n * \r\n * @param serverAuthenticationRequest \r\n * @param account \r\n * @param scopes \r\n */\r\n private getCachedAccessToken(serverAuthenticationRequest: ServerRequestParameters, account: Account, scopes: string[]): AuthResponse {\r\n this.logger.verbose(\"Getting all cached tokens of type Access Token\");\r\n const tokenCacheItems = this.cacheStorage.getAllAccessTokens(this.clientId, account ? account.homeAccountIdentifier : null);\r\n \r\n const scopeFilteredTokenCacheItems = AuthCacheUtils.filterTokenCacheItemsByScope(tokenCacheItems, scopes);\r\n const matchAuthority = serverAuthenticationRequest.authority || this.authority;\r\n // serverAuthenticationRequest.authority can only be common or organizations if not null\r\n const accessTokenCacheItem = this.getTokenCacheItemByAuthority(matchAuthority, scopeFilteredTokenCacheItems, scopes, ServerHashParamKeys.ACCESS_TOKEN);\r\n \r\n if (!accessTokenCacheItem) {\r\n this.logger.verbose(\"No matching token found when filtering by scope and authority\");\r\n return null;\r\n } else {\r\n serverAuthenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(accessTokenCacheItem.key.authority, this.config.auth.validateAuthority);\r\n this.logger.verbose(\"Evaluating access token found\");\r\n const tokenIsStillValid = this.evaluateTokenExpiration(accessTokenCacheItem);\r\n // The response value will stay null if token retrieved from the cache is expired, otherwise it will be populated with said token's data\r\n \r\n if (tokenIsStillValid) {\r\n this.logger.verbose(\"Access token expiration is within offset, using access token found in cache\");\r\n const responseAccount: Account = account || this.getAccount();\r\n if (!responseAccount) {\r\n throw AuthError.createUnexpectedError(\"Account should not be null here.\");\r\n }\r\n\r\n const aState = this.getAccountState(serverAuthenticationRequest.state);\r\n const response: AuthResponse = {\r\n uniqueId: \"\",\r\n tenantId: \"\",\r\n tokenType: ServerHashParamKeys.ACCESS_TOKEN,\r\n idToken: null,\r\n idTokenClaims: null,\r\n accessToken: accessTokenCacheItem.value.accessToken,\r\n scopes: accessTokenCacheItem.key.scopes.split(\" \"),\r\n expiresOn: new Date(Number(accessTokenCacheItem.value.expiresIn) * 1000),\r\n account: responseAccount,\r\n accountState: aState,\r\n fromCache: true\r\n }; \r\n \r\n return response;\r\n } else {\r\n this.logger.verbose(\"Access token expired, removing from cache\");\r\n this.cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if the token passed in is within the acceptable expiration time offset, false if it is expired.\r\n * @param tokenCacheItem \r\n * @param serverAuthenticationRequest \r\n */\r\n private evaluateTokenExpiration(tokenCacheItem: AccessTokenCacheItem): Boolean {\r\n const expiration = Number(tokenCacheItem.value.expiresIn);\r\n return TokenUtils.validateExpirationIsWithinOffset(expiration, this.config.system.tokenRenewalOffsetSeconds);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Check if ADAL id_token exists and return if exists.\r\n *\r\n */\r\n private extractADALIdToken(): object {\r\n this.logger.verbose(\"ExtractADALIdToken has been called\");\r\n const adalIdToken = this.cacheStorage.getItem(Constants.adalIdToken);\r\n return (!StringUtils.isEmpty(adalIdToken)) ? TokenUtils.extractIdToken(adalIdToken) : null;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Acquires access token using a hidden iframe.\r\n * @ignore\r\n */\r\n private renewToken(requestSignature: string, resolve: Function, reject: Function, account: Account, serverAuthenticationRequest: ServerRequestParameters): void {\r\n this.logger.verbose(\"RenewToken has been called\");\r\n this.logger.verbosePii(`RenewToken scope and authority: ${requestSignature}`);\r\n\r\n const frameName = WindowUtils.generateFrameName(FramePrefix.TOKEN_FRAME, requestSignature);\r\n WindowUtils.addHiddenIFrame(frameName, this.logger);\r\n\r\n this.updateCacheEntries(serverAuthenticationRequest, account, false);\r\n this.logger.verbosePii(`RenewToken expected state: ${serverAuthenticationRequest.state}`);\r\n\r\n // Build urlNavigate with \"prompt=none\" and navigate to URL in hidden iFrame\r\n const urlNavigate = UrlUtils.urlRemoveQueryStringParameter(UrlUtils.createNavigateUrl(serverAuthenticationRequest), Constants.prompt) + Constants.prompt_none + Constants.response_mode_fragment;\r\n\r\n window.renewStates.push(serverAuthenticationRequest.state);\r\n window.requestType = Constants.renewToken;\r\n this.logger.verbose(\"Set window.renewState and requestType\");\r\n this.registerCallback(serverAuthenticationRequest.state, requestSignature, resolve, reject);\r\n this.logger.infoPii(`Navigate to: ${urlNavigate}`);\r\n this.loadIframeTimeout(urlNavigate, frameName, requestSignature).catch(error => reject(error));\r\n }\r\n\r\n /**\r\n * @hidden\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 */\r\n private renewIdToken(requestSignature: string, resolve: Function, reject: Function, account: Account, serverAuthenticationRequest: ServerRequestParameters): void {\r\n this.logger.info(\"RenewIdToken has been called\");\r\n\r\n const frameName = WindowUtils.generateFrameName(FramePrefix.ID_TOKEN_FRAME, requestSignature);\r\n WindowUtils.addHiddenIFrame(frameName, this.logger);\r\n\r\n this.updateCacheEntries(serverAuthenticationRequest, account, false);\r\n\r\n this.logger.verbose(`RenewIdToken expected state: ${serverAuthenticationRequest.state}`);\r\n\r\n // Build urlNavigate with \"prompt=none\" and navigate to URL in hidden iFrame\r\n const urlNavigate = UrlUtils.urlRemoveQueryStringParameter(UrlUtils.createNavigateUrl(serverAuthenticationRequest), Constants.prompt) + Constants.prompt_none + Constants.response_mode_fragment;\r\n\r\n if (this.silentLogin) {\r\n this.logger.verbose(\"Silent login is true, set silentAuthenticationState\");\r\n window.requestType = Constants.login;\r\n this.silentAuthenticationState = serverAuthenticationRequest.state;\r\n } else {\r\n this.logger.verbose(\"Not silent login, set window.renewState and requestType\");\r\n window.requestType = Constants.renewToken;\r\n window.renewStates.push(serverAuthenticationRequest.state);\r\n }\r\n\r\n // note: scope here is clientId\r\n this.registerCallback(serverAuthenticationRequest.state, requestSignature, resolve, reject);\r\n this.logger.infoPii(`Navigate to:\" ${urlNavigate}`);\r\n this.loadIframeTimeout(urlNavigate, frameName, requestSignature).catch(error => reject(error));\r\n }\r\n\r\n /**\r\n * @hidden\r\n * \r\n * This method builds an Access Token Cache item and saves it to the cache, returning the original\r\n * AuthResponse augmented with a parsed expiresOn attribute.\r\n * \r\n * @param response The AuthResponse object that contains the token to be saved\r\n * @param authority The authority under which the ID token will be cached\r\n * @param scopes The scopes to be added to the cache item key (undefined for ID token cache items)\r\n * @param clientInfo Client Info object that is used to generate the homeAccountIdentifier\r\n * @param expiration Token expiration timestamp\r\n */\r\n private saveToken(response: AuthResponse, authority: string, scopes: string, clientInfo: ClientInfo, expiration: number): AuthResponse {\r\n const accessTokenKey = new AccessTokenKey(authority, this.clientId, scopes, clientInfo.uid, clientInfo.utid);\r\n const accessTokenValue = new AccessTokenValue(response.accessToken, response.idToken.rawIdToken, expiration.toString(), clientInfo.encodeClientInfo());\r\n this.cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n\r\n if (expiration) {\r\n this.logger.verbose(\"New expiration set for token\");\r\n response.expiresOn = new Date(expiration * 1000);\r\n } else {\r\n this.logger.error(\"Could not parse expiresIn parameter for access token\");\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * \r\n * This method sets up the elements of an ID Token cache item and calls saveToken to save it in\r\n * Access Token Cache item format for the client application to use.\r\n * \r\n * @param response The AuthResponse object that will be used to build the cache item\r\n * @param authority The authority under which the ID token will be cached\r\n * @param parameters The response's Hash Params, which contain the ID token returned from the server\r\n * @param clientInfo Client Info object that is used to generate the homeAccountIdentifier\r\n * @param idTokenObj ID Token object from which the ID token's expiration is extracted\r\n */\r\n /* tslint:disable:no-string-literal */\r\n private saveIdToken(response: AuthResponse, authority: string, parameters: object, clientInfo: ClientInfo, idTokenObj: IdToken): AuthResponse {\r\n this.logger.verbose(\"SaveIdToken has been called\");\r\n const idTokenResponse = { ...response };\r\n\r\n // Scopes are undefined so they don't show up in ID token cache key\r\n let scopes: string;\r\n\r\n idTokenResponse.scopes = Constants.oidcScopes;\r\n idTokenResponse.accessToken = parameters[ServerHashParamKeys.ID_TOKEN];\r\n\r\n const expiration = Number(idTokenObj.expiration);\r\n\r\n // Set ID Token item in cache\r\n this.logger.verbose(\"Saving ID token to cache\");\r\n return this.saveToken(idTokenResponse, authority, scopes, clientInfo, expiration);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * \r\n * This method sets up the elements of an Access Token cache item and calls saveToken to save it to the cache\r\n * \r\n * @param response The AuthResponse object that will be used to build the cache item\r\n * @param authority The authority under which the access token will be cached\r\n * @param parameters The response's Hash Params, which contain the access token returned from the server\r\n * @param clientInfo Client Info object that is used to generate the homeAccountIdentifier\r\n */\r\n /* tslint:disable:no-string-literal */\r\n private saveAccessToken(response: AuthResponse, authority: string, parameters: object, clientInfo: ClientInfo): AuthResponse {\r\n this.logger.verbose(\"SaveAccessToken has been called\");\r\n const accessTokenResponse = { ...response };\r\n\r\n // read the scopes\r\n const scope = parameters[ServerHashParamKeys.SCOPE];\r\n const consentedScopes = scope.split(\" \");\r\n\r\n // retrieve all access tokens from the cache, remove the dup scopes\r\n const accessTokenCacheItems = this.cacheStorage.getAllAccessTokens(this.clientId, authority);\r\n this.logger.verbose(\"Retrieving all access tokens from cache and removing duplicates\");\r\n\r\n for (let i = 0; i < accessTokenCacheItems.length; i++) {\r\n const accessTokenCacheItem = accessTokenCacheItems[i];\r\n\r\n if (accessTokenCacheItem.key.homeAccountIdentifier === response.account.homeAccountIdentifier) {\r\n const cachedScopes = accessTokenCacheItem.key.scopes.split(\" \");\r\n if (ScopeSet.isIntersectingScopes(cachedScopes, consentedScopes)) {\r\n this.cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n }\r\n }\r\n }\r\n\r\n accessTokenResponse.accessToken = parameters[ServerHashParamKeys.ACCESS_TOKEN];\r\n accessTokenResponse.scopes = consentedScopes;\r\n\r\n const expiresIn = TimeUtils.parseExpiresIn(parameters[ServerHashParamKeys.EXPIRES_IN]);\r\n const parsedState = RequestUtils.parseLibraryState(parameters[ServerHashParamKeys.STATE]);\r\n const expiration = parsedState.ts + expiresIn;\r\n\r\n this.logger.verbose(\"Saving access token to cache\");\r\n return this.saveToken(accessTokenResponse, authority, scope, clientInfo, expiration);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Saves token or error received in the response from AAD in the cache. In case of id_token, it also creates the account object.\r\n * @ignore\r\n */\r\n protected saveTokenFromHash(hash: string, stateInfo: ResponseStateInfo): AuthResponse {\r\n this.logger.verbose(\"SaveTokenFromHash has been called\");\r\n this.logger.info(`State status: ${stateInfo.stateMatch}; Request type: ${stateInfo.requestType}`);\r\n\r\n let response : AuthResponse = {\r\n uniqueId: \"\",\r\n tenantId: \"\",\r\n tokenType: \"\",\r\n idToken: null,\r\n idTokenClaims: null,\r\n accessToken: null,\r\n scopes: [],\r\n expiresOn: null,\r\n account: null,\r\n accountState: \"\",\r\n fromCache: false\r\n };\r\n\r\n let error: AuthError;\r\n const hashParams = UrlUtils.deserializeHash(hash);\r\n let authorityKey: string = \"\";\r\n let acquireTokenAccountKey: string = \"\";\r\n let idTokenObj: IdToken = null;\r\n\r\n // If server returns an error\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ERROR_DESCRIPTION) || hashParams.hasOwnProperty(ServerHashParamKeys.ERROR)) {\r\n this.logger.verbose(\"Server returned an error\");\r\n this.logger.infoPii(`Error : ${hashParams[ServerHashParamKeys.ERROR]}; Error description: ${hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]}`);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, hashParams[ServerHashParamKeys.ERROR]);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]);\r\n\r\n // login\r\n if (stateInfo.requestType === Constants.login) {\r\n this.logger.verbose(\"RequestType is login, caching login error, generating authorityKey\");\r\n this.cacheStorage.setItem(ErrorCacheKeys.LOGIN_ERROR, hashParams[ServerHashParamKeys.ERROR_DESCRIPTION] + \":\" + hashParams[ServerHashParamKeys.ERROR]);\r\n authorityKey = AuthCache.generateAuthorityKey(stateInfo.state);\r\n }\r\n\r\n // acquireToken\r\n if (stateInfo.requestType === Constants.renewToken) {\r\n this.logger.verbose(\"RequestType is renewToken, generating acquireTokenAccountKey\");\r\n authorityKey = AuthCache.generateAuthorityKey(stateInfo.state);\r\n\r\n const account: Account = this.getAccount();\r\n let accountId;\r\n\r\n if (account && !StringUtils.isEmpty(account.homeAccountIdentifier)) {\r\n accountId = account.homeAccountIdentifier;\r\n this.logger.verbose(\"AccountId is set\");\r\n }\r\n else {\r\n accountId = Constants.no_account;\r\n this.logger.verbose(\"AccountId is set as no_account\");\r\n }\r\n\r\n acquireTokenAccountKey = AuthCache.generateAcquireTokenAccountKey(accountId, stateInfo.state);\r\n }\r\n\r\n const hashErr = hashParams[ServerHashParamKeys.ERROR];\r\n const hashErrDesc = hashParams[ServerHashParamKeys.ERROR_DESCRIPTION];\r\n if (InteractionRequiredAuthError.isInteractionRequiredError(hashErr) ||\r\n InteractionRequiredAuthError.isInteractionRequiredError(hashErrDesc)) {\r\n error = new InteractionRequiredAuthError(hashParams[ServerHashParamKeys.ERROR], hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]);\r\n } else {\r\n error = new ServerError(hashParams[ServerHashParamKeys.ERROR], hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]);\r\n }\r\n }\r\n // If the server returns \"Success\"\r\n else {\r\n this.logger.verbose(\"Server returns success\");\r\n // Verify the state from redirect and record tokens to storage if exists\r\n if (stateInfo.stateMatch) {\r\n this.logger.info(\"State is right\");\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.SESSION_STATE)) {\r\n this.logger.verbose(\"Fragment has session state, caching\");\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.SESSION_STATE, stateInfo.state), hashParams[ServerHashParamKeys.SESSION_STATE]);\r\n }\r\n response.accountState = this.getAccountState(stateInfo.state);\r\n\r\n let clientInfo: ClientInfo;\r\n\r\n // Process access_token\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ACCESS_TOKEN)) {\r\n this.logger.info(\"Fragment has access token\");\r\n response.accessToken = hashParams[ServerHashParamKeys.ACCESS_TOKEN];\r\n\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.SCOPE)) {\r\n response.scopes = hashParams[ServerHashParamKeys.SCOPE].split(\" \");\r\n }\r\n\r\n // retrieve the id_token from response if present\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ID_TOKEN)) {\r\n this.logger.verbose(\"Fragment has id_token\");\r\n idTokenObj = new IdToken(hashParams[ServerHashParamKeys.ID_TOKEN]);\r\n } else {\r\n this.logger.verbose(\"No idToken on fragment, getting idToken from cache\");\r\n idTokenObj = new IdToken(this.cacheStorage.getItem(PersistentCacheKeys.IDTOKEN));\r\n }\r\n\r\n response = ResponseUtils.setResponseIdToken(response, idTokenObj);\r\n\r\n // set authority\r\n const authority: string = this.populateAuthority(stateInfo.state, this.inCookie, this.cacheStorage, idTokenObj);\r\n this.logger.verbose(\"Got authority from cache\");\r\n\r\n // retrieve client_info - if it is not found, generate the uid and utid from idToken\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.CLIENT_INFO)) {\r\n this.logger.verbose(\"Fragment has clientInfo\");\r\n clientInfo = new ClientInfo(hashParams[ServerHashParamKeys.CLIENT_INFO], authority);\r\n } else if (this.authorityInstance.AuthorityType === AuthorityType.Adfs) {\r\n clientInfo = ClientInfo.createClientInfoFromIdToken(idTokenObj, authority);\r\n } else {\r\n this.logger.warning(\"ClientInfo not received in the response from AAD\");\r\n }\r\n\r\n response.account = Account.createAccount(idTokenObj, clientInfo);\r\n this.logger.verbose(\"Account object created from response\");\r\n\r\n let accountKey: string;\r\n if (response.account && !StringUtils.isEmpty(response.account.homeAccountIdentifier)) {\r\n this.logger.verbose(\"AccountKey set\");\r\n accountKey = response.account.homeAccountIdentifier;\r\n }\r\n else {\r\n this.logger.verbose(\"AccountKey set as no_account\");\r\n accountKey = Constants.no_account;\r\n }\r\n\r\n acquireTokenAccountKey = AuthCache.generateAcquireTokenAccountKey(accountKey, stateInfo.state);\r\n const acquireTokenAccountKey_noaccount = AuthCache.generateAcquireTokenAccountKey(Constants.no_account, stateInfo.state);\r\n this.logger.verbose(\"AcquireTokenAccountKey generated\");\r\n\r\n const cachedAccount: string = this.cacheStorage.getItem(acquireTokenAccountKey);\r\n let acquireTokenAccount: Account;\r\n\r\n // Check with the account in the Cache\r\n if (!StringUtils.isEmpty(cachedAccount)) {\r\n acquireTokenAccount = JSON.parse(cachedAccount);\r\n this.logger.verbose(\"AcquireToken request account retrieved from cache\");\r\n if (response.account && acquireTokenAccount && Account.compareAccounts(response.account, acquireTokenAccount)) {\r\n response = this.saveAccessToken(response, authority, hashParams, clientInfo);\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(\r\n \"The account object created from the response is not the same as the one passed in the acquireToken request\");\r\n }\r\n }\r\n else if (!StringUtils.isEmpty(this.cacheStorage.getItem(acquireTokenAccountKey_noaccount))) {\r\n this.logger.verbose(\"No acquireToken account retrieved from cache\");\r\n response = this.saveAccessToken(response, authority, hashParams, clientInfo);\r\n }\r\n }\r\n\r\n // Process id_token\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ID_TOKEN)) {\r\n this.logger.info(\"Fragment has idToken\");\r\n\r\n // set the idToken\r\n idTokenObj = new IdToken(hashParams[ServerHashParamKeys.ID_TOKEN]);\r\n\r\n // set authority\r\n const authority: string = this.populateAuthority(stateInfo.state, this.inCookie, this.cacheStorage, idTokenObj);\r\n\r\n response = ResponseUtils.setResponseIdToken(response, idTokenObj);\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.CLIENT_INFO)) {\r\n this.logger.verbose(\"Fragment has clientInfo\");\r\n clientInfo = new ClientInfo(hashParams[ServerHashParamKeys.CLIENT_INFO], authority);\r\n } else if (this.authorityInstance.AuthorityType === AuthorityType.Adfs) {\r\n clientInfo = ClientInfo.createClientInfoFromIdToken(idTokenObj, authority);\r\n } else {\r\n this.logger.warning(\"ClientInfo not received in the response from AAD\");\r\n }\r\n\r\n this.account = Account.createAccount(idTokenObj, clientInfo);\r\n response.account = this.account;\r\n this.logger.verbose(\"Account object created from response\");\r\n\r\n if (idTokenObj && idTokenObj.nonce) {\r\n this.logger.verbose(\"IdToken has nonce\");\r\n // check nonce integrity if idToken has nonce - throw an error if not matched\r\n const cachedNonce = this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN, stateInfo.state), this.inCookie);\r\n if (idTokenObj.nonce !== cachedNonce) {\r\n this.account = null;\r\n this.cacheStorage.setItem(ErrorCacheKeys.LOGIN_ERROR, \"Nonce Mismatch. Expected Nonce: \" + cachedNonce + \",\" + \"Actual Nonce: \" + idTokenObj.nonce);\r\n this.logger.error(`Nonce Mismatch. Expected Nonce: ${cachedNonce}, Actual Nonce: ${idTokenObj.nonce}`);\r\n error = ClientAuthError.createNonceMismatchError(cachedNonce, idTokenObj.nonce);\r\n }\r\n // Save the token\r\n else {\r\n this.logger.verbose(\"Nonce matches, saving idToken to cache\");\r\n this.cacheStorage.setItem(PersistentCacheKeys.IDTOKEN, hashParams[ServerHashParamKeys.ID_TOKEN], this.inCookie);\r\n this.cacheStorage.setItem(PersistentCacheKeys.CLIENT_INFO, clientInfo.encodeClientInfo(), this.inCookie);\r\n\r\n // Save idToken as access token item for app itself\r\n this.saveIdToken(response, authority, hashParams, clientInfo, idTokenObj);\r\n }\r\n } else {\r\n this.logger.verbose(\"No idToken or no nonce. Cache key for Authority set as state\");\r\n authorityKey = stateInfo.state;\r\n acquireTokenAccountKey = stateInfo.state;\r\n\r\n this.logger.error(\"Invalid id_token received in the response\");\r\n error = ClientAuthError.createInvalidIdTokenError(idTokenObj);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, error.errorCode);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, error.errorMessage);\r\n }\r\n }\r\n }\r\n // State mismatch - unexpected/invalid state\r\n else {\r\n this.logger.verbose(\"State mismatch\");\r\n authorityKey = stateInfo.state;\r\n acquireTokenAccountKey = stateInfo.state;\r\n\r\n const expectedState = this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, stateInfo.state), this.inCookie);\r\n this.logger.error(`State Mismatch. Expected State: ${expectedState}, Actual State: ${stateInfo.state}`);\r\n error = ClientAuthError.createInvalidStateError(stateInfo.state, expectedState);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, error.errorCode);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, error.errorMessage);\r\n }\r\n }\r\n\r\n // Set status to completed\r\n this.cacheStorage.removeItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, stateInfo.state));\r\n this.cacheStorage.resetTempCacheItems(stateInfo.state);\r\n this.logger.verbose(\"Status set to complete, temporary cache cleared\");\r\n\r\n // this is required if navigateToLoginRequestUrl=false\r\n if (this.inCookie) {\r\n this.logger.verbose(\"InCookie is true, setting authorityKey in cookie\");\r\n this.cacheStorage.setItemCookie(authorityKey, \"\", -1);\r\n this.cacheStorage.clearMsalCookie(stateInfo.state);\r\n }\r\n if (error) {\r\n // Error case, set status to cancelled\r\n throw error;\r\n }\r\n\r\n if (!response) {\r\n throw AuthError.createUnexpectedError(\"Response is null\");\r\n }\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Set Authority when saving Token from the hash\r\n * @param state\r\n * @param inCookie\r\n * @param cacheStorage\r\n * @param idTokenObj\r\n * @param response\r\n */\r\n private populateAuthority(state: string, inCookie: boolean, cacheStorage: AuthCache, idTokenObj: IdToken): string {\r\n this.logger.verbose(\"PopulateAuthority has been called\");\r\n const authorityKey: string = AuthCache.generateAuthorityKey(state);\r\n const cachedAuthority: string = cacheStorage.getItem(authorityKey, inCookie);\r\n\r\n // retrieve the authority from cache and replace with tenantID\r\n return StringUtils.isEmpty(cachedAuthority) ? cachedAuthority : UrlUtils.replaceTenantPath(cachedAuthority, idTokenObj.tenantId);\r\n }\r\n\r\n /* tslint:enable:no-string-literal */\r\n\r\n // #endregion\r\n\r\n // #region Account\r\n\r\n /**\r\n * Returns the signed in account\r\n * (the account object is created at the time of successful login)\r\n * or null when no state is found\r\n * @returns {@link Account} - the account object stored in MSAL\r\n */\r\n getAccount(): Account {\r\n // if a session already exists, get the account from the session\r\n if (this.account) {\r\n return this.account;\r\n }\r\n\r\n // frame is used to get idToken and populate the account for the given session\r\n const rawIdToken = this.cacheStorage.getItem(PersistentCacheKeys.IDTOKEN, this.inCookie);\r\n const rawClientInfo = this.cacheStorage.getItem(PersistentCacheKeys.CLIENT_INFO, this.inCookie);\r\n\r\n if (!StringUtils.isEmpty(rawIdToken) && !StringUtils.isEmpty(rawClientInfo)) {\r\n const idToken = new IdToken(rawIdToken);\r\n const clientInfo = new ClientInfo(rawClientInfo, \"\");\r\n this.account = Account.createAccount(idToken, clientInfo);\r\n return this.account;\r\n }\r\n // if login not yet done, return null\r\n return null;\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Extracts state value from the accountState sent with the authentication request.\r\n * @returns {string} scope.\r\n * @ignore\r\n */\r\n getAccountState (state: string): string {\r\n if (state) {\r\n const splitIndex = state.indexOf(Constants.resourceDelimiter);\r\n if (splitIndex > -1 && splitIndex + 1 < state.length) {\r\n return state.substring(splitIndex + 1);\r\n }\r\n }\r\n return state;\r\n }\r\n\r\n /**\r\n * Use to get a list of unique accounts in MSAL cache based on homeAccountIdentifier.\r\n *\r\n * @param {@link Array} Account - all unique accounts in MSAL cache.\r\n */\r\n getAllAccounts(): Array {\r\n const accounts: Array = [];\r\n const accessTokenCacheItems = this.cacheStorage.getAllAccessTokens(Constants.clientId, Constants.homeAccountIdentifier);\r\n\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.homeAccountIdentifier, \"\");\r\n const account: Account = Account.createAccount(idToken, clientInfo);\r\n accounts.push(account);\r\n }\r\n\r\n return this.getUniqueAccounts(accounts);\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Used to filter accounts based on homeAccountIdentifier\r\n * @param {Array} Accounts - accounts saved in the cache\r\n * @ignore\r\n */\r\n private getUniqueAccounts(accounts: Array): Array {\r\n if (!accounts || accounts.length <= 1) {\r\n return accounts;\r\n }\r\n\r\n const flags: Array = [];\r\n const uniqueAccounts: Array = [];\r\n for (let index = 0; index < accounts.length; ++index) {\r\n if (accounts[index].homeAccountIdentifier && flags.indexOf(accounts[index].homeAccountIdentifier) === -1) {\r\n flags.push(accounts[index].homeAccountIdentifier);\r\n uniqueAccounts.push(accounts[index]);\r\n }\r\n }\r\n\r\n return uniqueAccounts;\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Angular\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Broadcast messages - Used only for Angular? *\r\n * @param eventName\r\n * @param data\r\n */\r\n private broadcast(eventName: string, data: string) {\r\n const evt = new CustomEvent(eventName, { detail: data });\r\n window.dispatchEvent(evt);\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Helper function to retrieve the cached token\r\n *\r\n * @param scopes\r\n * @param {@link Account} account\r\n * @param state\r\n * @return {@link AuthResponse} AuthResponse\r\n */\r\n protected getCachedTokenInternal(scopes : Array , account: Account, state: string, correlationId?: string): AuthResponse {\r\n // Get the current session's account object\r\n const accountObject: Account = account || this.getAccount();\r\n if (!accountObject) {\r\n return null;\r\n }\r\n\r\n // Construct AuthenticationRequest based on response type; set \"redirectUri\" from the \"request\" which makes this call from Angular - for this.getRedirectUri()\r\n const newAuthority = this.authorityInstance ? this.authorityInstance : AuthorityFactory.CreateInstance(this.authority, this.config.auth.validateAuthority);\r\n const responseType = this.getTokenType(accountObject, scopes);\r\n\r\n const serverAuthenticationRequest = new ServerRequestParameters(\r\n newAuthority,\r\n this.clientId,\r\n responseType,\r\n this.getRedirectUri(),\r\n scopes,\r\n state,\r\n correlationId\r\n );\r\n\r\n // get cached token\r\n return this.getCachedToken(serverAuthenticationRequest, account);\r\n }\r\n\r\n /**\r\n * @hidden\r\n *\r\n * Get scopes for the Endpoint - Used in Angular to track protected and unprotected resources without interaction from the developer app\r\n * Note: Please check if we need to set the \"redirectUri\" from the \"request\" which makes this call from Angular - for this.getRedirectUri()\r\n *\r\n * @param endpoint\r\n */\r\n protected getScopesForEndpoint(endpoint: string) : Array {\r\n // if user specified list of unprotectedResources, no need to send token to these endpoints, return null.\r\n if (this.config.framework.unprotectedResources.length > 0) {\r\n for (let i = 0; i < this.config.framework.unprotectedResources.length; i++) {\r\n if (endpoint.indexOf(this.config.framework.unprotectedResources[i]) > -1) {\r\n return null;\r\n }\r\n }\r\n }\r\n\r\n // process all protected resources and send the matched one\r\n if (this.config.framework.protectedResourceMap.size > 0) {\r\n for (const key of Array.from(this.config.framework.protectedResourceMap.keys())) {\r\n // configEndpoint is like /api/Todo requested endpoint can be /api/Todo/1\r\n if (endpoint.indexOf(key) > -1) {\r\n return this.config.framework.protectedResourceMap.get(key);\r\n }\r\n }\r\n }\r\n\r\n /*\r\n * default resource will be clientid if nothing specified\r\n * App will use idtoken for calls to itself\r\n * check if it's staring from http or https, needs to match with app host\r\n */\r\n if (endpoint.indexOf(\"http://\") > -1 || endpoint.indexOf(\"https://\") > -1) {\r\n if (UrlUtils.getHostFromUri(endpoint) === UrlUtils.getHostFromUri(this.getRedirectUri())) {\r\n return new Array(this.clientId);\r\n }\r\n } else {\r\n /*\r\n * in angular level, the url for $http interceptor call could be relative url,\r\n * if it's relative call, we'll treat it as app backend call.\r\n */\r\n return new Array(this.clientId);\r\n }\r\n\r\n // if not the app's own backend or not a domain listed in the endpoints structure\r\n return null;\r\n }\r\n\r\n /**\r\n * Return boolean flag to developer to help inform if login is in progress\r\n * @returns {boolean} true/false\r\n */\r\n public getLoginInProgress(): boolean {\r\n return this.cacheStorage.isInteractionInProgress(true);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * @param loginInProgress\r\n */\r\n protected setInteractionInProgress(inProgress: boolean): void {\r\n this.cacheStorage.setInteractionInProgress(inProgress);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * @param loginInProgress\r\n */\r\n protected setloginInProgress(loginInProgress : boolean): void {\r\n this.setInteractionInProgress(loginInProgress);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * returns the status of acquireTokenInProgress\r\n */\r\n protected getAcquireTokenInProgress(): boolean {\r\n return this.cacheStorage.isInteractionInProgress(true);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * @param acquireTokenInProgress\r\n */\r\n protected setAcquireTokenInProgress(acquireTokenInProgress : boolean): void {\r\n this.setInteractionInProgress(acquireTokenInProgress);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * returns the logger handle\r\n */\r\n getLogger(): Logger {\r\n return this.logger;\r\n }\r\n\r\n /**\r\n * Sets the logger callback.\r\n * @param logger Logger callback\r\n */\r\n setLogger(logger: Logger): void {\r\n this.logger = logger;\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Getters and Setters\r\n\r\n /**\r\n * Use to get the redirect uri configured in MSAL or null.\r\n * Evaluates redirectUri if its a function, otherwise simply returns its value.\r\n *\r\n * @returns {string} redirect URL\r\n */\r\n public getRedirectUri(reqRedirectUri?: string): string {\r\n if(reqRedirectUri) {\r\n return reqRedirectUri;\r\n }\r\n else if (typeof this.config.auth.redirectUri === \"function\") {\r\n return this.config.auth.redirectUri();\r\n }\r\n return this.config.auth.redirectUri;\r\n }\r\n\r\n /**\r\n * Use to get the post logout redirect uri configured in MSAL or null.\r\n * Evaluates postLogoutredirectUri if its a function, otherwise simply returns its value.\r\n *\r\n * @returns {string} post logout redirect URL\r\n */\r\n public getPostLogoutRedirectUri(): string {\r\n if (typeof this.config.auth.postLogoutRedirectUri === \"function\") {\r\n return this.config.auth.postLogoutRedirectUri();\r\n }\r\n return this.config.auth.postLogoutRedirectUri;\r\n }\r\n\r\n /**\r\n * Use to get the current {@link Configuration} object in MSAL\r\n *\r\n * @returns {@link Configuration}\r\n */\r\n public getCurrentConfiguration(): Configuration {\r\n if (!this.config) {\r\n throw ClientConfigurationError.createNoSetConfigurationError();\r\n }\r\n return this.config;\r\n }\r\n\r\n /**\r\n * @ignore\r\n *\r\n * Utils function to create the Authentication\r\n * @param {@link account} account object\r\n * @param scopes\r\n *\r\n * @returns {string} token type: token, id_token or id_token token\r\n *\r\n */\r\n private getTokenType(accountObject: Account, scopes: string[]): string {\r\n const accountsMatch = Account.compareAccounts(accountObject, this.getAccount());\r\n return ServerRequestParameters.determineResponseType(accountsMatch, scopes);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Sets the cachekeys for and stores the account information in cache\r\n * @param account\r\n * @param state\r\n * @hidden\r\n */\r\n private setAccountCache(account: Account, state: string) {\r\n\r\n // Cache acquireTokenAccountKey\r\n const accountId = account ? this.getAccountId(account) : Constants.no_account;\r\n\r\n const acquireTokenAccountKey = AuthCache.generateAcquireTokenAccountKey(accountId, state);\r\n this.cacheStorage.setItem(acquireTokenAccountKey, JSON.stringify(account));\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Sets the cacheKey for and stores the authority information in cache\r\n * @param state\r\n * @param authority\r\n * @hidden\r\n */\r\n private setAuthorityCache(state: string, authority: string) {\r\n // Cache authorityKey\r\n const authorityKey = AuthCache.generateAuthorityKey(state);\r\n this.cacheStorage.setItem(authorityKey, UrlUtils.CanonicalizeUri(authority), this.inCookie);\r\n }\r\n\r\n /**\r\n * Updates account, authority, and nonce in cache\r\n * @param serverAuthenticationRequest\r\n * @param account\r\n * @hidden\r\n * @ignore\r\n */\r\n private updateCacheEntries(serverAuthenticationRequest: ServerRequestParameters, account: Account, isLoginCall: boolean, loginStartPage?: string) {\r\n // Cache Request Originator Page\r\n if (loginStartPage) {\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.LOGIN_REQUEST, serverAuthenticationRequest.state), loginStartPage, this.inCookie);\r\n }\r\n\r\n // Cache account and authority\r\n if (isLoginCall) {\r\n // Cache the state\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, serverAuthenticationRequest.state), serverAuthenticationRequest.state, this.inCookie);\r\n } else {\r\n this.setAccountCache(account, serverAuthenticationRequest.state);\r\n }\r\n // Cache authorityKey\r\n this.setAuthorityCache(serverAuthenticationRequest.state, serverAuthenticationRequest.authority);\r\n\r\n // Cache nonce\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN, serverAuthenticationRequest.state), serverAuthenticationRequest.nonce, this.inCookie);\r\n }\r\n\r\n /**\r\n * Returns the unique identifier for the logged in account\r\n * @param account\r\n * @hidden\r\n * @ignore\r\n */\r\n private getAccountId(account: Account): string {\r\n // return `${account.accountIdentifier}` + Constants.resourceDelimiter + `${account.homeAccountIdentifier}`;\r\n let accountId: string;\r\n if (!StringUtils.isEmpty(account.homeAccountIdentifier)) {\r\n accountId = account.homeAccountIdentifier;\r\n }\r\n else {\r\n accountId = Constants.no_account;\r\n }\r\n\r\n return accountId;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param extraQueryParameters\r\n *\r\n * Construct 'tokenRequest' from the available data in adalIdToken\r\n */\r\n private buildIDTokenRequest(request: AuthenticationParameters): AuthenticationParameters {\r\n\r\n const tokenRequest: AuthenticationParameters = {\r\n scopes: Constants.oidcScopes,\r\n authority: this.authority,\r\n account: this.getAccount(),\r\n extraQueryParameters: request.extraQueryParameters,\r\n correlationId: request.correlationId\r\n };\r\n\r\n return tokenRequest;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param config\r\n * @param clientId\r\n *\r\n * Construct TelemetryManager from Configuration\r\n */\r\n private getTelemetryManagerFromConfig(config: TelemetryOptions, clientId: string): TelemetryManager {\r\n if (!config) { // if unset\r\n return TelemetryManager.getTelemetrymanagerStub(clientId, this.logger);\r\n }\r\n // if set then validate\r\n const { applicationName, applicationVersion, telemetryEmitter } = config;\r\n if (!applicationName || !applicationVersion || !telemetryEmitter) {\r\n throw ClientConfigurationError.createTelemetryConfigError(config);\r\n }\r\n // if valid then construct\r\n const telemetryPlatform: TelemetryPlatform = {\r\n applicationName,\r\n applicationVersion\r\n };\r\n const telemetryManagerConfig: TelemetryConfig = {\r\n platform: telemetryPlatform,\r\n clientId: clientId\r\n };\r\n return new TelemetryManager(telemetryManagerConfig, telemetryEmitter, this.logger);\r\n }\r\n\r\n // #endregion\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { NetworkRequestType } from \"./utils/Constants\";\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\n\r\nexport class XhrClient {\r\n\r\n public sendRequestAsync(url: string, method: string, enableCaching?: boolean): Promise {\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(method, url, /* async: */ true);\r\n if (enableCaching) {\r\n /*\r\n * TODO: (shivb) ensure that this can be cached\r\n * xhr.setRequestHeader(\"Cache-Control\", \"Public\");\r\n */\r\n }\r\n\r\n xhr.onload = () => {\r\n if (xhr.status < 200 || xhr.status >= 300) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n let jsonResponse;\r\n try {\r\n jsonResponse = JSON.parse(xhr.responseText);\r\n } catch (e) {\r\n reject(this.handleError(xhr.responseText));\r\n }\r\n const response: XhrResponse = {\r\n statusCode: xhr.status,\r\n body: jsonResponse\r\n };\r\n resolve(response);\r\n };\r\n\r\n xhr.onerror = () => {\r\n reject(xhr.status);\r\n };\r\n\r\n if (method === NetworkRequestType.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): string {\r\n let jsonResponse: object;\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\r\nexport type XhrResponse = {\r\n body: object,\r\n statusCode: number\r\n};\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { IUri } from \"../IUri\";\r\nimport { ITenantDiscoveryResponse } from \"./ITenantDiscoveryResponse\";\r\nimport { ClientConfigurationErrorMessage, ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { XhrClient, XhrResponse } from \"../XHRClient\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\r\nimport TelemetryManager from \"../telemetry/TelemetryManager\";\r\nimport HttpEvent from \"../telemetry/HttpEvent\";\r\nimport { TrustedAuthority } from \"./TrustedAuthority\";\r\nimport { NetworkRequestType, Constants, WELL_KNOWN_SUFFIX } from \"../utils/Constants\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport enum AuthorityType {\r\n Default,\r\n Adfs\r\n}\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class Authority {\r\n constructor(authority: string, validateAuthority: boolean, authorityMetadata?: ITenantDiscoveryResponse) {\r\n this.IsValidationEnabled = validateAuthority;\r\n this.CanonicalAuthority = authority;\r\n\r\n this.validateAsUri();\r\n this.tenantDiscoveryResponse = authorityMetadata;\r\n }\r\n\r\n public static isAdfs(authorityUrl: string): boolean {\r\n const components = UrlUtils.GetUrlComponents(authorityUrl);\r\n const pathSegments = components.PathSegments;\r\n\r\n return (pathSegments.length && pathSegments[0].toLowerCase() === Constants.ADFS);\r\n }\r\n\r\n public get AuthorityType(): AuthorityType {\r\n return Authority.isAdfs(this.canonicalAuthority)? AuthorityType.Adfs : AuthorityType.Default;\r\n }\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}|{tenantid}/g, this.Tenant);\r\n }\r\n\r\n public get EndSessionEndpoint(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.EndSessionEndpoint.replace(/{tenant}|{tenantid}/g, this.Tenant);\r\n }\r\n\r\n public get SelfSignedJwtAudience(): string {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.Issuer.replace(/{tenant}|{tenantid}/g, this.Tenant);\r\n }\r\n\r\n private validateResolved() {\r\n if (!this.hasCachedMetadata()) {\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 = UrlUtils.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 = UrlUtils.GetUrlComponents(this.CanonicalAuthority);\r\n }\r\n\r\n return this.canonicalAuthorityUrlComponents;\r\n }\r\n\r\n // http://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\r\n protected get DefaultOpenIdConfigurationEndpoint(): string {\r\n return (this.AuthorityType === AuthorityType.Adfs)? `${this.CanonicalAuthority}${WELL_KNOWN_SUFFIX}` : `${this.CanonicalAuthority}v2.0/${WELL_KNOWN_SUFFIX}`;\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 ClientConfigurationErrorMessage.invalidAuthorityType;\r\n }\r\n\r\n if (!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\r\n throw ClientConfigurationErrorMessage.authorityUriInsecure;\r\n }\r\n\r\n if (!components.PathSegments || components.PathSegments.length < 1) {\r\n throw ClientConfigurationErrorMessage.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, telemetryManager: TelemetryManager, correlationId: string): Promise {\r\n const client = new XhrClient();\r\n\r\n const httpMethod = NetworkRequestType.GET;\r\n const httpEvent: HttpEvent = telemetryManager.createAndStartHttpEvent(correlationId, httpMethod, openIdConfigurationEndpoint, \"openIdConfigurationEndpoint\");\r\n\r\n return client.sendRequestAsync(openIdConfigurationEndpoint, httpMethod, /* enableCaching: */ true)\r\n .then((response: XhrResponse) => {\r\n httpEvent.httpResponseStatus = response.statusCode;\r\n telemetryManager.stopEvent(httpEvent);\r\n return {\r\n AuthorizationEndpoint: response.body[\"authorization_endpoint\"],\r\n EndSessionEndpoint: response.body[\"end_session_endpoint\"],\r\n Issuer: response.body[\"issuer\"]\r\n };\r\n })\r\n .catch(err => {\r\n httpEvent.serverErrorCode = err;\r\n telemetryManager.stopEvent(httpEvent);\r\n throw err;\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 async resolveEndpointsAsync(telemetryManager: TelemetryManager, correlationId: string): Promise {\r\n if (this.IsValidationEnabled) {\r\n const host = this.canonicalAuthorityUrlComponents.HostNameAndPort;\r\n if (TrustedAuthority.getTrustedHostList().length === 0) {\r\n await TrustedAuthority.setTrustedAuthoritiesFromNetwork(this.canonicalAuthority, telemetryManager, correlationId);\r\n }\r\n\r\n if (!TrustedAuthority.IsInTrustedHostList(host)) {\r\n throw ClientConfigurationError.createUntrustedAuthorityError(host);\r\n }\r\n }\r\n const openIdConfigurationEndpointResponse = this.GetOpenIdConfigurationEndpoint();\r\n this.tenantDiscoveryResponse = await this.DiscoverEndpoints(openIdConfigurationEndpointResponse, telemetryManager, correlationId);\r\n\r\n return this.tenantDiscoveryResponse;\r\n }\r\n\r\n /**\r\n * Checks if there is a cached tenant discovery response with required fields.\r\n */\r\n public hasCachedMetadata(): boolean {\r\n return !!(this.tenantDiscoveryResponse &&\r\n this.tenantDiscoveryResponse.AuthorizationEndpoint &&\r\n this.tenantDiscoveryResponse.EndSessionEndpoint &&\r\n this.tenantDiscoveryResponse.Issuer);\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 GetOpenIdConfigurationEndpoint(): string {\r\n return this.DefaultOpenIdConfigurationEndpoint;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\n/**\r\n * @hidden\r\n */\r\nimport { Authority } from \"./Authority\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { ITenantDiscoveryResponse, OpenIdConfiguration } from \"./ITenantDiscoveryResponse\";\r\nimport TelemetryManager from \"../telemetry/TelemetryManager\";\r\n\r\nexport class AuthorityFactory {\r\n private static metadataMap = new Map();\r\n\r\n public static async saveMetadataFromNetwork(authorityInstance: Authority, telemetryManager: TelemetryManager, correlationId: string): Promise {\r\n const metadata = await authorityInstance.resolveEndpointsAsync(telemetryManager, correlationId);\r\n this.metadataMap.set(authorityInstance.CanonicalAuthority, metadata);\r\n return metadata;\r\n }\r\n\r\n public static getMetadata(authorityUrl: string): ITenantDiscoveryResponse {\r\n return this.metadataMap.get(authorityUrl);\r\n }\r\n\r\n public static saveMetadataFromConfig(authorityUrl: string, authorityMetadataJson: string): void {\r\n try {\r\n if (authorityMetadataJson) {\r\n const parsedMetadata = JSON.parse(authorityMetadataJson) as OpenIdConfiguration;\r\n\r\n if (!parsedMetadata.authorization_endpoint || !parsedMetadata.end_session_endpoint || !parsedMetadata.issuer) {\r\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\r\n }\r\n\r\n this.metadataMap.set(authorityUrl, {\r\n AuthorizationEndpoint: parsedMetadata.authorization_endpoint,\r\n EndSessionEndpoint: parsedMetadata.end_session_endpoint,\r\n Issuer: parsedMetadata.issuer\r\n });\r\n }\r\n } catch (e) {\r\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\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, authorityMetadata?: string): Authority {\r\n if (StringUtils.isEmpty(authorityUrl)) {\r\n return null;\r\n }\r\n\r\n if (authorityMetadata) {\r\n // todo: log statements\r\n this.saveMetadataFromConfig(authorityUrl, authorityMetadata);\r\n }\r\n return new Authority(authorityUrl, validateAuthority, this.metadataMap.get(authorityUrl));\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport TelemetryManager from \"../telemetry/TelemetryManager\";\r\nimport { XhrClient, XhrResponse } from \"../XHRClient\";\r\nimport HttpEvent from \"../telemetry/HttpEvent\";\r\nimport { AAD_INSTANCE_DISCOVERY_ENDPOINT, NetworkRequestType } from \"../utils/Constants\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\r\n\r\nexport class TrustedAuthority {\r\n private static TrustedHostList: Array = [];\r\n\r\n /**\r\n * \r\n * @param validateAuthority \r\n * @param knownAuthorities \r\n */\r\n public static setTrustedAuthoritiesFromConfig(validateAuthority: boolean, knownAuthorities: Array): void{\r\n if (validateAuthority && !this.getTrustedHostList().length){\r\n knownAuthorities.forEach(function(authority) {\r\n TrustedAuthority.TrustedHostList.push(authority.toLowerCase());\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * @param telemetryManager \r\n * @param correlationId \r\n */\r\n private static async getAliases(authorityToVerify: string, telemetryManager: TelemetryManager, correlationId?: string): Promise> {\r\n const client: XhrClient = new XhrClient();\r\n\r\n const httpMethod = NetworkRequestType.GET;\r\n const instanceDiscoveryEndpoint = `${AAD_INSTANCE_DISCOVERY_ENDPOINT}${authorityToVerify}oauth2/v2.0/authorize`;\r\n const httpEvent: HttpEvent = telemetryManager.createAndStartHttpEvent(correlationId, httpMethod, instanceDiscoveryEndpoint, \"getAliases\");\r\n return client.sendRequestAsync(instanceDiscoveryEndpoint, httpMethod, true)\r\n .then((response: XhrResponse) => {\r\n httpEvent.httpResponseStatus = response.statusCode;\r\n telemetryManager.stopEvent(httpEvent);\r\n return response.body[\"metadata\"];\r\n })\r\n .catch(err => {\r\n httpEvent.serverErrorCode = err;\r\n telemetryManager.stopEvent(httpEvent);\r\n throw err;\r\n });\r\n }\r\n\r\n /**\r\n * \r\n * @param telemetryManager \r\n * @param correlationId \r\n */\r\n public static async setTrustedAuthoritiesFromNetwork(authorityToVerify: string, telemetryManager: TelemetryManager, correlationId?: string): Promise {\r\n const metadata = await this.getAliases(authorityToVerify, telemetryManager, correlationId);\r\n metadata.forEach(function(entry: object){\r\n const authorities: Array = entry[\"aliases\"];\r\n authorities.forEach(function(authority: string) {\r\n TrustedAuthority.TrustedHostList.push(authority.toLowerCase());\r\n });\r\n });\r\n\r\n const host = UrlUtils.GetUrlComponents(authorityToVerify).HostNameAndPort;\r\n if (TrustedAuthority.getTrustedHostList().length && !TrustedAuthority.IsInTrustedHostList(host)){\r\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded\r\n TrustedAuthority.TrustedHostList.push(host.toLowerCase());\r\n }\r\n } \r\n\r\n public static getTrustedHostList(): Array {\r\n return this.TrustedHostList;\r\n }\r\n\r\n /**\r\n * Checks to see if the host is in a list of trusted hosts\r\n * @param host \r\n */\r\n public static IsInTrustedHostList(host: string): boolean {\r\n return this.TrustedHostList.indexOf(host.toLowerCase()) > -1;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\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","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { CryptoUtils } from \"../utils/CryptoUtils\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\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 scopes: string;\r\n homeAccountIdentifier: string;\r\n\r\n constructor(authority: string, clientId: string, scopes: string, uid: string, utid: string) {\r\n this.authority = UrlUtils.CanonicalizeUri(authority);\r\n this.clientId = clientId;\r\n this.scopes = scopes;\r\n this.homeAccountIdentifier = CryptoUtils.base64Encode(uid) + \".\" + CryptoUtils.base64Encode(utid);\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\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 homeAccountIdentifier: string;\r\n\r\n constructor(accessToken: string, idToken: string, expiresIn: string, homeAccountIdentifier: string) {\r\n this.accessToken = accessToken;\r\n this.idToken = idToken;\r\n this.expiresIn = expiresIn;\r\n this.homeAccountIdentifier = homeAccountIdentifier;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Constants, PersistentCacheKeys, TemporaryCacheKeys, ErrorCacheKeys, ServerHashParamKeys, SESSION_STORAGE} from \"../utils/Constants\";\r\nimport { AccessTokenCacheItem } from \"./AccessTokenCacheItem\";\r\nimport { CacheLocation } from \"../Configuration\";\r\nimport { BrowserStorage } from \"./BrowserStorage\";\r\nimport { RequestUtils } from \"../utils/RequestUtils\";\r\nimport { AccessTokenKey } from \"./AccessTokenKey\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { IdToken } from \"../IdToken\";\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class AuthCache extends BrowserStorage {// Singleton\r\n\r\n private clientId: string;\r\n private rollbackEnabled: boolean;\r\n private temporaryCache: BrowserStorage;\r\n\r\n constructor(clientId: string, cacheLocation: CacheLocation, storeAuthStateInCookie: boolean) {\r\n super(cacheLocation);\r\n this.temporaryCache = new BrowserStorage(SESSION_STORAGE);\r\n this.clientId = clientId;\r\n // This is hardcoded to true for now. We may make this configurable in the future\r\n this.rollbackEnabled = true;\r\n this.migrateCacheEntries(storeAuthStateInCookie);\r\n }\r\n\r\n /**\r\n * Support roll back to old cache schema until the next major release: true by default now\r\n * @param storeAuthStateInCookie\r\n */\r\n private migrateCacheEntries(storeAuthStateInCookie: boolean) {\r\n\r\n const idTokenKey = `${Constants.cachePrefix}.${PersistentCacheKeys.IDTOKEN}`;\r\n const clientInfoKey = `${Constants.cachePrefix}.${PersistentCacheKeys.CLIENT_INFO}`;\r\n const errorKey = `${Constants.cachePrefix}.${ErrorCacheKeys.ERROR}`;\r\n const errorDescKey = `${Constants.cachePrefix}.${ErrorCacheKeys.ERROR_DESC}`;\r\n\r\n const idTokenValue = super.getItem(idTokenKey);\r\n\r\n let idToken;\r\n\r\n if (idTokenValue) {\r\n try {\r\n idToken = new IdToken(idTokenValue);\r\n } catch (e) {\r\n return;\r\n }\r\n }\r\n\r\n if (idToken && idToken.claims && idToken.claims.aud === this.clientId) {\r\n const clientInfoValue = super.getItem(clientInfoKey);\r\n const errorValue = super.getItem(errorKey);\r\n const errorDescValue = super.getItem(errorDescKey);\r\n\r\n const values = [idTokenValue, clientInfoValue, errorValue, errorDescValue];\r\n const keysToMigrate = [PersistentCacheKeys.IDTOKEN, PersistentCacheKeys.CLIENT_INFO,ErrorCacheKeys.ERROR, ErrorCacheKeys.ERROR_DESC];\r\n\r\n keysToMigrate.forEach((cacheKey, index) => this.duplicateCacheEntry(cacheKey, values[index], storeAuthStateInCookie));\r\n }\r\n }\r\n\r\n /**\r\n * Utility function to help with roll back keys\r\n * @param newKey\r\n * @param value\r\n * @param storeAuthStateInCookie\r\n */\r\n private duplicateCacheEntry(newKey: string, value: string, storeAuthStateInCookie?: boolean) {\r\n if (value) {\r\n this.setItem(newKey, value, storeAuthStateInCookie);\r\n }\r\n }\r\n\r\n /**\r\n * Prepend msal. to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)\r\n * @param key\r\n * @param addInstanceId\r\n */\r\n private generateCacheKey(key: string, addInstanceId: boolean): string {\r\n try {\r\n // Defined schemas do not need the key appended\r\n JSON.parse(key);\r\n return key;\r\n } catch (e) {\r\n if (key.indexOf(`${Constants.cachePrefix}`) === 0 || key.indexOf(Constants.adalIdToken) === 0){\r\n return key;\r\n }\r\n return addInstanceId ? `${Constants.cachePrefix}.${this.clientId}.${key}` : `${Constants.cachePrefix}.${key}`;\r\n }\r\n }\r\n\r\n /**\r\n * Validates that the input cache key contains the account search terms (clientId and homeAccountIdentifier) and\r\n * then whether or not it contains the \"scopes\", depending on the token type being searched for. With matching account\r\n * search terms, Access Token search tries to match the \"scopes\" keyword, while Id Token search expects \"scopes\" to not be included.\r\n * @param key \r\n * @param clientId \r\n * @param homeAccountIdentifier \r\n * @param tokenType \r\n */\r\n private matchKeyForType(key:string, clientId: string, homeAccountIdentifier: string, tokenType: string): AccessTokenKey {\r\n // All valid token cache item keys are valid JSON objects, ignore keys that aren't\r\n const parsedKey = StringUtils.validateAndParseJsonCacheKey(key);\r\n\r\n if (!parsedKey) {\r\n return null;\r\n }\r\n\r\n // Does the cache item match the request account\r\n const accountMatches = key.match(clientId) && key.match(homeAccountIdentifier);\r\n // Does the cache item match the requested token type\r\n let tokenTypeMatches = false;\r\n\r\n switch (tokenType) {\r\n case ServerHashParamKeys.ACCESS_TOKEN:\r\n // Cache item is an access token if scopes are included in the cache item key\r\n tokenTypeMatches = !!key.match(Constants.scopes);\r\n break;\r\n case ServerHashParamKeys.ID_TOKEN:\r\n // Cache may be an ID token if scopes are NOT included in the cache item key\r\n tokenTypeMatches = !key.match(Constants.scopes);\r\n break;\r\n }\r\n\r\n return (accountMatches && tokenTypeMatches) ? parsedKey : null;\r\n }\r\n\r\n /**\r\n * add value to storage\r\n * @param key\r\n * @param value\r\n * @param enableCookieStorage\r\n */\r\n setItem(key: string, value: string, enableCookieStorage?: boolean): void {\r\n super.setItem(this.generateCacheKey(key, true), value, enableCookieStorage);\r\n\r\n // Values stored in cookies will have rollback disabled to minimize cookie length\r\n if (this.rollbackEnabled && !enableCookieStorage) {\r\n super.setItem(this.generateCacheKey(key, false), value, enableCookieStorage);\r\n }\r\n }\r\n\r\n /**\r\n * get one item by key from storage\r\n * @param key\r\n * @param enableCookieStorage\r\n */\r\n getItem(key: string, enableCookieStorage?: boolean): string {\r\n return super.getItem(this.generateCacheKey(key, true), enableCookieStorage);\r\n }\r\n\r\n /**\r\n * remove value from storage\r\n * @param key\r\n */\r\n removeItem(key: string): void {\r\n this.temporaryCache.removeItem(this.generateCacheKey(key, true));\r\n super.removeItem(this.generateCacheKey(key, true));\r\n if (this.rollbackEnabled) {\r\n super.removeItem(this.generateCacheKey(key, false));\r\n }\r\n }\r\n\r\n /**\r\n * Sets temporary cache value\r\n * @param key \r\n * @param value \r\n * @param enableCookieStorage \r\n */\r\n setTemporaryItem(key: string, value: string, enableCookieStorage?: boolean): void {\r\n this.temporaryCache.setItem(this.generateCacheKey(key, true), value, enableCookieStorage);\r\n }\r\n\r\n /**\r\n * Gets temporary cache value\r\n * @param key \r\n * @param enableCookieStorage \r\n */\r\n getTemporaryItem(key: string, enableCookieStorage?: boolean): string {\r\n return this.temporaryCache.getItem(this.generateCacheKey(key, true), enableCookieStorage);\r\n }\r\n\r\n /**\r\n * Reset the cache items\r\n */\r\n resetCacheItems(): void {\r\n const storage = window[this.cacheLocation];\r\n let key: string;\r\n for (key in storage) {\r\n // Check if key contains msal prefix; For now, we are clearing all cache items created by MSAL.js\r\n if (storage.hasOwnProperty(key) && (key.indexOf(Constants.cachePrefix) !== -1)) {\r\n super.removeItem(key);\r\n // TODO: Clear cache based on client id (clarify use cases where this is needed)\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Reset all temporary cache items\r\n */\r\n resetTempCacheItems(state?: string): void {\r\n const stateId = state && RequestUtils.parseLibraryState(state).id;\r\n const isTokenRenewalInProgress = this.tokenRenewalInProgress(state);\r\n\r\n const storage = window[this.cacheLocation];\r\n // check state and remove associated cache\r\n if (stateId && !isTokenRenewalInProgress) {\r\n Object.keys(storage).forEach(key => {\r\n if (key.indexOf(stateId) !== -1) {\r\n this.removeItem(key);\r\n super.clearItemCookie(key);\r\n }\r\n });\r\n }\r\n // delete the interaction status cache\r\n this.setInteractionInProgress(false);\r\n this.removeItem(TemporaryCacheKeys.REDIRECT_REQUEST);\r\n }\r\n\r\n /**\r\n * Set cookies for IE\r\n * @param cName\r\n * @param cValue\r\n * @param expires\r\n */\r\n setItemCookie(cName: string, cValue: string, expires?: number): void {\r\n super.setItemCookie(this.generateCacheKey(cName, true), cValue, expires);\r\n if (this.rollbackEnabled) {\r\n super.setItemCookie(this.generateCacheKey(cName, false), cValue, expires);\r\n }\r\n }\r\n\r\n clearItemCookie(cName: string): void {\r\n super.clearItemCookie(this.generateCacheKey(cName, true));\r\n if (this.rollbackEnabled) {\r\n super.clearItemCookie(this.generateCacheKey(cName, false));\r\n }\r\n }\r\n\r\n /**\r\n * get one item by key from cookies\r\n * @param cName\r\n */\r\n getItemCookie(cName: string): string {\r\n return super.getItemCookie(this.generateCacheKey(cName, true));\r\n }\r\n\r\n /**\r\n * Get all tokens of a certain type from the cache\r\n * @param clientId \r\n * @param homeAccountIdentifier \r\n * @param tokenType\r\n */\r\n getAllTokensByType(clientId: string, homeAccountIdentifier: string, tokenType: string): Array {\r\n const results = Object.keys(window[this.cacheLocation]).reduce((tokens, key) => {\r\n const matchedTokenKey: AccessTokenKey = this.matchKeyForType(key, clientId, homeAccountIdentifier, tokenType);\r\n if (matchedTokenKey) {\r\n const value = this.getItem(key);\r\n if (value) {\r\n try {\r\n const newAccessTokenCacheItem = new AccessTokenCacheItem(matchedTokenKey, JSON.parse(value));\r\n return tokens.concat([ newAccessTokenCacheItem ]);\r\n } catch (err) {\r\n // Skip cache items with non-valid JSON values\r\n return tokens;\r\n }\r\n }\r\n }\r\n\r\n return tokens;\r\n }, []);\r\n return results;\r\n }\r\n\r\n /**\r\n * Get all access tokens in the cache\r\n * @param clientId\r\n * @param homeAccountIdentifier\r\n */\r\n getAllAccessTokens(clientId: string, homeAccountIdentifier: string): Array {\r\n return this.getAllTokensByType(clientId, homeAccountIdentifier, ServerHashParamKeys.ACCESS_TOKEN);\r\n }\r\n\r\n /**\r\n * Get all id tokens in the cache in the form of AccessTokenCacheItem objects so they are \r\n * in a normalized format and can make use of the existing cached access token validation logic\r\n */\r\n getAllIdTokens(clientId: string, homeAccountIdentifier: string): Array {\r\n return this.getAllTokensByType(clientId, homeAccountIdentifier, ServerHashParamKeys.ID_TOKEN);\r\n }\r\n\r\n /**\r\n * Get all access and ID tokens in the cache\r\n * @param clientId \r\n * @param homeAccountIdentifier \r\n */\r\n getAllTokens(clientId: string, homeAccountIdentifier: string): Array {\r\n const accessTokens = this.getAllAccessTokens(clientId, homeAccountIdentifier);\r\n const idTokens = this.getAllIdTokens(clientId, homeAccountIdentifier);\r\n return [...accessTokens, ...idTokens];\r\n }\r\n\r\n /**\r\n * Returns whether or not interaction is currently in progress. Optionally scope it to just this clientId\r\n * @param forThisClient \r\n */\r\n isInteractionInProgress(matchClientId: boolean): boolean {\r\n const clientId = this.getInteractionInProgress();\r\n if (matchClientId) {\r\n return clientId === this.clientId;\r\n } else {\r\n return !!clientId;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the clientId of the interaction currently in progress\r\n */\r\n getInteractionInProgress(): string {\r\n return this.getTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.INTERACTION_STATUS, false));\r\n }\r\n\r\n /**\r\n * Sets interaction in progress state\r\n * @param isInProgress \r\n */\r\n setInteractionInProgress(newInProgressValue: boolean): void {\r\n if (newInProgressValue) {\r\n if (this.isInteractionInProgress(false)) {\r\n throw ClientAuthError.createAcquireTokenInProgressError();\r\n } else {\r\n // Ensure we don't overwrite interaction in progress for a different clientId\r\n this.setTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.INTERACTION_STATUS, false), this.clientId);\r\n }\r\n } else if (!newInProgressValue && this.isInteractionInProgress(true)) {\r\n // Only remove if the current in progress interaction is for this clientId\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.INTERACTION_STATUS, false));\r\n }\r\n }\r\n\r\n /**\r\n * Return if the token renewal is still in progress\r\n * \r\n * @param stateValue\r\n */\r\n private tokenRenewalInProgress(stateValue: string): boolean {\r\n const renewStatus = this.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, stateValue));\r\n return !!(renewStatus && renewStatus === Constants.inProgress);\r\n }\r\n\r\n /**\r\n * Clear all cookies\r\n */\r\n public clearMsalCookie(state?: string): void {\r\n /*\r\n * If state is truthy, remove values associated with that request.\r\n * Otherwise, remove all MSAL cookies.\r\n */\r\n if (state) {\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN, state));\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, state));\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.LOGIN_REQUEST, state));\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_ACQ_TOKEN, state));\r\n } else {\r\n const cookies = document.cookie.split(\";\");\r\n cookies.forEach(cookieString => {\r\n const [\r\n cookieName\r\n ] = cookieString.trim().split(\"=\");\r\n\r\n if (cookieName.indexOf(Constants.cachePrefix) > -1) {\r\n super.clearItemCookie(cookieName);\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Create acquireTokenAccountKey to cache account object\r\n * @param accountId\r\n * @param state\r\n */\r\n public static generateAcquireTokenAccountKey(accountId: string, state: string): string {\r\n const stateId = RequestUtils.parseLibraryState(state).id;\r\n return `${TemporaryCacheKeys.ACQUIRE_TOKEN_ACCOUNT}${Constants.resourceDelimiter}${accountId}${Constants.resourceDelimiter}${stateId}`;\r\n }\r\n\r\n /**\r\n * Create authorityKey to cache authority\r\n * @param state\r\n */\r\n public static generateAuthorityKey(state: string): string {\r\n return AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.AUTHORITY, state);\r\n }\r\n\r\n /**\r\n * Generates the cache key for temporary cache items, using request state\r\n * @param tempCacheKey Cache key prefix\r\n * @param state Request state value\r\n */\r\n public static generateTemporaryCacheKey(tempCacheKey: TemporaryCacheKeys, state: string): string {\r\n // Use the state id (a guid), in the interest of shorter key names, which is important for cookies.\r\n const stateId = RequestUtils.parseLibraryState(state).id;\r\n return `${tempCacheKey}${Constants.resourceDelimiter}${stateId}`;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { CacheLocation } from \"../Configuration\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { AuthError } from \"../error/AuthError\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class BrowserStorage {// Singleton\r\n\r\n protected cacheLocation: CacheLocation;\r\n\r\n constructor(cacheLocation: CacheLocation) {\r\n if (!window) {\r\n throw AuthError.createNoWindowObjectError(\"Browser storage class could not find window object\");\r\n }\r\n\r\n const storageSupported = typeof window[cacheLocation] !== \"undefined\" && window[cacheLocation] !== null;\r\n if (!storageSupported) {\r\n throw ClientConfigurationError.createStorageNotSupportedError(cacheLocation);\r\n }\r\n this.cacheLocation = cacheLocation;\r\n }\r\n\r\n /**\r\n * add value to storage\r\n * @param key\r\n * @param value\r\n * @param enableCookieStorage\r\n */\r\n setItem(key: string, value: string, enableCookieStorage?: boolean): void {\r\n window[this.cacheLocation].setItem(key, value);\r\n if (enableCookieStorage) {\r\n this.setItemCookie(key, value);\r\n }\r\n }\r\n\r\n /**\r\n * get one item by key from storage\r\n * @param key\r\n * @param enableCookieStorage\r\n */\r\n getItem(key: string, enableCookieStorage?: boolean): string {\r\n if (enableCookieStorage && this.getItemCookie(key)) {\r\n return this.getItemCookie(key);\r\n }\r\n return window[this.cacheLocation].getItem(key);\r\n }\r\n\r\n /**\r\n * remove value from storage\r\n * @param key\r\n */\r\n removeItem(key: string): void {\r\n return window[this.cacheLocation].removeItem(key);\r\n }\r\n\r\n /**\r\n * clear storage (remove all items from it)\r\n */\r\n clear(): void {\r\n return window[this.cacheLocation].clear();\r\n }\r\n\r\n /**\r\n * add value to cookies\r\n * @param cName\r\n * @param cValue\r\n * @param expires\r\n */\r\n setItemCookie(cName: string, cValue: string, expires?: number): void {\r\n let cookieStr = encodeURIComponent(cName) + \"=\" + encodeURIComponent(cValue) + \";path=/;\";\r\n if (expires) {\r\n const expireTime = this.getCookieExpirationTime(expires);\r\n cookieStr += \"expires=\" + expireTime + \";\";\r\n }\r\n\r\n document.cookie = cookieStr;\r\n }\r\n\r\n /**\r\n * get one item by key from cookies\r\n * @param cName\r\n */\r\n getItemCookie(cName: string): string {\r\n const name = encodeURIComponent(cName) + \"=\";\r\n const ca = document.cookie.split(\";\");\r\n for (let i = 0; i < ca.length; i++) {\r\n let c = ca[i];\r\n while (c.charAt(0) === \" \") {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) === 0) {\r\n return decodeURIComponent(c.substring(name.length, c.length));\r\n }\r\n }\r\n return \"\";\r\n }\r\n\r\n /**\r\n * Clear an item in the cookies by key\r\n * @param cName\r\n */\r\n clearItemCookie(cName: string): void {\r\n this.setItemCookie(cName, \"\", -1);\r\n }\r\n\r\n /**\r\n * Get cookie expiration time\r\n * @param cookieLifeDays\r\n */\r\n getCookieExpirationTime(cookieLifeDays: number): string {\r\n const today = new Date();\r\n const expr = new Date(today.getTime() + cookieLifeDays * 24 * 60 * 60 * 1000);\r\n return expr.toUTCString();\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const AuthErrorMessage = {\r\n unexpectedError: {\r\n code: \"unexpected_error\",\r\n desc: \"Unexpected error in authentication.\"\r\n },\r\n noWindowObjectError: {\r\n code: \"no_window_object\",\r\n desc: \"No window object available. Details:\"\r\n }\r\n};\r\n\r\n/**\r\n * General error class thrown by the MSAL.js library.\r\n */\r\nexport class AuthError extends Error {\r\n\r\n errorCode: string;\r\n errorMessage: string;\r\n\r\n constructor(errorCode: string, errorMessage?: string) {\r\n super(errorMessage);\r\n Object.setPrototypeOf(this, AuthError.prototype);\r\n\r\n this.errorCode = errorCode;\r\n this.errorMessage = errorMessage;\r\n this.name = \"AuthError\";\r\n }\r\n\r\n static createUnexpectedError(errDesc: string): AuthError {\r\n return new AuthError(AuthErrorMessage.unexpectedError.code, `${AuthErrorMessage.unexpectedError.desc}: ${errDesc}`);\r\n }\r\n\r\n static createNoWindowObjectError(errDesc: string): AuthError {\r\n return new AuthError(AuthErrorMessage.noWindowObjectError.code, `${AuthErrorMessage.noWindowObjectError.desc} ${errDesc}`);\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthError } from \"./AuthError\";\r\nimport { IdToken } from \"../IdToken\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\n\r\nexport const ClientAuthErrorMessage = {\r\n endpointResolutionError: {\r\n code: \"endpoints_resolution_error\",\r\n desc: \"Error: could not resolve endpoints. Please check network and try again.\"\r\n },\r\n popUpWindowError: {\r\n code: \"popup_window_error\",\r\n desc: \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"\r\n },\r\n tokenRenewalError: {\r\n code: \"token_renewal_error\",\r\n desc: \"Token renewal operation failed due to timeout.\"\r\n },\r\n invalidIdToken: {\r\n code: \"invalid_id_token\",\r\n desc: \"Invalid ID token format.\"\r\n },\r\n invalidStateError: {\r\n code: \"invalid_state_error\",\r\n desc: \"Invalid state.\"\r\n },\r\n nonceMismatchError: {\r\n code: \"nonce_mismatch_error\",\r\n desc: \"Nonce is not matching, Nonce received: \"\r\n },\r\n loginProgressError: {\r\n code: \"login_progress_error\",\r\n desc: \"Login_In_Progress: Error during login call - login is already in progress.\"\r\n },\r\n acquireTokenProgressError: {\r\n code: \"acquiretoken_progress_error\",\r\n desc: \"AcquireToken_In_Progress: Error during login call - login is already in progress.\"\r\n },\r\n userCancelledError: {\r\n code: \"user_cancelled\",\r\n desc: \"User cancelled the flow.\"\r\n },\r\n callbackError: {\r\n code: \"callback_error\",\r\n desc: \"Error occurred in token received callback function.\"\r\n },\r\n userLoginRequiredError: {\r\n code: \"user_login_error\",\r\n desc: \"User login is required. For silent calls, request must contain either sid or login_hint\"\r\n },\r\n userDoesNotExistError: {\r\n code: \"user_non_existent\",\r\n desc: \"User object does not exist. Please call a login API.\"\r\n },\r\n clientInfoDecodingError: {\r\n code: \"client_info_decoding_error\",\r\n desc: \"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause.\"\r\n },\r\n clientInfoNotPopulatedError: {\r\n code: \"client_info_not_populated_error\",\r\n desc: \"The service did not populate client_info in the response, Please verify with the service team\"\r\n },\r\n nullOrEmptyIdToken: {\r\n code: \"null_or_empty_id_token\",\r\n desc: \"The idToken is null or empty. Please review the trace to determine the root cause.\"\r\n },\r\n idTokenNotParsed: {\r\n code: \"id_token_parsing_error\",\r\n desc: \"ID token cannot be parsed. Please review stack trace to determine root cause.\"\r\n },\r\n tokenEncodingError: {\r\n code: \"token_encoding_error\",\r\n desc: \"The token to be decoded is not encoded correctly.\"\r\n },\r\n invalidInteractionType: {\r\n code: \"invalid_interaction_type\",\r\n desc: \"The interaction type passed to the handler was incorrect or unknown\"\r\n },\r\n cacheParseError: {\r\n code: \"cannot_parse_cache\",\r\n desc: \"The cached token key is not a valid JSON and cannot be parsed\"\r\n },\r\n blockTokenRequestsInHiddenIframe: {\r\n code: \"block_token_requests\",\r\n desc: \"Token calls are blocked in hidden iframes\"\r\n }\r\n};\r\n\r\n/**\r\n * Error thrown when there is an error in the client code running on the browser.\r\n */\r\nexport class ClientAuthError extends AuthError {\r\n\r\n constructor(errorCode: string, errorMessage?: string) {\r\n super(errorCode, errorMessage);\r\n this.name = \"ClientAuthError\";\r\n\r\n Object.setPrototypeOf(this, ClientAuthError.prototype);\r\n }\r\n\r\n static createEndpointResolutionError(errDetail?: string): ClientAuthError {\r\n let errorMessage = ClientAuthErrorMessage.endpointResolutionError.desc;\r\n if (errDetail && !StringUtils.isEmpty(errDetail)) {\r\n errorMessage += ` Details: ${errDetail}`;\r\n }\r\n return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code, errorMessage);\r\n }\r\n\r\n static createPopupWindowError(errDetail?: string): ClientAuthError {\r\n let errorMessage = ClientAuthErrorMessage.popUpWindowError.desc;\r\n if (errDetail && !StringUtils.isEmpty(errDetail)) {\r\n errorMessage += ` Details: ${errDetail}`;\r\n }\r\n return new ClientAuthError(ClientAuthErrorMessage.popUpWindowError.code, errorMessage);\r\n }\r\n\r\n static createTokenRenewalTimeoutError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenRenewalError.code, ClientAuthErrorMessage.tokenRenewalError.desc);\r\n }\r\n\r\n static createInvalidIdTokenError(idToken: IdToken) : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidIdToken.code,\r\n `${ClientAuthErrorMessage.invalidIdToken.desc} Given token: ${idToken}`);\r\n }\r\n\r\n // TODO: Is this not a security flaw to send the user the state expected??\r\n static createInvalidStateError(invalidState: string, actualState: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code,\r\n `${ClientAuthErrorMessage.invalidStateError.desc} ${invalidState}, state expected : ${actualState}.`);\r\n }\r\n\r\n // TODO: Is this not a security flaw to send the user the Nonce expected??\r\n static createNonceMismatchError(invalidNonce: string, actualNonce: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code,\r\n `${ClientAuthErrorMessage.nonceMismatchError.desc} ${invalidNonce}, nonce expected : ${actualNonce}.`);\r\n }\r\n\r\n static createLoginInProgressError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.loginProgressError.code,\r\n ClientAuthErrorMessage.loginProgressError.desc);\r\n }\r\n\r\n static createAcquireTokenInProgressError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.acquireTokenProgressError.code,\r\n ClientAuthErrorMessage.acquireTokenProgressError.desc);\r\n }\r\n\r\n static createUserCancelledError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.userCancelledError.code,\r\n ClientAuthErrorMessage.userCancelledError.desc);\r\n }\r\n\r\n static createErrorInCallbackFunction(errorDesc: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.callbackError.code,\r\n `${ClientAuthErrorMessage.callbackError.desc} ${errorDesc}.`);\r\n }\r\n\r\n static createUserLoginRequiredError() : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.userLoginRequiredError.code,\r\n ClientAuthErrorMessage.userLoginRequiredError.desc);\r\n }\r\n\r\n static createUserDoesNotExistError() : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.userDoesNotExistError.code,\r\n ClientAuthErrorMessage.userDoesNotExistError.desc);\r\n }\r\n\r\n static createClientInfoDecodingError(caughtError: string) : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code,\r\n `${ClientAuthErrorMessage.clientInfoDecodingError.desc} Failed with error: ${caughtError}`);\r\n }\r\n\r\n static createClientInfoNotPopulatedError(caughtError: string) : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoNotPopulatedError.code,\r\n `${ClientAuthErrorMessage.clientInfoNotPopulatedError.desc} Failed with error: ${caughtError}`);\r\n }\r\n\r\n static createIdTokenNullOrEmptyError(invalidRawTokenString: string) : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyIdToken.code,\r\n `${ClientAuthErrorMessage.nullOrEmptyIdToken.desc} Raw ID Token Value: ${invalidRawTokenString}`);\r\n }\r\n\r\n static createIdTokenParsingError(caughtParsingError: string) : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.idTokenNotParsed.code,\r\n `${ClientAuthErrorMessage.idTokenNotParsed.desc} Failed with error: ${caughtParsingError}`);\r\n }\r\n\r\n static createTokenEncodingError(incorrectlyEncodedToken: string) : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenEncodingError.code,\r\n `${ClientAuthErrorMessage.tokenEncodingError.desc} Attempted to decode: ${incorrectlyEncodedToken}`);\r\n }\r\n\r\n static createInvalidInteractionTypeError() : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidInteractionType.code,\r\n ClientAuthErrorMessage.invalidInteractionType.desc);\r\n }\r\n\r\n static createCacheParseError(key: string) : ClientAuthError {\r\n const errorMessage = `invalid key: ${key}, ${ClientAuthErrorMessage.cacheParseError.desc}`;\r\n return new ClientAuthError(ClientAuthErrorMessage.cacheParseError.code,\r\n errorMessage);\r\n }\r\n\r\n static createBlockTokenRequestsInHiddenIframeError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.code,\r\n ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.desc);\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientAuthError } from \"./ClientAuthError\";\r\nimport { TelemetryOptions } from \"../Configuration\";\r\n\r\ninterface IClientConfigurationErrorMessage {\r\n code: string,\r\n desc: string\r\n}\r\n\r\nexport const ClientConfigurationErrorMessage: Record = {\r\n configurationNotSet: {\r\n code: \"no_config_set\",\r\n desc: \"Configuration has not been set. Please call the UserAgentApplication constructor with a valid Configuration object.\"\r\n },\r\n storageNotSupported: {\r\n code: \"storage_not_supported\",\r\n desc: \"The value for the cacheLocation is not supported.\"\r\n },\r\n noRedirectCallbacksSet: {\r\n code: \"no_redirect_callbacks\",\r\n desc: \"No redirect callbacks have been set. Please call handleRedirectCallback() with the appropriate function arguments before continuing. \" +\r\n \"More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics.\"\r\n },\r\n invalidCallbackObject: {\r\n code: \"invalid_callback_object\",\r\n desc: \"The object passed for the callback was invalid. \" +\r\n \"More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics.\"\r\n },\r\n scopesRequired: {\r\n code: \"scopes_required\",\r\n desc: \"Scopes are required to obtain an access token.\"\r\n },\r\n emptyScopes: {\r\n code: \"empty_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as empty array.\"\r\n },\r\n nonArrayScopes: {\r\n code: \"nonarray_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as non-array.\"\r\n },\r\n invalidPrompt: {\r\n code: \"invalid_prompt_value\",\r\n desc: \"Supported prompt values are 'login', 'select_account', 'consent' and 'none'\",\r\n },\r\n invalidAuthorityType: {\r\n code: \"invalid_authority_type\",\r\n desc: \"The given authority is not a valid type of authority supported by MSAL. Please see here for valid authorities: .\"\r\n },\r\n authorityUriInsecure: {\r\n code: \"authority_uri_insecure\",\r\n desc: \"Authority URIs must use https.\"\r\n },\r\n authorityUriInvalidPath: {\r\n code: \"authority_uri_invalid_path\",\r\n desc: \"Given authority URI is invalid.\"\r\n },\r\n unsupportedAuthorityValidation: {\r\n code: \"unsupported_authority_validation\",\r\n desc: \"The authority validation is not supported for this authority type.\"\r\n },\r\n untrustedAuthority: {\r\n code: \"untrusted_authority\",\r\n desc: \"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter or set validateAuthority=false.\"\r\n },\r\n b2cAuthorityUriInvalidPath: {\r\n code: \"b2c_authority_uri_invalid_path\",\r\n desc: \"The given URI for the B2C authority is invalid.\"\r\n },\r\n b2cKnownAuthoritiesNotSet: {\r\n code: \"b2c_known_authorities_not_set\",\r\n desc: \"Must set known authorities when validateAuthority is set to True and using B2C\"\r\n },\r\n claimsRequestParsingError: {\r\n code: \"claims_request_parsing_error\",\r\n desc: \"Could not parse the given claims request object.\"\r\n },\r\n emptyRequestError: {\r\n code: \"empty_request_error\",\r\n desc: \"Request object is required.\"\r\n },\r\n invalidCorrelationIdError: {\r\n code: \"invalid_guid_sent_as_correlationId\",\r\n desc: \"Please set the correlationId as a valid guid\"\r\n },\r\n telemetryConfigError: {\r\n code: \"telemetry_config_error\",\r\n desc: \"Telemetry config is not configured with required values\"\r\n },\r\n ssoSilentError: {\r\n code: \"sso_silent_error\",\r\n desc: \"request must contain either sid or login_hint\"\r\n },\r\n invalidAuthorityMetadataError: {\r\n code: \"authority_metadata_error\",\r\n desc: \"Invalid authorityMetadata. Must be a JSON object containing authorization_endpoint, end_session_endpoint, and issuer fields.\"\r\n }\r\n};\r\n\r\n/**\r\n * Error thrown when there is an error in configuration of the .js library.\r\n */\r\nexport class ClientConfigurationError extends ClientAuthError {\r\n\r\n constructor(errorCode: string, errorMessage?: string) {\r\n super(errorCode, errorMessage);\r\n this.name = \"ClientConfigurationError\";\r\n Object.setPrototypeOf(this, ClientConfigurationError.prototype);\r\n }\r\n\r\n static createNoSetConfigurationError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.configurationNotSet.code,\r\n `${ClientConfigurationErrorMessage.configurationNotSet.desc}`);\r\n }\r\n\r\n static createStorageNotSupportedError(givenCacheLocation: string) : ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.storageNotSupported.code,\r\n `${ClientConfigurationErrorMessage.storageNotSupported.desc} Given location: ${givenCacheLocation}`);\r\n }\r\n\r\n static createRedirectCallbacksNotSetError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.noRedirectCallbacksSet.code, ClientConfigurationErrorMessage.noRedirectCallbacksSet.desc);\r\n }\r\n\r\n static createInvalidCallbackObjectError(callbackObject: object): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCallbackObject.code,\r\n `${ClientConfigurationErrorMessage.invalidCallbackObject.desc} Given value for callback function: ${callbackObject}`);\r\n }\r\n\r\n static createEmptyScopesArrayError(scopesValue: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.emptyScopes.code,\r\n `${ClientConfigurationErrorMessage.emptyScopes.desc} Given value: ${scopesValue}.`);\r\n }\r\n\r\n static createScopesNonArrayError(scopesValue: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.nonArrayScopes.code,\r\n `${ClientConfigurationErrorMessage.nonArrayScopes.desc} Given value: ${scopesValue}.`);\r\n }\r\n\r\n static createScopesRequiredError(scopesValue: string[]): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.scopesRequired.code,\r\n `${ClientConfigurationErrorMessage.scopesRequired.desc} Given value: ${scopesValue}`);\r\n }\r\n\r\n static createInvalidPromptError(promptValue: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidPrompt.code,\r\n `${ClientConfigurationErrorMessage.invalidPrompt.desc} Given value: ${promptValue}`);\r\n }\r\n\r\n static createClaimsRequestParsingError(claimsRequestParseError: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.claimsRequestParsingError.code,\r\n `${ClientConfigurationErrorMessage.claimsRequestParsingError.desc} Given value: ${claimsRequestParseError}`);\r\n }\r\n\r\n static createEmptyRequestError(): ClientConfigurationError {\r\n const { code, desc } = ClientConfigurationErrorMessage.emptyRequestError;\r\n return new ClientConfigurationError(code, desc);\r\n }\r\n\r\n static createInvalidCorrelationIdError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCorrelationIdError.code,\r\n ClientConfigurationErrorMessage.invalidCorrelationIdError.desc);\r\n }\r\n\r\n static createKnownAuthoritiesNotSetError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.code,\r\n ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.desc);\r\n }\r\n\r\n static createInvalidAuthorityTypeError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityType.code,\r\n ClientConfigurationErrorMessage.invalidAuthorityType.desc);\r\n }\r\n\r\n static createUntrustedAuthorityError(host: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code,\r\n `${ClientConfigurationErrorMessage.untrustedAuthority.desc} Provided Authority: ${host}`);\r\n }\r\n\r\n static createTelemetryConfigError(config: TelemetryOptions): ClientConfigurationError {\r\n const { code, desc } = ClientConfigurationErrorMessage.telemetryConfigError;\r\n const requiredKeys = {\r\n applicationName: \"string\",\r\n applicationVersion: \"string\",\r\n telemetryEmitter: \"function\"\r\n };\r\n\r\n const missingKeys = Object.keys(requiredKeys)\r\n .reduce((keys, key) => {\r\n return config[key] ? keys : keys.concat([ `${key} (${requiredKeys[key]})` ]);\r\n }, []);\r\n\r\n return new ClientConfigurationError(code, `${desc} mising values: ${missingKeys.join(\",\")}`);\r\n }\r\n\r\n static createSsoSilentError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.ssoSilentError.code,\r\n ClientConfigurationErrorMessage.ssoSilentError.desc);\r\n }\r\n\r\n static createInvalidAuthorityMetadataError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityMetadataError.code, ClientConfigurationErrorMessage.invalidAuthorityMetadataError.desc);\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ServerError } from \"./ServerError\";\r\n\r\nexport const InteractionRequiredAuthErrorMessage = {\r\n interactionRequired: {\r\n code: \"interaction_required\"\r\n },\r\n consentRequired: {\r\n code: \"consent_required\"\r\n },\r\n loginRequired: {\r\n code: \"login_required\"\r\n },\r\n};\r\n\r\n/**\r\n * Error thrown when the user is required to perform an interactive token request.\r\n */\r\nexport class InteractionRequiredAuthError extends ServerError {\r\n\r\n constructor(errorCode: string, errorMessage?: string) {\r\n super(errorCode, errorMessage);\r\n this.name = \"InteractionRequiredAuthError\";\r\n\r\n Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);\r\n }\r\n\r\n static isInteractionRequiredError(errorString: string) : boolean {\r\n const interactionRequiredCodes = [\r\n InteractionRequiredAuthErrorMessage.interactionRequired.code,\r\n InteractionRequiredAuthErrorMessage.consentRequired.code,\r\n InteractionRequiredAuthErrorMessage.loginRequired.code\r\n ];\r\n\r\n return errorString && interactionRequiredCodes.indexOf(errorString) > -1;\r\n }\r\n\r\n static createLoginRequiredAuthError(errorDesc: string): InteractionRequiredAuthError {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.loginRequired.code, errorDesc);\r\n }\r\n\r\n static createInteractionRequiredAuthError(errorDesc: string): InteractionRequiredAuthError {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.interactionRequired.code, errorDesc);\r\n }\r\n\r\n static createConsentRequiredAuthError(errorDesc: string): InteractionRequiredAuthError {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.consentRequired.code, errorDesc);\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthError } from \"./AuthError\";\r\n\r\nexport const ServerErrorMessage = {\r\n serverUnavailable: {\r\n code: \"server_unavailable\",\r\n desc: \"Server is temporarily unavailable.\"\r\n },\r\n unknownServerError: {\r\n code: \"unknown_server_error\"\r\n },\r\n};\r\n\r\n/**\r\n * Error thrown when there is an error with the server code, for example, unavailability.\r\n */\r\nexport class ServerError extends AuthError {\r\n\r\n constructor(errorCode: string, errorMessage?: string) {\r\n super(errorCode, errorMessage);\r\n this.name = \"ServerError\";\r\n\r\n Object.setPrototypeOf(this, ServerError.prototype);\r\n }\r\n\r\n static createServerUnavailableError(): ServerError {\r\n return new ServerError(ServerErrorMessage.serverUnavailable.code,\r\n ServerErrorMessage.serverUnavailable.desc);\r\n }\r\n\r\n static createUnknownServerError(errorDesc: string): ServerError {\r\n return new ServerError(ServerErrorMessage.unknownServerError.code,\r\n errorDesc);\r\n }\r\n}\r\n","/* eslint-disable header/header */\r\nexport const name = \"msal\";\r\nexport const version = \"1.4.18\";\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport TelemetryEvent from \"./TelemetryEvent\";\r\nimport { TELEMETRY_BLOB_EVENT_NAMES } from \"./TelemetryConstants\";\r\nimport { scrubTenantFromUri, hashPersonalIdentifier, prependEventNamePrefix } from \"./TelemetryUtils\";\r\n\r\nexport const EVENT_KEYS = {\r\n AUTHORITY: prependEventNamePrefix(\"authority\"),\r\n AUTHORITY_TYPE: prependEventNamePrefix(\"authority_type\"),\r\n PROMPT: prependEventNamePrefix(\"ui_behavior\"),\r\n TENANT_ID: prependEventNamePrefix(\"tenant_id\"),\r\n USER_ID: prependEventNamePrefix(\"user_id\"),\r\n WAS_SUCESSFUL: prependEventNamePrefix(\"was_successful\"),\r\n API_ERROR_CODE: prependEventNamePrefix(\"api_error_code\"),\r\n LOGIN_HINT: prependEventNamePrefix(\"login_hint\")\r\n};\r\n\r\nexport enum API_CODE {\r\n AcquireTokenRedirect = 2001,\r\n AcquireTokenSilent = 2002,\r\n AcquireTokenPopup = 2003,\r\n LoginRedirect = 2004,\r\n LoginPopup = 2005,\r\n Logout = 2006\r\n}\r\n\r\nexport enum API_EVENT_IDENTIFIER {\r\n AcquireTokenRedirect = \"AcquireTokenRedirect\",\r\n AcquireTokenSilent = \"AcquireTokenSilent\",\r\n AcquireTokenPopup = \"AcquireTokenPopup\",\r\n LoginRedirect = \"LoginRedirect\",\r\n LoginPopup = \"LoginPopup\",\r\n Logout = \"Logout\"\r\n}\r\n\r\nconst mapEventIdentiferToCode = {\r\n [API_EVENT_IDENTIFIER.AcquireTokenSilent]: API_CODE.AcquireTokenSilent,\r\n [API_EVENT_IDENTIFIER.AcquireTokenPopup]: API_CODE.AcquireTokenPopup,\r\n [API_EVENT_IDENTIFIER.AcquireTokenRedirect]: API_CODE.AcquireTokenRedirect,\r\n [API_EVENT_IDENTIFIER.LoginPopup]: API_CODE.LoginPopup,\r\n [API_EVENT_IDENTIFIER.LoginRedirect]: API_CODE.LoginRedirect,\r\n [API_EVENT_IDENTIFIER.Logout]: API_CODE.Logout\r\n};\r\n\r\nexport default class ApiEvent extends TelemetryEvent {\r\n\r\n private piiEnabled: boolean;\r\n\r\n constructor(correlationId: string, piiEnabled: boolean, apiEventIdentifier?: API_EVENT_IDENTIFIER) {\r\n super(prependEventNamePrefix(\"api_event\"), correlationId, apiEventIdentifier);\r\n if (apiEventIdentifier) {\r\n this.apiCode = mapEventIdentiferToCode[apiEventIdentifier];\r\n this.apiEventIdentifier = apiEventIdentifier;\r\n }\r\n this.piiEnabled = piiEnabled;\r\n }\r\n\r\n public set apiEventIdentifier(apiEventIdentifier: string) {\r\n this.event[TELEMETRY_BLOB_EVENT_NAMES.ApiTelemIdConstStrKey] = apiEventIdentifier;\r\n }\r\n\r\n public set apiCode(apiCode: number) {\r\n this.event[TELEMETRY_BLOB_EVENT_NAMES.ApiIdConstStrKey] = apiCode;\r\n }\r\n\r\n public set authority(uri: string) {\r\n this.event[EVENT_KEYS.AUTHORITY] = scrubTenantFromUri(uri).toLowerCase();\r\n }\r\n\r\n public set apiErrorCode(errorCode: string) {\r\n this.event[EVENT_KEYS.API_ERROR_CODE] = errorCode;\r\n }\r\n\r\n public set tenantId(tenantId: string) {\r\n this.event[EVENT_KEYS.TENANT_ID] = this.piiEnabled && tenantId ?\r\n hashPersonalIdentifier(tenantId)\r\n : null;\r\n }\r\n\r\n public set accountId(accountId: string) {\r\n this.event[EVENT_KEYS.USER_ID] = this.piiEnabled && accountId ?\r\n hashPersonalIdentifier(accountId)\r\n : null;\r\n }\r\n\r\n public set wasSuccessful(wasSuccessful: boolean) {\r\n this.event[EVENT_KEYS.WAS_SUCESSFUL] = wasSuccessful;\r\n }\r\n\r\n public get wasSuccessful(): boolean {\r\n return this.event[EVENT_KEYS.WAS_SUCESSFUL] === true;\r\n }\r\n\r\n public set loginHint(loginHint: string) {\r\n this.event[EVENT_KEYS.LOGIN_HINT] = this.piiEnabled && loginHint ?\r\n hashPersonalIdentifier(loginHint)\r\n : null;\r\n }\r\n\r\n public set authorityType(authorityType: string) {\r\n this.event[EVENT_KEYS.AUTHORITY_TYPE] = authorityType.toLowerCase();\r\n }\r\n\r\n public set promptType(promptType: string) {\r\n this.event[EVENT_KEYS.PROMPT] = promptType.toLowerCase();\r\n }\r\n\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { TELEMETRY_BLOB_EVENT_NAMES } from \"./TelemetryConstants\";\r\nimport TelemetryEvent from \"./TelemetryEvent\";\r\nimport { EventCount, TelemetryPlatform } from \"./TelemetryTypes\";\r\nimport { prependEventNamePrefix } from \"./TelemetryUtils\";\r\n\r\nexport default class DefaultEvent extends TelemetryEvent {\r\n // TODO Platform Type\r\n constructor(platform: TelemetryPlatform, correlationId: string, clientId: string, eventCount: EventCount) {\r\n super(prependEventNamePrefix(\"default_event\"), correlationId, \"DefaultEvent\");\r\n this.event[prependEventNamePrefix(\"client_id\")] = clientId;\r\n this.event[prependEventNamePrefix(\"sdk_plaform\")] = platform.sdk;\r\n this.event[prependEventNamePrefix(\"sdk_version\")] = platform.sdkVersion;\r\n this.event[prependEventNamePrefix(\"application_name\")] = platform.applicationName;\r\n this.event[prependEventNamePrefix(\"application_version\")] = platform.applicationVersion;\r\n this.event[prependEventNamePrefix(\"effective_connection_speed\")] = platform.networkInformation && platform.networkInformation.connectionSpeed;\r\n this.event[`${TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey}`] = this.getEventCount(prependEventNamePrefix(\"ui_event\"), eventCount);\r\n this.event[`${TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey}`] = this.getEventCount(prependEventNamePrefix(\"http_event\"), eventCount);\r\n this.event[`${TELEMETRY_BLOB_EVENT_NAMES.CacheEventCountConstStrKey}`] = this.getEventCount(prependEventNamePrefix(\"cache_event\"), eventCount);\r\n // / Device id?\r\n }\r\n\r\n private getEventCount(eventName: string, eventCount: EventCount): number {\r\n if (!eventCount[eventName]) {\r\n return 0;\r\n }\r\n return eventCount[eventName];\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport TelemetryEvent from \"./TelemetryEvent\";\r\nimport { scrubTenantFromUri, prependEventNamePrefix } from \"./TelemetryUtils\";\r\nimport { ServerRequestParameters } from \"../ServerRequestParameters\";\r\nimport { StringDict } from \"../MsalTypes\";\r\n\r\nexport const EVENT_KEYS = {\r\n HTTP_PATH: prependEventNamePrefix(\"http_path\"),\r\n USER_AGENT: prependEventNamePrefix(\"user_agent\"),\r\n QUERY_PARAMETERS: prependEventNamePrefix(\"query_parameters\"),\r\n API_VERSION: prependEventNamePrefix(\"api_version\"),\r\n RESPONSE_CODE: prependEventNamePrefix(\"response_code\"),\r\n O_AUTH_ERROR_CODE: prependEventNamePrefix(\"oauth_error_code\"),\r\n HTTP_METHOD: prependEventNamePrefix(\"http_method\"),\r\n REQUEST_ID_HEADER: prependEventNamePrefix(\"request_id_header\"),\r\n SPE_INFO: prependEventNamePrefix(\"spe_info\"),\r\n SERVER_ERROR_CODE: prependEventNamePrefix(\"server_error_code\"),\r\n SERVER_SUB_ERROR_CODE: prependEventNamePrefix(\"server_sub_error_code\"),\r\n URL: prependEventNamePrefix(\"url\")\r\n};\r\n\r\nexport default class HttpEvent extends TelemetryEvent {\r\n\r\n constructor(correlationId: string, eventLabel: string) {\r\n super(prependEventNamePrefix(\"http_event\"), correlationId, eventLabel);\r\n }\r\n\r\n public set url(url: string) {\r\n const scrubbedUri = scrubTenantFromUri(url);\r\n this.event[EVENT_KEYS.URL] = scrubbedUri && scrubbedUri.toLowerCase();\r\n }\r\n\r\n public set httpPath(httpPath: string) {\r\n this.event[EVENT_KEYS.HTTP_PATH] = scrubTenantFromUri(httpPath).toLowerCase();\r\n }\r\n\r\n public set userAgent(userAgent: string) {\r\n this.event[EVENT_KEYS.USER_AGENT] = userAgent;\r\n }\r\n\r\n public set queryParams(queryParams: StringDict) {\r\n this.event[EVENT_KEYS.QUERY_PARAMETERS] = ServerRequestParameters.generateQueryParametersString(queryParams);\r\n }\r\n\r\n public set apiVersion(apiVersion: string) {\r\n this.event[EVENT_KEYS.API_VERSION] = apiVersion.toLowerCase();\r\n }\r\n\r\n public set httpResponseStatus(statusCode: number) {\r\n this.event[EVENT_KEYS.RESPONSE_CODE] = statusCode;\r\n }\r\n\r\n public set oAuthErrorCode(errorCode: string) {\r\n this.event[EVENT_KEYS.O_AUTH_ERROR_CODE] = errorCode;\r\n }\r\n\r\n public set httpMethod(httpMethod: string) {\r\n this.event[EVENT_KEYS.HTTP_METHOD] = httpMethod;\r\n }\r\n\r\n public set requestIdHeader(requestIdHeader: string) {\r\n this.event[EVENT_KEYS.REQUEST_ID_HEADER] = requestIdHeader;\r\n }\r\n\r\n /**\r\n * Indicates whether the request was executed on a ring serving SPE traffic.\r\n * An empty string indicates this occurred on an outer ring, and the string \"I\"\r\n * indicates the request occurred on the inner ring\r\n */\r\n public set speInfo(speInfo: string) {\r\n this.event[EVENT_KEYS.SPE_INFO] = speInfo;\r\n }\r\n\r\n public set serverErrorCode(errorCode: string) {\r\n this.event[EVENT_KEYS.SERVER_ERROR_CODE] = errorCode;\r\n }\r\n\r\n public set serverSubErrorCode(subErrorCode: string) {\r\n this.event[EVENT_KEYS.SERVER_SUB_ERROR_CODE] = subErrorCode;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport const EVENT_NAME_PREFIX = \"msal.\";\r\nexport const EVENT_NAME_KEY = \"event_name\";\r\nexport const START_TIME_KEY = \"start_time\";\r\nexport const ELAPSED_TIME_KEY = \"elapsed_time\";\r\n\r\nexport const TELEMETRY_BLOB_EVENT_NAMES = {\r\n MsalCorrelationIdConstStrKey: \"Microsoft.MSAL.correlation_id\",\r\n ApiTelemIdConstStrKey: \"msal.api_telem_id\",\r\n ApiIdConstStrKey: \"msal.api_id\",\r\n BrokerAppConstStrKey: \"Microsoft_MSAL_broker_app\",\r\n CacheEventCountConstStrKey: \"Microsoft_MSAL_cache_event_count\",\r\n HttpEventCountTelemetryBatchKey: \"Microsoft_MSAL_http_event_count\",\r\n IdpConstStrKey: \"Microsoft_MSAL_idp\",\r\n IsSilentTelemetryBatchKey: \"\",\r\n IsSuccessfulConstStrKey: \"Microsoft_MSAL_is_successful\",\r\n ResponseTimeConstStrKey: \"Microsoft_MSAL_response_time\",\r\n TenantIdConstStrKey: \"Microsoft_MSAL_tenant_id\",\r\n UiEventCountTelemetryBatchKey: \"Microsoft_MSAL_ui_event_count\"\r\n};\r\n\r\n// This is used to replace the real tenant in telemetry info\r\nexport const TENANT_PLACEHOLDER = \"\";\r\n\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport {\r\n TELEMETRY_BLOB_EVENT_NAMES,\r\n EVENT_NAME_KEY,\r\n START_TIME_KEY,\r\n ELAPSED_TIME_KEY\r\n} from \"./TelemetryConstants\";\r\nimport { prependEventNamePrefix, startBrowserPerformanceMeasurement, endBrowserPerformanceMeasurement } from \"./TelemetryUtils\";\r\nimport { CryptoUtils } from \"../utils/CryptoUtils\";\r\n\r\nexport default class TelemetryEvent {\r\n\r\n private startTimestamp: number;\r\n // eslint-disable-next-line\r\n protected event: any; // TODO TYPE THIS\r\n public eventId: string;\r\n private label: string;\r\n\r\n constructor(eventName: string, correlationId: string, eventLabel: string) {\r\n this.eventId = CryptoUtils.createNewGuid();\r\n this.label = eventLabel;\r\n this.event = {\r\n [prependEventNamePrefix(EVENT_NAME_KEY)]: eventName,\r\n [prependEventNamePrefix(ELAPSED_TIME_KEY)]: -1,\r\n [`${TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey}`]: correlationId\r\n };\r\n }\r\n\r\n private setElapsedTime(time: Number): void {\r\n this.event[prependEventNamePrefix(ELAPSED_TIME_KEY)] = time;\r\n }\r\n\r\n public stop(): void {\r\n // Set duration of event\r\n this.setElapsedTime(+Date.now() - +this.startTimestamp);\r\n\r\n endBrowserPerformanceMeasurement(this.displayName, this.perfStartMark, this.perfEndMark);\r\n }\r\n\r\n public start(): void {\r\n this.startTimestamp = Date.now();\r\n this.event[prependEventNamePrefix(START_TIME_KEY)] = this.startTimestamp;\r\n\r\n startBrowserPerformanceMeasurement(this.perfStartMark);\r\n }\r\n\r\n public get telemetryCorrelationId(): string {\r\n return this.event[`${TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey}`];\r\n }\r\n\r\n public set telemetryCorrelationId(value: string) {\r\n this.event[`${TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey}`] = value;\r\n }\r\n\r\n public get eventName(): string {\r\n return this.event[prependEventNamePrefix(EVENT_NAME_KEY)];\r\n }\r\n\r\n public get(): object {\r\n return {\r\n ...this.event,\r\n eventId: this.eventId\r\n };\r\n }\r\n\r\n public get key(): string {\r\n return `${this.telemetryCorrelationId}_${this.eventId}-${this.eventName}`;\r\n }\r\n\r\n public get displayName(): string {\r\n return `Msal-${this.label}-${this.telemetryCorrelationId}`;\r\n }\r\n\r\n private get perfStartMark() {\r\n return `start-${this.key}`;\r\n }\r\n\r\n private get perfEndMark() {\r\n return `end-${this.key}`;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport TelemetryEvent from \"./TelemetryEvent\";\r\nimport {\r\n CompletedEvents,\r\n EventCount,\r\n EventCountByCorrelationId,\r\n InProgressEvents,\r\n TelemetryConfig,\r\n TelemetryPlatform,\r\n TelemetryEmitter\r\n} from \"./TelemetryTypes\";\r\nimport DefaultEvent from \"./DefaultEvent\";\r\nimport { Constants } from \"../utils/Constants\";\r\nimport ApiEvent, { API_EVENT_IDENTIFIER } from \"./ApiEvent\";\r\nimport { Logger } from \"../Logger\";\r\nimport HttpEvent from \"./HttpEvent\";\r\nimport { version as libraryVersion } from \"../packageMetadata\";\r\n\r\nexport default class TelemetryManager {\r\n\r\n // correlation Id to list of events\r\n private completedEvents: CompletedEvents = {};\r\n // event key to event\r\n private inProgressEvents: InProgressEvents = {};\r\n // correlation id to map of eventname to count\r\n private eventCountByCorrelationId: EventCountByCorrelationId = {};\r\n\r\n // Implement after API EVENT\r\n private onlySendFailureTelemetry: boolean = false;\r\n private telemetryPlatform: TelemetryPlatform;\r\n private clientId: string;\r\n private telemetryEmitter: TelemetryEmitter;\r\n private logger: Logger;\r\n\r\n constructor(config: TelemetryConfig, telemetryEmitter: TelemetryEmitter, logger: Logger) {\r\n // TODO THROW if bad options\r\n this.telemetryPlatform = {\r\n sdk: Constants.libraryName,\r\n sdkVersion: libraryVersion,\r\n networkInformation: {\r\n // @ts-ignore\r\n connectionSpeed: typeof navigator !== \"undefined\" && navigator.connection && navigator.connection.effectiveType\r\n },\r\n ...config.platform\r\n };\r\n this.clientId = config.clientId;\r\n this.onlySendFailureTelemetry = config.onlySendFailureTelemetry;\r\n /*\r\n * TODO, when i get to wiring this through, think about what it means if\r\n * a developer does not implement telem at all, we still instrument, but telemetryEmitter can be\r\n * optional?\r\n */\r\n this.telemetryEmitter = telemetryEmitter;\r\n this.logger = logger;\r\n }\r\n\r\n static getTelemetrymanagerStub(clientId: string, logger: Logger) : TelemetryManager {\r\n const applicationName = \"UnSetStub\";\r\n const applicationVersion = \"0.0\";\r\n const telemetryEmitter = () => {};\r\n const telemetryPlatform: TelemetryPlatform = {\r\n applicationName,\r\n applicationVersion\r\n };\r\n const telemetryManagerConfig: TelemetryConfig = {\r\n platform: telemetryPlatform,\r\n clientId: clientId\r\n };\r\n\r\n return new this(telemetryManagerConfig, telemetryEmitter, logger);\r\n }\r\n\r\n startEvent(event: TelemetryEvent): void {\r\n this.logger.verbose(`Telemetry Event started: ${event.key}`);\r\n\r\n if (!this.telemetryEmitter) {\r\n return;\r\n }\r\n\r\n event.start();\r\n this.inProgressEvents[event.key] = event;\r\n }\r\n\r\n stopEvent(event: TelemetryEvent): void {\r\n this.logger.verbose(`Telemetry Event stopped: ${event.key}`);\r\n\r\n if (!this.telemetryEmitter || !this.inProgressEvents[event.key]) {\r\n return;\r\n }\r\n event.stop();\r\n this.incrementEventCount(event);\r\n\r\n const completedEvents = this.completedEvents[event.telemetryCorrelationId];\r\n\r\n this.completedEvents[event.telemetryCorrelationId] = [...(completedEvents || []), event];\r\n\r\n delete this.inProgressEvents[event.key];\r\n }\r\n\r\n flush(correlationId: string): void {\r\n this.logger.verbose(`Flushing telemetry events: ${correlationId}`);\r\n\r\n // If there is only unfinished events should this still return them?\r\n if (!this.telemetryEmitter || !this.completedEvents[correlationId]) {\r\n return;\r\n }\r\n\r\n const orphanedEvents = this.getOrphanedEvents(correlationId);\r\n orphanedEvents.forEach(event => this.incrementEventCount(event));\r\n const eventsToFlush: Array = [\r\n ...this.completedEvents[correlationId],\r\n ...orphanedEvents\r\n ];\r\n\r\n delete this.completedEvents[correlationId];\r\n const eventCountsToFlush: EventCount = this.eventCountByCorrelationId[correlationId];\r\n\r\n delete this.eventCountByCorrelationId[correlationId];\r\n // TODO add funcitonality for onlyFlushFailures after implementing api event? ??\r\n\r\n if (!eventsToFlush || !eventsToFlush.length) {\r\n return;\r\n }\r\n\r\n const defaultEvent: DefaultEvent = new DefaultEvent(\r\n this.telemetryPlatform,\r\n correlationId,\r\n this.clientId,\r\n eventCountsToFlush\r\n );\r\n\r\n const eventsWithDefaultEvent = [ ...eventsToFlush, defaultEvent ];\r\n\r\n this.telemetryEmitter(eventsWithDefaultEvent.map(e => e.get()));\r\n }\r\n\r\n createAndStartApiEvent(correlationId: string, apiEventIdentifier: API_EVENT_IDENTIFIER): ApiEvent {\r\n const apiEvent = new ApiEvent(correlationId, this.logger.isPiiLoggingEnabled(), apiEventIdentifier);\r\n this.startEvent(apiEvent);\r\n return apiEvent;\r\n }\r\n\r\n stopAndFlushApiEvent(correlationId: string, apiEvent: ApiEvent, wasSuccessful: boolean, errorCode?: string): void {\r\n apiEvent.wasSuccessful = wasSuccessful;\r\n if (errorCode) {\r\n apiEvent.apiErrorCode = errorCode;\r\n }\r\n this.stopEvent(apiEvent);\r\n this.flush(correlationId);\r\n }\r\n\r\n createAndStartHttpEvent(correlation: string, httpMethod: string, url: string, eventLabel: string): HttpEvent {\r\n const httpEvent = new HttpEvent(correlation, eventLabel);\r\n httpEvent.url = url;\r\n httpEvent.httpMethod = httpMethod;\r\n this.startEvent(httpEvent);\r\n return httpEvent;\r\n }\r\n\r\n private incrementEventCount(event: TelemetryEvent): void {\r\n /*\r\n * TODO, name cache event different?\r\n * if type is cache event, change name\r\n */\r\n const eventName = event.eventName;\r\n const eventCount = this.eventCountByCorrelationId[event.telemetryCorrelationId];\r\n if (!eventCount) {\r\n this.eventCountByCorrelationId[event.telemetryCorrelationId] = {\r\n [eventName]: 1\r\n };\r\n } else {\r\n eventCount[eventName] = eventCount[eventName] ? eventCount[eventName] + 1 : 1;\r\n }\r\n }\r\n\r\n private getOrphanedEvents(correlationId: string): Array {\r\n return Object.keys(this.inProgressEvents)\r\n .reduce((memo, eventKey) => {\r\n if (eventKey.indexOf(correlationId) !== -1) {\r\n const event = this.inProgressEvents[eventKey];\r\n delete this.inProgressEvents[eventKey];\r\n return [...memo, event];\r\n }\r\n return memo;\r\n }, []);\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { TENANT_PLACEHOLDER, EVENT_NAME_PREFIX } from \"./TelemetryConstants\";\r\nimport { CryptoUtils } from \"../utils/CryptoUtils\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\r\nimport { Authority } from \"../authority/Authority\";\r\n\r\nexport const scrubTenantFromUri = (uri: string): String => {\r\n\r\n const url = UrlUtils.GetUrlComponents(uri);\r\n\r\n // validate trusted host\r\n if (Authority.isAdfs(uri)) {\r\n /**\r\n * returning what was passed because the library needs to work with uris that are non\r\n * AAD trusted but passed by users such as B2C or others.\r\n * HTTP Events for instance can take a url to the open id config endpoint\r\n */\r\n return uri;\r\n }\r\n\r\n const pathParams = url.PathSegments;\r\n\r\n if (pathParams && pathParams.length >= 2) {\r\n const tenantPosition = pathParams[1] === \"tfp\" ? 2 : 1;\r\n if (tenantPosition < pathParams.length) {\r\n pathParams[tenantPosition] = TENANT_PLACEHOLDER;\r\n }\r\n }\r\n\r\n return `${url.Protocol}//${url.HostNameAndPort}/${pathParams.join(\"/\")}`;\r\n};\r\n\r\nexport const hashPersonalIdentifier = (valueToHash: string): string => {\r\n /*\r\n * TODO sha256 this\r\n * Current test runner is being funny with node libs that are webpacked anyway\r\n * need a different solution\r\n */\r\n return CryptoUtils.base64Encode(valueToHash);\r\n};\r\n\r\nexport const prependEventNamePrefix = (suffix: string): string => `${EVENT_NAME_PREFIX}${suffix || \"\"}`;\r\n\r\nexport const supportsBrowserPerformance = (): boolean => !!(\r\n typeof window !== \"undefined\" &&\r\n \"performance\" in window &&\r\n window.performance.mark && \r\n window.performance.measure\r\n);\r\n\r\nexport const endBrowserPerformanceMeasurement = (measureName: string, startMark: string, endMark: string): void => {\r\n if (supportsBrowserPerformance()) {\r\n window.performance.mark(endMark);\r\n window.performance.measure(measureName, startMark, endMark);\r\n\r\n window.performance.clearMeasures(measureName);\r\n window.performance.clearMarks(startMark);\r\n window.performance.clearMarks(endMark);\r\n }\r\n};\r\n\r\nexport const startBrowserPerformanceMeasurement = (startMark: string): void => {\r\n if (supportsBrowserPerformance()) {\r\n window.performance.mark(startMark);\r\n }\r\n};\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AccessTokenCacheItem } from \"../cache/AccessTokenCacheItem\";\r\nimport { ScopeSet } from \"../ScopeSet\";\r\nimport { UrlUtils } from \"./UrlUtils\"; \r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class AuthCacheUtils {\r\n static filterTokenCacheItemsByScope(tokenCacheItems: Array, requestScopes: string []): Array {\r\n return tokenCacheItems.filter((cacheItem: AccessTokenCacheItem) => {\r\n const cachedScopes = cacheItem.key.scopes.split(\" \");\r\n const searchScopes = ScopeSet.removeDefaultScopes(requestScopes);\r\n\r\n // If requestScopes contain only default scopes search for default scopes otherwise search for everything but default scopes\r\n return searchScopes.length === 0 ? ScopeSet.containsScope(cachedScopes, requestScopes): ScopeSet.containsScope(cachedScopes, searchScopes);\r\n });\r\n\r\n }\r\n\r\n static filterTokenCacheItemsByAuthority(tokenCacheItems: Array, authority: string): Array {\r\n return tokenCacheItems.filter((cacheItem: AccessTokenCacheItem) => UrlUtils.CanonicalizeUri(cacheItem.key.authority) === authority);\r\n }\r\n\r\n static filterTokenCacheItemsByDomain(tokenCacheItems: Array, requestDomain: string): Array {\r\n return tokenCacheItems.filter(cacheItem => {\r\n const cacheItemDomain = UrlUtils.GetUrlComponents(cacheItem.key.authority).HostNameAndPort;\r\n return cacheItemDomain === requestDomain;\r\n });\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\n/**\r\n * @hidden\r\n * Constants\r\n */\r\nexport class Constants {\r\n static get libraryName(): string { return \"Msal.js\"; } // used in telemetry sdkName\r\n static get claims(): string { return \"claims\"; }\r\n static get clientId(): string { return \"clientId\"; }\r\n\r\n static get adalIdToken(): string { return \"adal.idtoken\"; }\r\n static get cachePrefix(): string { return \"msal\"; }\r\n static get scopes(): string { return \"scopes\"; }\r\n\r\n static get no_account(): string { return \"NO_ACCOUNT\"; }\r\n static get upn(): string { return \"upn\"; }\r\n static get domain_hint(): string { return \"domain_hint\"; }\r\n\r\n static get prompt_select_account(): string { return \"&prompt=select_account\"; }\r\n static get prompt_none(): string { return \"&prompt=none\"; }\r\n static get prompt(): string { return \"prompt\"; }\r\n\r\n static get response_mode_fragment(): string { return \"&response_mode=fragment\"; }\r\n static get resourceDelimiter(): string { return \"|\"; }\r\n static get cacheDelimiter(): string { return \".\"; }\r\n\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\r\n static get login(): string { return \"LOGIN\"; }\r\n static get renewToken(): string { return \"RENEW_TOKEN\"; }\r\n static get unknown(): string { return \"UNKNOWN\"; }\r\n\r\n static get ADFS(): string { return \"adfs\"; }\r\n\r\n static get homeAccountIdentifier(): string { return \"homeAccountIdentifier\"; }\r\n\r\n static get common(): string { return \"common\"; }\r\n static get openidScope(): string { return \"openid\"; }\r\n static get profileScope(): string { return \"profile\"; }\r\n static get oidcScopes(): Array { return [this.openidScope, this.profileScope] ;}\r\n\r\n static get interactionTypeRedirect(): InteractionType { return \"redirectInteraction\"; }\r\n static get interactionTypePopup(): InteractionType { return \"popupInteraction\"; }\r\n static get interactionTypeSilent(): InteractionType { return \"silentInteraction\"; }\r\n static get inProgress(): string { return \"inProgress\"; }\r\n}\r\n\r\nexport const SESSION_STORAGE = \"sessionStorage\";\r\n\r\n/**\r\n * Keys in the hashParams\r\n */\r\nexport enum ServerHashParamKeys {\r\n SCOPE = \"scope\",\r\n STATE = \"state\",\r\n ERROR = \"error\",\r\n ERROR_DESCRIPTION = \"error_description\",\r\n ACCESS_TOKEN = \"access_token\",\r\n ID_TOKEN = \"id_token\",\r\n EXPIRES_IN = \"expires_in\",\r\n SESSION_STATE = \"session_state\",\r\n CLIENT_INFO = \"client_info\"\r\n}\r\n\r\n/**\r\n * @hidden\r\n * @ignore\r\n * response_type from OpenIDConnect\r\n * References: https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html & https://tools.ietf.org/html/rfc6749#section-4.2.1\r\n *\r\n */\r\nexport const 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 * CacheKeys for MSAL\r\n */\r\nexport enum TemporaryCacheKeys {\r\n AUTHORITY = \"authority\",\r\n ACQUIRE_TOKEN_ACCOUNT = \"acquireTokenAccount\",\r\n SESSION_STATE = \"session.state\",\r\n STATE_LOGIN = \"state.login\",\r\n STATE_ACQ_TOKEN = \"state.acquireToken\",\r\n STATE_RENEW = \"state.renew\",\r\n NONCE_IDTOKEN = \"nonce.idtoken\",\r\n LOGIN_REQUEST = \"login.request\",\r\n RENEW_STATUS = \"token.renew.status\",\r\n URL_HASH = \"urlHash\",\r\n INTERACTION_STATUS = \"interaction.status\",\r\n REDIRECT_REQUEST = \"redirect_request\"\r\n}\r\n\r\nexport enum PersistentCacheKeys {\r\n IDTOKEN = \"idtoken\",\r\n CLIENT_INFO = \"client.info\"\r\n}\r\n\r\nexport enum ErrorCacheKeys {\r\n LOGIN_ERROR = \"login.error\",\r\n ERROR = \"error\",\r\n ERROR_DESC = \"error.description\"\r\n}\r\n\r\nexport const DEFAULT_AUTHORITY: string = \"https://login.microsoftonline.com/common/\";\r\nexport const AAD_INSTANCE_DISCOVERY_ENDPOINT: string = `${DEFAULT_AUTHORITY}/discovery/instance?api-version=1.1&authorization_endpoint=`;\r\nexport const WELL_KNOWN_SUFFIX: string = \".well-known/openid-configuration\";\r\n\r\n/**\r\n * @hidden\r\n * SSO Types - generated to populate hints\r\n */\r\nexport enum SSOTypes {\r\n ACCOUNT = \"account\",\r\n SID = \"sid\",\r\n LOGIN_HINT = \"login_hint\",\r\n ORGANIZATIONS = \"organizations\",\r\n CONSUMERS = \"consumers\",\r\n ID_TOKEN =\"id_token\",\r\n ACCOUNT_ID = \"accountIdentifier\",\r\n HOMEACCOUNT_ID = \"homeAccountIdentifier\"\r\n}\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport const DisallowedEQParams = [\r\n SSOTypes.SID,\r\n SSOTypes.LOGIN_HINT\r\n];\r\n\r\nexport type InteractionType = \"redirectInteraction\" | \"popupInteraction\" | \"silentInteraction\";\r\n\r\nexport const NetworkRequestType = {\r\n GET: \"GET\",\r\n POST: \"POST\"\r\n};\r\n\r\n/**\r\n * we considered making this \"enum\" in the request instead of string, however it looks like the allowed list of\r\n * prompt values kept changing over past couple of years. There are some undocumented prompt values for some\r\n * internal partners too, hence the choice of generic \"string\" type instead of the \"enum\"\r\n * @hidden\r\n */\r\nexport const PromptState = {\r\n LOGIN: \"login\",\r\n SELECT_ACCOUNT: \"select_account\",\r\n CONSENT: \"consent\",\r\n NONE: \"none\"\r\n};\r\n\r\n/**\r\n * Frame name prefixes for the hidden iframe created in silent frames\r\n */\r\nexport const FramePrefix = {\r\n ID_TOKEN_FRAME: \"msalIdTokenFrame\",\r\n TOKEN_FRAME: \"msalRenewFrame\"\r\n};\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class CryptoUtils {\r\n\r\n /**\r\n * Creates a new random GUID\r\n * @returns string (GUID)\r\n */\r\n static createNewGuid(): string {\r\n /*\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\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 CryptoUtils.decimalToHex(buffer[0]) + CryptoUtils.decimalToHex(buffer[1])\r\n + CryptoUtils.decimalToHex(buffer[2]) + CryptoUtils.decimalToHex(buffer[3])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[4]) + CryptoUtils.decimalToHex(buffer[5])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[6]) + CryptoUtils.decimalToHex(buffer[7])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[8]) + CryptoUtils.decimalToHex(buffer[9])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[10]) + CryptoUtils.decimalToHex(buffer[11])\r\n + CryptoUtils.decimalToHex(buffer[12]) + CryptoUtils.decimalToHex(buffer[13])\r\n + CryptoUtils.decimalToHex(buffer[14]) + CryptoUtils.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 * verifies if a string is GUID\r\n * @param guid\r\n */\r\n static isGuid(guid: string): boolean {\r\n const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n }\r\n\r\n /**\r\n * Decimal to Hex\r\n *\r\n * @param num\r\n */\r\n static decimalToHex(num: number): string {\r\n let 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 // See: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_4_%E2%80%93_escaping_the_string_before_encoding_it\r\n\r\n /**\r\n * encoding string to base64 - platform specific check\r\n *\r\n * @param input\r\n */\r\n static base64Encode(input: string): string {\r\n return btoa(encodeURIComponent(input).replace(/%([0-9A-F]{2})/g,\r\n function toSolidBytes(match, p1) {\r\n return String.fromCharCode(Number(\"0x\" + p1));\r\n }));\r\n }\r\n\r\n /**\r\n * Decodes a base64 encoded string.\r\n *\r\n * @param input\r\n */\r\n static base64Decode(input: string): string {\r\n let encodedString = input.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n switch (encodedString.length % 4) {\r\n case 0:\r\n break;\r\n case 2:\r\n encodedString += \"==\";\r\n break;\r\n case 3:\r\n encodedString += \"=\";\r\n break;\r\n default:\r\n throw new Error(\"Invalid base64 string\");\r\n }\r\n\r\n return decodeURIComponent(atob(encodedString).split(\"\").map(function (c) {\r\n return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\r\n }).join(\"\"));\r\n }\r\n\r\n /**\r\n * deserialize a string\r\n *\r\n * @param query\r\n */\r\n static deserialize(query: string): object {\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}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthenticationParameters } from \"../AuthenticationParameters\";\r\nimport { Constants, PromptState, DisallowedEQParams, InteractionType } from \"./Constants\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { ScopeSet } from \"../ScopeSet\";\r\nimport { StringDict } from \"../MsalTypes\";\r\nimport { StringUtils } from \"./StringUtils\";\r\nimport { CryptoUtils } from \"./CryptoUtils\";\r\nimport { TimeUtils } from \"./TimeUtils\";\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\n\r\nexport type LibraryStateObject = {\r\n id: string,\r\n ts: number\r\n method: string\r\n};\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class RequestUtils {\r\n\r\n /**\r\n * @ignore\r\n *\r\n * @param request\r\n * @param isLoginCall\r\n * @param cacheStorage\r\n * @param clientId\r\n *\r\n * validates all request parameters and generates a consumable request object\r\n */\r\n static validateRequest(request: AuthenticationParameters, isLoginCall: boolean, clientId: string, interactionType: InteractionType): AuthenticationParameters {\r\n\r\n // Throw error if request is empty for acquire * calls\r\n if(!isLoginCall && !request) {\r\n throw ClientConfigurationError.createEmptyRequestError();\r\n }\r\n\r\n let scopes: Array;\r\n let extraQueryParameters: StringDict;\r\n\r\n if(request) {\r\n // if extraScopesToConsent is passed in loginCall, append them to the login request; Validate and filter scopes (the validate function will throw if validation fails)\r\n scopes = isLoginCall ? ScopeSet.appendScopes(request.scopes, request.extraScopesToConsent) : request.scopes;\r\n ScopeSet.validateInputScope(scopes, !isLoginCall);\r\n scopes = ScopeSet.translateClientIdIfSingleScope(scopes, clientId);\r\n\r\n // validate prompt parameter\r\n this.validatePromptParameter(request.prompt);\r\n\r\n // validate extraQueryParameters\r\n extraQueryParameters = this.validateEQParameters(request.extraQueryParameters, request.claimsRequest);\r\n\r\n // validate claimsRequest\r\n this.validateClaimsRequest(request.claimsRequest);\r\n }\r\n\r\n // validate and generate state and correlationId\r\n const state = this.validateAndGenerateState(request && request.state, interactionType);\r\n const correlationId = this.validateAndGenerateCorrelationId(request && request.correlationId);\r\n\r\n const validatedRequest: AuthenticationParameters = {\r\n ...request,\r\n extraQueryParameters,\r\n scopes,\r\n state,\r\n correlationId\r\n };\r\n \r\n return validatedRequest;\r\n }\r\n\r\n /**\r\n * @ignore\r\n *\r\n * Utility to test if valid prompt value is passed in the request\r\n * @param request\r\n */\r\n static validatePromptParameter (prompt: string): void {\r\n if(prompt) {\r\n if ([PromptState.LOGIN, PromptState.SELECT_ACCOUNT, PromptState.CONSENT, PromptState.NONE].indexOf(prompt) < 0) {\r\n throw ClientConfigurationError.createInvalidPromptError(prompt);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n *\r\n * Removes unnecessary or duplicate query parameters from extraQueryParameters\r\n * @param request\r\n */\r\n static validateEQParameters(extraQueryParameters: StringDict, claimsRequest: string) : StringDict {\r\n const eQParams : StringDict = { ...extraQueryParameters};\r\n if (!eQParams) {\r\n return null;\r\n }\r\n if (claimsRequest) {\r\n // this.logger.warning(\"Removed duplicate claims from extraQueryParameters. Please use either the claimsRequest field OR pass as extraQueryParameter - not both.\");\r\n delete eQParams[Constants.claims];\r\n }\r\n DisallowedEQParams.forEach(param => {\r\n if (eQParams[param]) {\r\n // this.logger.warning(\"Removed duplicate \" + param + \" from extraQueryParameters. Please use the \" + param + \" field in request object.\");\r\n delete eQParams[param];\r\n }\r\n });\r\n\r\n return eQParams;\r\n }\r\n\r\n /**\r\n * @ignore\r\n *\r\n * Validates the claims passed in request is a JSON\r\n * TODO: More validation will be added when the server team tells us how they have actually implemented claims\r\n * @param claimsRequest\r\n */\r\n static validateClaimsRequest(claimsRequest: string): void {\r\n if (!claimsRequest) {\r\n return;\r\n }\r\n try {\r\n JSON.parse(claimsRequest);\r\n } catch (e) {\r\n throw ClientConfigurationError.createClaimsRequestParsingError(e);\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n *\r\n * generate unique state per request\r\n * @param userState User-provided state value\r\n * @returns State string include library state and user state\r\n */\r\n static validateAndGenerateState(userState: string, interactionType: InteractionType): string {\r\n return !StringUtils.isEmpty(userState) ? `${RequestUtils.generateLibraryState(interactionType)}${Constants.resourceDelimiter}${userState}` : RequestUtils.generateLibraryState(interactionType);\r\n }\r\n\r\n /**\r\n * Generates the state value used by the library.\r\n *\r\n * @returns Base64 encoded string representing the state\r\n */\r\n static generateLibraryState(interactionType: InteractionType): string {\r\n const stateObject: LibraryStateObject = {\r\n id: CryptoUtils.createNewGuid(),\r\n ts: TimeUtils.now(),\r\n method: interactionType\r\n };\r\n\r\n const stateString = JSON.stringify(stateObject);\r\n\r\n return CryptoUtils.base64Encode(stateString);\r\n }\r\n\r\n /**\r\n * Decodes the state value into a StateObject\r\n *\r\n * @param state State value returned in the request\r\n * @returns Parsed values from the encoded state value\r\n */\r\n static parseLibraryState(state: string): LibraryStateObject {\r\n const libraryState = decodeURIComponent(state).split(Constants.resourceDelimiter)[0];\r\n\r\n if (CryptoUtils.isGuid(libraryState)) {\r\n // If state is guid, assume timestamp is now and is redirect, as redirect should be only method where this can happen.\r\n return {\r\n id: libraryState,\r\n ts: TimeUtils.now(),\r\n method: Constants.interactionTypeRedirect\r\n };\r\n }\r\n\r\n try {\r\n const stateString = CryptoUtils.base64Decode(libraryState);\r\n\r\n const stateObject = JSON.parse(stateString);\r\n\r\n return stateObject;\r\n } catch (e) {\r\n throw ClientAuthError.createInvalidStateError(state, null);\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n *\r\n * validate correlationId and generate if not valid or not set by the user\r\n * @param correlationId\r\n */\r\n static validateAndGenerateCorrelationId(correlationId: string): string {\r\n // validate user set correlationId or set one for the user if null\r\n if(correlationId && !CryptoUtils.isGuid(correlationId)) {\r\n throw ClientConfigurationError.createInvalidCorrelationIdError();\r\n }\r\n return CryptoUtils.isGuid(correlationId)? correlationId : CryptoUtils.createNewGuid();\r\n }\r\n\r\n /**\r\n * Create a request signature\r\n * @param request\r\n */\r\n static createRequestSignature(request: AuthenticationParameters): string {\r\n return `${request.scopes.join(\" \").toLowerCase()}${Constants.resourceDelimiter}${request.authority}`;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthResponse } from \"../AuthResponse\";\r\nimport { Account } from \"../Account\";\r\nimport { IdToken } from \"../IdToken\";\r\nimport { ResponseTypes, ServerHashParamKeys } from \"./Constants\";\r\nimport { ServerRequestParameters } from \"../ServerRequestParameters\";\r\n\r\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class ResponseUtils {\r\n\r\n static setResponseIdToken(originalResponse: AuthResponse, idTokenObj: IdToken) : AuthResponse {\r\n if (!originalResponse) {\r\n return null;\r\n } else if (!idTokenObj) {\r\n return originalResponse;\r\n }\r\n\r\n const exp = Number(idTokenObj.expiration);\r\n if (exp && !originalResponse.expiresOn) {\r\n originalResponse.expiresOn = new Date(exp * 1000);\r\n }\r\n \r\n return {\r\n ...originalResponse,\r\n idToken: idTokenObj,\r\n idTokenClaims: idTokenObj.claims,\r\n uniqueId: idTokenObj.objectId || idTokenObj.subject,\r\n tenantId: idTokenObj.tenantId,\r\n };\r\n }\r\n\r\n static buildAuthResponse(idToken: IdToken, authResponse: AuthResponse, serverAuthenticationRequest: ServerRequestParameters, account: Account, scopes: Array, accountState: string): AuthResponse {\r\n switch(serverAuthenticationRequest.responseType) {\r\n case ResponseTypes.id_token:\r\n let idTokenResponse: AuthResponse = {\r\n ...authResponse,\r\n tokenType: ServerHashParamKeys.ID_TOKEN,\r\n account: account,\r\n scopes: scopes,\r\n accountState: accountState\r\n };\r\n \r\n idTokenResponse = ResponseUtils.setResponseIdToken(idTokenResponse, idToken);\r\n return (idTokenResponse.idToken) ? idTokenResponse : null;\r\n case ResponseTypes.id_token_token:\r\n const idTokeTokenResponse = ResponseUtils.setResponseIdToken(authResponse, idToken);\r\n return (idTokeTokenResponse && idTokeTokenResponse.accessToken && idTokeTokenResponse.idToken) ? idTokeTokenResponse : null;\r\n case ResponseTypes.token:\r\n const tokenResponse = ResponseUtils.setResponseIdToken(authResponse, idToken);\r\n return tokenResponse;\r\n default: \r\n return null;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AccessTokenKey } from \"../cache/AccessTokenKey\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class StringUtils {\r\n /**\r\n * Check if a string is empty\r\n *\r\n * @param str\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 /**\r\n * Check if a string's value is a valid JSON object\r\n *\r\n * @param str\r\n */\r\n static validateAndParseJsonCacheKey(str: string): AccessTokenKey {\r\n try {\r\n const parsedKey = JSON.parse(str);\r\n /**\r\n * There are edge cases in which JSON.parse will successfully parse a non-valid JSON object \r\n * (e.g. JSON.parse will parse an escaped string into an unescaped string), so adding a type check\r\n * of the parsed value is necessary in order to be certain that the string represents a valid JSON object.\r\n *\r\n */\r\n return (parsedKey && typeof parsedKey === \"object\") ? parsedKey : null;\r\n } catch (error) {\r\n return null;\r\n }\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class TimeUtils {\r\n /**\r\n * Returns time in seconds for expiration based on string value passed in.\r\n *\r\n * @param expiresIn\r\n */\r\n static parseExpiresIn(expiresIn: 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 const expires = expiresIn || \"3599\";\r\n return parseInt(expires, 10);\r\n }\r\n\r\n /**\r\n * Return the current time in Unix time (seconds). Date.getTime() returns in milliseconds.\r\n */\r\n static now(): number {\r\n return Math.round(new Date().getTime() / 1000.0);\r\n }\r\n\r\n /**\r\n * Returns the amount of time in milliseconds since the page loaded.\r\n */\r\n static relativeNowMs(): number {\r\n return window.performance.now();\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { CryptoUtils } from \"./CryptoUtils\";\r\nimport { StringUtils } from \"./StringUtils\";\r\nimport { TimeUtils } from \"./TimeUtils\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class TokenUtils {\r\n\r\n /**\r\n * decode a JWT\r\n *\r\n * @param jwtToken\r\n */\r\n static decodeJwt(jwtToken: string): object {\r\n if (StringUtils.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 /**\r\n * Evaluates whether token cache item expiration is within expiration offset range\r\n * @param tokenCacheItem \r\n */\r\n static validateExpirationIsWithinOffset(expiration: number, tokenRenewalOffsetSeconds: number): Boolean {\r\n const offset = tokenRenewalOffsetSeconds || 300;\r\n return expiration && (expiration > TimeUtils.now() + offset);\r\n }\r\n\r\n /**\r\n * Extract IdToken by decoding the RAWIdToken\r\n *\r\n * @param encodedIdToken\r\n */\r\n static extractIdToken(encodedIdToken: string): object {\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 = CryptoUtils.base64Decode(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","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { IUri } from \"../IUri\";\r\nimport { Constants, SSOTypes, ServerHashParamKeys } from \"./Constants\";\r\nimport { ServerRequestParameters } from \"../ServerRequestParameters\";\r\nimport { ScopeSet } from \"../ScopeSet\";\r\nimport { StringUtils } from \"./StringUtils\";\r\nimport { CryptoUtils } from \"./CryptoUtils\";\r\n\r\n/**\r\n * @hidden\r\n */\r\nexport class UrlUtils {\r\n\r\n /**\r\n * generates the URL with QueryString Parameters\r\n * @param scopes\r\n */\r\n static createNavigateUrl(serverRequestParams: ServerRequestParameters): string {\r\n const str = this.createNavigationUrlString(serverRequestParams);\r\n let authEndpoint: string = serverRequestParams.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 } else {\r\n authEndpoint += \"&\";\r\n }\r\n\r\n const requestUrl: string = `${authEndpoint}${str.join(\"&\")}`;\r\n return requestUrl;\r\n }\r\n\r\n /**\r\n * Generate the array of all QueryStringParams to be sent to the server\r\n * @param scopes\r\n */\r\n static createNavigationUrlString(serverRequestParams: ServerRequestParameters): Array {\r\n const scopes = ScopeSet.appendDefaultScopes(serverRequestParams.scopes);\r\n\r\n const str: Array = [];\r\n str.push(\"response_type=\" + serverRequestParams.responseType);\r\n str.push(\"scope=\" + encodeURIComponent(ScopeSet.parseScope(scopes)));\r\n str.push(\"client_id=\" + encodeURIComponent(serverRequestParams.clientId));\r\n str.push(\"redirect_uri=\" + encodeURIComponent(serverRequestParams.redirectUri));\r\n\r\n str.push(\"state=\" + encodeURIComponent(serverRequestParams.state));\r\n str.push(\"nonce=\" + encodeURIComponent(serverRequestParams.nonce));\r\n\r\n str.push(\"client_info=1\");\r\n str.push(`x-client-SKU=${serverRequestParams.xClientSku}`);\r\n str.push(`x-client-Ver=${serverRequestParams.xClientVer}`);\r\n if (serverRequestParams.promptValue) {\r\n str.push(\"prompt=\" + encodeURIComponent(serverRequestParams.promptValue));\r\n }\r\n\r\n if (serverRequestParams.claimsValue) {\r\n str.push(\"claims=\" + encodeURIComponent(serverRequestParams.claimsValue));\r\n }\r\n\r\n if (serverRequestParams.queryParameters) {\r\n str.push(serverRequestParams.queryParameters);\r\n }\r\n\r\n if (serverRequestParams.extraQueryParameters) {\r\n str.push(serverRequestParams.extraQueryParameters);\r\n }\r\n\r\n str.push(\"client-request-id=\" + encodeURIComponent(serverRequestParams.correlationId));\r\n return str;\r\n }\r\n\r\n /**\r\n * Returns current window URL as redirect uri\r\n */\r\n static getCurrentUrl(): string {\r\n return window.location.href.split(\"?\")[0].split(\"#\")[0];\r\n }\r\n\r\n /**\r\n * Returns given URL with query string removed\r\n */\r\n static removeHashFromUrl(url: string): string {\r\n return url.split(\"#\")[0];\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 replaceTenantPath(url: string, tenantId: string): string {\r\n const lowerCaseUrl = url.toLowerCase();\r\n const urlObject = this.GetUrlComponents(lowerCaseUrl);\r\n const pathArray = urlObject.PathSegments;\r\n if (tenantId && (pathArray.length !== 0 && (pathArray[0] === Constants.common || pathArray[0] === SSOTypes.ORGANIZATIONS || pathArray[0] === SSOTypes.CONSUMERS))) {\r\n pathArray[0] = tenantId;\r\n }\r\n return this.constructAuthorityUriFromObject(urlObject, pathArray);\r\n }\r\n\r\n static constructAuthorityUriFromObject(urlObject: IUri, pathArray: string[]): string {\r\n return this.CanonicalizeUri(urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + pathArray.join(\"/\"));\r\n }\r\n \r\n /**\r\n * Checks if an authority is common (ex. https://a:b/common/)\r\n * @param url The url\r\n * @returns true if authority is common and false otherwise \r\n */\r\n static isCommonAuthority(url: string): boolean {\r\n const authority = this.CanonicalizeUri(url);\r\n const pathArray = this.GetUrlComponents(authority).PathSegments;\r\n return (pathArray.length !== 0 && pathArray[0] === Constants.common);\r\n }\r\n\r\n /**\r\n * Checks if an authority is for organizations (ex. https://a:b/organizations/)\r\n * @param url The url\r\n * @returns true if authority is for and false otherwise \r\n */\r\n static isOrganizationsAuthority(url: string): boolean {\r\n const authority = this.CanonicalizeUri(url);\r\n const pathArray = this.GetUrlComponents(authority).PathSegments;\r\n return (pathArray.length !== 0 && pathArray[0] === SSOTypes.ORGANIZATIONS);\r\n }\r\n\r\n /**\r\n * Checks if an authority is for consumers (ex. https://a:b/consumers/)\r\n * @param url The url\r\n * @returns true if authority is for and false otherwise \r\n */\r\n static isConsumersAuthority(url: string): boolean {\r\n const authority = this.CanonicalizeUri(url);\r\n const pathArray = this.GetUrlComponents(authority).PathSegments;\r\n return (pathArray.length !== 0 && pathArray[0] === SSOTypes.CONSUMERS);\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 const regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n\r\n const 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 const 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\r\n if (match[6]){\r\n urlComponents.Search = match[6];\r\n }\r\n if (match[8]){\r\n urlComponents.Hash = match[8];\r\n }\r\n \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 * @param url\r\n */\r\n static CanonicalizeUri(url: string): string {\r\n if (url) {\r\n let lowerCaseUrl = url.toLowerCase();\r\n\r\n if (!UrlUtils.endsWith(lowerCaseUrl, \"/\")) {\r\n lowerCaseUrl += \"/\";\r\n }\r\n\r\n return lowerCaseUrl;\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 // TODO: Rename this, not clear what it is supposed to do\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 /**\r\n * Utils function to remove the login_hint and domain_hint from the i/p extraQueryParameters\r\n * @param url\r\n * @param name\r\n */\r\n static urlRemoveQueryStringParameter(url: string, name: string): string {\r\n if (StringUtils.isEmpty(url)) {\r\n return url;\r\n }\r\n\r\n let updatedUrl = url;\r\n let regex = new RegExp(\"(\\\\&\" + name + \"=)[^\\&]+\");\r\n updatedUrl = url.replace(regex, \"\");\r\n // name=value&\r\n regex = new RegExp(\"(\" + name + \"=)[^\\&]+&\");\r\n updatedUrl = url.replace(regex, \"\");\r\n // name=value\r\n regex = new RegExp(\"(\" + name + \"=)[^\\&]+\");\r\n updatedUrl = url.replace(regex, \"\");\r\n return updatedUrl;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Returns the anchor part(#) of the URL\r\n */\r\n static getHashFromUrl(urlStringOrFragment: string): string {\r\n const hashIndex1 = urlStringOrFragment.indexOf(\"#\");\r\n const hashIndex2 = urlStringOrFragment.indexOf(\"#/\");\r\n if (hashIndex2 > -1) {\r\n return urlStringOrFragment.substring(hashIndex2 + 2);\r\n } else if (hashIndex1 > -1) {\r\n return urlStringOrFragment.substring(hashIndex1 + 1);\r\n }\r\n return urlStringOrFragment;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Check if the url contains a hash with known properties\r\n * @ignore\r\n */\r\n static urlContainsHash(urlString: string): boolean {\r\n const parameters = UrlUtils.deserializeHash(urlString);\r\n return (\r\n parameters.hasOwnProperty(ServerHashParamKeys.ERROR_DESCRIPTION) ||\r\n parameters.hasOwnProperty(ServerHashParamKeys.ERROR) ||\r\n parameters.hasOwnProperty(ServerHashParamKeys.ACCESS_TOKEN) ||\r\n parameters.hasOwnProperty(ServerHashParamKeys.ID_TOKEN)\r\n );\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Returns deserialized portion of URL hash\r\n * @ignore\r\n */\r\n static deserializeHash(urlFragment: string): object {\r\n const hash = UrlUtils.getHashFromUrl(urlFragment);\r\n return CryptoUtils.deserialize(hash);\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {string} URI\r\n * @returns {string} host from the URI\r\n *\r\n * extract URI from the host\r\n */\r\n static getHostFromUri(uri: string): string {\r\n // remove http:// or https:// from uri\r\n let extractedUri = String(uri).replace(/^(https?:)\\/\\//, \"\");\r\n extractedUri = extractedUri.split(\"/\")[0];\r\n return extractedUri;\r\n }\r\n}\r\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\nimport { UrlUtils } from \"./UrlUtils\";\r\nimport { Logger } from \"../Logger\";\r\nimport { AuthCache } from \"../cache/AuthCache\";\r\nimport { TemporaryCacheKeys, Constants } from \"./Constants\";\r\nimport { TimeUtils } from \"./TimeUtils\";\r\n\r\nexport class WindowUtils {\r\n /**\r\n * @hidden\r\n * Interval in milliseconds that we poll a window\r\n * @ignore\r\n */\r\n private static POLLING_INTERVAL_MS = 50;\r\n\r\n /**\r\n * @hidden\r\n * Checks if the current page is running in an iframe.\r\n * @ignore\r\n */\r\n static isInIframe(): boolean {\r\n return window.parent !== window;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Check if the current page is running in a popup.\r\n * @ignore\r\n */\r\n static isInPopup(): boolean {\r\n return !!(window.opener && window.opener !== window);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * @param prefix\r\n * @param scopes\r\n * @param authority\r\n */\r\n static generateFrameName(prefix: string, requestSignature: string): string {\r\n return `${prefix}${Constants.resourceDelimiter}${requestSignature}`;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Polls an iframe until it loads a url with a hash\r\n * @ignore\r\n */\r\n static monitorIframeForHash(contentWindow: Window, timeout: number, urlNavigate: string, logger: Logger): Promise {\r\n return new Promise((resolve, reject) => {\r\n /*\r\n * Polling for iframes can be purely timing based,\r\n * since we don't need to account for interaction.\r\n */\r\n const nowMark = TimeUtils.relativeNowMs();\r\n const timeoutMark = nowMark + timeout;\r\n\r\n logger.verbose(\"monitorWindowForIframe polling started\");\r\n\r\n const intervalId = setInterval(() => {\r\n if (TimeUtils.relativeNowMs() > timeoutMark) {\r\n logger.error(\"monitorIframeForHash unable to find hash in url, timing out\");\r\n logger.errorPii(`monitorIframeForHash polling timed out for url: ${urlNavigate}`);\r\n clearInterval(intervalId);\r\n reject(ClientAuthError.createTokenRenewalTimeoutError());\r\n return;\r\n }\r\n\r\n let href;\r\n\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = contentWindow.location.href;\r\n } catch (e) {}\r\n\r\n if (href && UrlUtils.urlContainsHash(href)) {\r\n logger.verbose(\"monitorIframeForHash found url in hash\");\r\n clearInterval(intervalId);\r\n resolve(contentWindow.location.hash);\r\n } \r\n }, WindowUtils.POLLING_INTERVAL_MS);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Polls a popup until it loads a url with a hash\r\n * @ignore\r\n */\r\n static monitorPopupForHash(contentWindow: Window, timeout: number, urlNavigate: string, logger: Logger): Promise {\r\n return new Promise((resolve, reject) => {\r\n /*\r\n * Polling for popups needs to be tick-based,\r\n * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).\r\n */\r\n const maxTicks = timeout / WindowUtils.POLLING_INTERVAL_MS;\r\n let ticks = 0;\r\n\r\n logger.verbose(\"monitorWindowForHash polling started\");\r\n\r\n const intervalId = setInterval(() => {\r\n if (contentWindow.closed) {\r\n logger.error(\"monitorWindowForHash window closed\");\r\n clearInterval(intervalId);\r\n reject(ClientAuthError.createUserCancelledError());\r\n return;\r\n }\r\n\r\n let href;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = contentWindow.location.href;\r\n } catch (e) {}\r\n\r\n // Don't process blank pages or cross domain\r\n if (!href || href === \"about:blank\") {\r\n return;\r\n }\r\n\r\n /*\r\n * Only run clock when we are on same domain for popups\r\n * as popup operations can take a long time.\r\n */\r\n ticks++;\r\n\r\n if (href && UrlUtils.urlContainsHash(href)) {\r\n logger.verbose(\"monitorPopupForHash found url in hash\");\r\n clearInterval(intervalId);\r\n const hash = contentWindow.location.hash;\r\n WindowUtils.clearUrlFragment(contentWindow);\r\n resolve(hash);\r\n } else if (ticks > maxTicks) {\r\n logger.error(\"monitorPopupForHash unable to find hash in url, timing out\");\r\n logger.errorPii(`monitorPopupForHash polling timed out for url: ${urlNavigate}`);\r\n clearInterval(intervalId);\r\n reject(ClientAuthError.createTokenRenewalTimeoutError());\r\n }\r\n }, WindowUtils.POLLING_INTERVAL_MS);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n */\r\n static loadFrame(urlNavigate: string, frameName: string, timeoutMs: number, logger: Logger): Promise {\r\n /*\r\n * This trick overcomes iframe navigation in IE\r\n * IE does not load the page consistently in iframe\r\n */\r\n logger.infoPii(\"LoadFrame: \" + frameName);\r\n\r\n return new Promise((resolve, reject) => {\r\n setTimeout(() => {\r\n const frameHandle = this.loadFrameSync(urlNavigate, frameName, logger);\r\n\r\n if (!frameHandle) {\r\n reject(`Unable to load iframe with name: ${frameName}`);\r\n return;\r\n }\r\n\r\n resolve(frameHandle);\r\n }, timeoutMs);\r\n });\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Loads the iframe synchronously when the navigateTimeFrame is set to `0`\r\n * @param urlNavigate\r\n * @param frameName\r\n * @param logger\r\n */\r\n static loadFrameSync(urlNavigate: string, frameName: string, logger: Logger): HTMLIFrameElement{\r\n const frameHandle = WindowUtils.addHiddenIFrame(frameName, logger);\r\n\r\n // returning to handle null in loadFrame, also to avoid null object access errors\r\n if (!frameHandle) {\r\n return null;\r\n }\r\n else if (frameHandle.src === \"\" || frameHandle.src === \"about:blank\") {\r\n frameHandle.src = urlNavigate;\r\n logger.infoPii(\"Frame Name : \" + frameName + \" Navigated to: \" + urlNavigate);\r\n }\r\n\r\n return frameHandle;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Adds the hidden iframe for silent token renewal.\r\n * @ignore\r\n */\r\n static addHiddenIFrame(iframeId: string, logger: Logger): HTMLIFrameElement {\r\n if (typeof iframeId === \"undefined\") {\r\n return null;\r\n }\r\n \r\n logger.info(\"Add msal iframe to document\");\r\n logger.infoPii(\"Add msal frame to document:\" + iframeId);\r\n let adalFrame = document.getElementById(iframeId) as HTMLIFrameElement;\r\n if (!adalFrame) {\r\n logger.verbose(\"Add msal iframe does not exist\");\r\n const ifr = document.createElement(\"iframe\");\r\n ifr.setAttribute(\"id\", iframeId);\r\n ifr.setAttribute(\"aria-hidden\", \"true\");\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 ifr.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-forms\");\r\n adalFrame = (document.getElementsByTagName(\"body\")[0].appendChild(ifr) as HTMLIFrameElement);\r\n } else {\r\n logger.verbose(\"Add msal iframe already exists\");\r\n }\r\n\r\n return adalFrame;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Removes a hidden iframe from the page.\r\n * @ignore\r\n */\r\n static removeHiddenIframe(iframe: HTMLIFrameElement): void {\r\n if (document.body === iframe.parentNode) {\r\n document.body.removeChild(iframe);\r\n }\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Find and return the iframe element with the given hash\r\n * @ignore\r\n */\r\n static getIframeWithHash(hash: string): HTMLIFrameElement {\r\n const iframes = document.getElementsByTagName(\"iframe\");\r\n const iframeArray: Array = Array.apply(null, Array(iframes.length)).map((iframe: HTMLIFrameElement, index: number) => iframes.item(index)); // eslint-disable-line prefer-spread\r\n\r\n return iframeArray.filter((iframe: HTMLIFrameElement) => {\r\n try {\r\n return iframe.contentWindow.location.hash === hash;\r\n } catch (e) {\r\n return false;\r\n }\r\n })[0];\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Returns an array of all the popups opened by MSAL\r\n * @ignore\r\n */\r\n static getPopups(): Array {\r\n if (!window.openedWindows) {\r\n window.openedWindows = [];\r\n }\r\n\r\n return window.openedWindows;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Find and return the popup with the given hash\r\n * @ignore\r\n */\r\n static getPopUpWithHash(hash: string): Window {\r\n return WindowUtils.getPopups().filter(popup => {\r\n try {\r\n return popup.location.hash === hash;\r\n } catch (e) {\r\n return false;\r\n }\r\n })[0];\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Add the popup to the known list of popups\r\n * @ignore\r\n */\r\n static trackPopup(popup: Window): void {\r\n WindowUtils.getPopups().push(popup);\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Close all popups\r\n * @ignore\r\n */\r\n static closePopups(): void {\r\n WindowUtils.getPopups().forEach(popup => popup.close());\r\n }\r\n\r\n /**\r\n * @ignore\r\n *\r\n * blocks any login/acquireToken calls to reload from within a hidden iframe (generated for silent calls)\r\n */\r\n static blockReloadInHiddenIframes(): void {\r\n // return an error if called from the hidden iframe created by the msal js silent calls\r\n if (UrlUtils.urlContainsHash(window.location.hash) && WindowUtils.isInIframe()) {\r\n throw ClientAuthError.createBlockTokenRequestsInHiddenIframeError();\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * @param cacheStorage\r\n */\r\n static checkIfBackButtonIsPressed(cacheStorage: AuthCache): void {\r\n const redirectCache = cacheStorage.getItem(TemporaryCacheKeys.REDIRECT_REQUEST);\r\n\r\n // if redirect request is set and there is no hash\r\n if(redirectCache && !UrlUtils.urlContainsHash(window.location.hash)) {\r\n const splitCache = redirectCache.split(Constants.resourceDelimiter);\r\n splitCache.shift();\r\n const state = splitCache.length > 0 ? splitCache.join(Constants.resourceDelimiter): null;\r\n cacheStorage.resetTempCacheItems(state);\r\n }\r\n }\r\n\r\n /**\r\n * Removes url fragment from browser url\r\n */\r\n static clearUrlFragment(contentWindow: Window): void {\r\n contentWindow.location.hash = \"\";\r\n // Office.js sets history.replaceState to null\r\n if (typeof contentWindow.history.replaceState === \"function\") {\r\n // Full removes \"#\" from url\r\n contentWindow.history.replaceState(null, null, `${contentWindow.location.pathname}${contentWindow.location.search}`);\r\n }\r\n }\r\n}\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\n/**\r\n * @packageDocumentation\r\n * @module @azure/msal\r\n */\r\n\r\nexport { UserAgentApplication, authResponseCallback, errorReceivedCallback, tokenReceivedCallback } from \"./UserAgentApplication\";\r\nexport { Logger } from \"./Logger\";\r\nexport { LogLevel } from \"./Logger\";\r\nexport { Account } from \"./Account\";\r\nexport { Constants, ServerHashParamKeys } from \"./utils/Constants\";\r\nexport { Authority } from \"./authority/Authority\";\r\nexport { CacheResult } from \"./UserAgentApplication\";\r\nexport { CacheLocation, Configuration } from \"./Configuration\";\r\nexport { AuthenticationParameters } from \"./AuthenticationParameters\";\r\nexport { AuthResponse } from \"./AuthResponse\";\r\nexport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nexport { UrlUtils } from \"./utils/UrlUtils\";\r\nexport { WindowUtils } from \"./utils/WindowUtils\";\r\n\r\n// Errors\r\nexport { AuthError } from \"./error/AuthError\";\r\nexport { ClientAuthError } from \"./error/ClientAuthError\";\r\nexport { ServerError } from \"./error/ServerError\";\r\nexport { ClientConfigurationError } from \"./error/ClientConfigurationError\";\r\nexport { InteractionRequiredAuthError } from \"./error/InteractionRequiredAuthError\";\r\nexport { version } from \"./packageMetadata\";\r\n"],"names":[],"sourceRoot":""}