Commit 3a84cbd5 authored by Ahmet Turan Koçak's avatar Ahmet Turan Koçak
Browse files

Initial commit

parents
{"version":3,"file":"MsrBrowserCrypto.js","sources":["../../src/crypto/MsrBrowserCrypto.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { KEY_FORMAT_JWK } from \"../utils/BrowserConstants\";\nimport { ISubtleCrypto } from \"./ISubtleCrypto\";\n\ndeclare global {\n interface Window {\n msrCrypto: Crypto & {\n initPrng: (entropy: Uint8Array | number[]) => void\n }\n }\n}\n\nexport class MsrBrowserCrypto implements ISubtleCrypto {\n initPrng(entropy : Uint8Array): void {\n // Turn into array, as initPrng seems to not always like Uint8Array (even though it should support both)\n return window.msrCrypto.initPrng([...entropy]);\n }\n\n getRandomValues(dataBuffer: Uint8Array): Uint8Array {\n return window.msrCrypto.getRandomValues(dataBuffer);\n }\n\n async generateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair> {\n return window.msrCrypto.subtle.generateKey(algorithm, extractable, keyUsages) as Promise<CryptoKeyPair>;\n }\n\n async exportKey(key: CryptoKey): Promise<JsonWebKey> {\n return window.msrCrypto.subtle.exportKey(KEY_FORMAT_JWK, key) as Promise<JsonWebKey> as Promise<JsonWebKey>;\n }\n\n async importKey(keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {\n return window.msrCrypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages) as Promise<CryptoKey>;\n }\n\n async sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> {\n return window.msrCrypto.subtle.sign(algorithm, key, data) as Promise<ArrayBuffer>;\n }\n\n async digest(algorithm: AlgorithmIdentifier, data: Uint8Array): Promise<ArrayBuffer> {\n return window.msrCrypto.subtle.digest(algorithm, data) as Promise<ArrayBuffer>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kceGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD;;GAEG;AACH,qBAAa,aAAa;IAEtB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,SAAS,CAAgB;gBAErB,SAAS,EAAE,aAAa;IAKpC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,SAAS,CAAC;IASzC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;OAGG;YACW,iCAAiC;CAUlD"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __awaiter, __generator } from '../_virtual/_tslib.js';
import { BrowserAuthError } from '../error/BrowserAuthError.js';
import { Base64Encode } from '../encode/Base64Encode.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
// Constant byte array length
var RANDOM_BYTE_ARR_LENGTH = 32;
/**
* Class which exposes APIs to generate PKCE codes and code verifiers.
*/
var PkceGenerator = /** @class */ (function () {
function PkceGenerator(cryptoObj) {
this.base64Encode = new Base64Encode();
this.cryptoObj = cryptoObj;
}
/**
* Generates PKCE Codes. See the RFC for more information: https://tools.ietf.org/html/rfc7636
*/
PkceGenerator.prototype.generateCodes = function () {
return __awaiter(this, void 0, void 0, function () {
var codeVerifier, codeChallenge;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
codeVerifier = this.generateCodeVerifier();
return [4 /*yield*/, this.generateCodeChallengeFromVerifier(codeVerifier)];
case 1:
codeChallenge = _a.sent();
return [2 /*return*/, {
verifier: codeVerifier,
challenge: codeChallenge
}];
}
});
});
};
/**
* Generates a random 32 byte buffer and returns the base64
* encoded string to be used as a PKCE Code Verifier
*/
PkceGenerator.prototype.generateCodeVerifier = function () {
try {
// Generate random values as utf-8
var buffer = new Uint8Array(RANDOM_BYTE_ARR_LENGTH);
this.cryptoObj.getRandomValues(buffer);
// encode verifier as base64
var pkceCodeVerifierB64 = this.base64Encode.urlEncodeArr(buffer);
return pkceCodeVerifierB64;
}
catch (e) {
throw BrowserAuthError.createPkceNotGeneratedError(e);
}
};
/**
* Creates a base64 encoded PKCE Code Challenge string from the
* hash created from the PKCE Code Verifier supplied
*/
PkceGenerator.prototype.generateCodeChallengeFromVerifier = function (pkceCodeVerifier) {
return __awaiter(this, void 0, void 0, function () {
var pkceHashedCodeVerifier, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, this.cryptoObj.sha256Digest(pkceCodeVerifier)];
case 1:
pkceHashedCodeVerifier = _a.sent();
// encode hash as base64
return [2 /*return*/, this.base64Encode.urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier))];
case 2:
e_1 = _a.sent();
throw BrowserAuthError.createPkceNotGeneratedError(e_1);
case 3: return [2 /*return*/];
}
});
});
};
return PkceGenerator;
}());
export { PkceGenerator };
//# sourceMappingURL=PkceGenerator.js.map
{"version":3,"file":"PkceGenerator.js","sources":["../../src/crypto/PkceGenerator.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { PkceCodes } from \"@azure/msal-common\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { Base64Encode } from \"../encode/Base64Encode\";\nimport { BrowserCrypto } from \"./BrowserCrypto\";\n\n// Constant byte array length\nconst RANDOM_BYTE_ARR_LENGTH = 32;\n\n/**\n * Class which exposes APIs to generate PKCE codes and code verifiers.\n */\nexport class PkceGenerator {\n\n private base64Encode: Base64Encode;\n private cryptoObj: BrowserCrypto;\n\n constructor(cryptoObj: BrowserCrypto) {\n this.base64Encode = new Base64Encode();\n this.cryptoObj = cryptoObj;\n }\n\n /**\n * Generates PKCE Codes. See the RFC for more information: https://tools.ietf.org/html/rfc7636\n */\n async generateCodes(): Promise<PkceCodes> {\n const codeVerifier = this.generateCodeVerifier();\n const codeChallenge = await this.generateCodeChallengeFromVerifier(codeVerifier);\n return {\n verifier: codeVerifier,\n challenge: codeChallenge\n };\n }\n\n /**\n * Generates a random 32 byte buffer and returns the base64\n * encoded string to be used as a PKCE Code Verifier\n */\n private generateCodeVerifier(): string {\n try {\n // Generate random values as utf-8\n const buffer: Uint8Array = new Uint8Array(RANDOM_BYTE_ARR_LENGTH);\n this.cryptoObj.getRandomValues(buffer);\n // encode verifier as base64\n const pkceCodeVerifierB64: string = this.base64Encode.urlEncodeArr(buffer);\n return pkceCodeVerifierB64;\n } catch (e) {\n throw BrowserAuthError.createPkceNotGeneratedError(e);\n }\n }\n\n /**\n * Creates a base64 encoded PKCE Code Challenge string from the\n * hash created from the PKCE Code Verifier supplied\n */\n private async generateCodeChallengeFromVerifier(pkceCodeVerifier: string): Promise<string> {\n try {\n // hashed verifier\n const pkceHashedCodeVerifier = await this.cryptoObj.sha256Digest(pkceCodeVerifier);\n // encode hash as base64\n return this.base64Encode.urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier));\n } catch (e) {\n throw BrowserAuthError.createPkceNotGeneratedError(e);\n }\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAUA;AACA,IAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC;;;;IAQI,uBAAY,SAAwB;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC9B;;;;IAKK,qCAAa,GAAnB;;;;;;wBACU,YAAY,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;wBAC3B,qBAAM,IAAI,CAAC,iCAAiC,CAAC,YAAY,CAAC,EAAA;;wBAA1E,aAAa,GAAG,SAA0D;wBAChF,sBAAO;gCACH,QAAQ,EAAE,YAAY;gCACtB,SAAS,EAAE,aAAa;6BAC3B,EAAC;;;;KACL;;;;;IAMO,4CAAoB,GAA5B;QACI,IAAI;;YAEA,IAAM,MAA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AM,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASjG;;;;OAIG;IACG,UAAU,CAAC,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlE"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __awaiter, __generator } from '../_virtual/_tslib.js';
import { CryptoOps } from './CryptoOps.js';
import { Logger, PopTokenGenerator } from '@azure/msal-common';
import { name, version } from '../packageMetadata.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var SignedHttpRequest = /** @class */ (function () {
function SignedHttpRequest(shrParameters, shrOptions) {
var loggerOptions = (shrOptions && shrOptions.loggerOptions) || {};
this.logger = new Logger(loggerOptions, name, version);
this.cryptoOps = new CryptoOps(this.logger);
this.popTokenGenerator = new PopTokenGenerator(this.cryptoOps);
this.shrParameters = shrParameters;
}
/**
* Generates and caches a keypair for the given request options.
* @returns Public key digest, which should be sent to the token issuer.
*/
SignedHttpRequest.prototype.generatePublicKeyThumbprint = function () {
return __awaiter(this, void 0, void 0, function () {
var kid;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.popTokenGenerator.generateKid(this.shrParameters)];
case 1:
kid = (_a.sent()).kid;
return [2 /*return*/, kid];
}
});
});
};
/**
* Generates a signed http request for the given payload with the given key.
* @param payload Payload to sign (e.g. access token)
* @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)
* @param claims Additional claims to include/override in the signed JWT
* @returns Pop token signed with the corresponding private key
*/
SignedHttpRequest.prototype.signRequest = function (payload, publicKeyThumbprint, claims) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.popTokenGenerator.signPayload(payload, publicKeyThumbprint, this.shrParameters, claims)];
});
});
};
/**
* Removes cached keys from browser for given public key thumbprint
* @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)
* @returns If keys are properly deleted
*/
SignedHttpRequest.prototype.removeKeys = function (publicKeyThumbprint) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.cryptoOps.removeTokenBindingKey(publicKeyThumbprint)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
return SignedHttpRequest;
}());
export { SignedHttpRequest };
//# sourceMappingURL=SignedHttpRequest.js.map
{"version":3,"file":"SignedHttpRequest.js","sources":["../../src/crypto/SignedHttpRequest.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CryptoOps } from \"./CryptoOps\";\nimport { Logger, LoggerOptions, PopTokenGenerator, SignedHttpRequestParameters } from \"@azure/msal-common\";\nimport { version, name } from \"../packageMetadata\";\n\nexport type SignedHttpRequestOptions = {\n loggerOptions: LoggerOptions\n};\n\nexport class SignedHttpRequest {\n private popTokenGenerator: PopTokenGenerator;\n private cryptoOps: CryptoOps;\n private shrParameters: SignedHttpRequestParameters;\n private logger: Logger;\n\n constructor(shrParameters: SignedHttpRequestParameters, shrOptions?: SignedHttpRequestOptions) {\n const loggerOptions = (shrOptions && shrOptions.loggerOptions) || {};\n this.logger = new Logger(loggerOptions, name, version);\n this.cryptoOps = new CryptoOps(this.logger);\n this.popTokenGenerator = new PopTokenGenerator(this.cryptoOps);\n this.shrParameters = shrParameters;\n }\n\n /**\n * Generates and caches a keypair for the given request options.\n * @returns Public key digest, which should be sent to the token issuer.\n */\n async generatePublicKeyThumbprint(): Promise<string> {\n const { kid } = await this.popTokenGenerator.generateKid(this.shrParameters);\n\n return kid;\n }\n\n /**\n * Generates a signed http request for the given payload with the given key.\n * @param payload Payload to sign (e.g. access token)\n * @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)\n * @param claims Additional claims to include/override in the signed JWT \n * @returns Pop token signed with the corresponding private key\n */\n async signRequest(payload: string, publicKeyThumbprint: string, claims?: object): Promise<string> {\n return this.popTokenGenerator.signPayload(\n payload, \n publicKeyThumbprint,\n this.shrParameters, \n claims\n );\n }\n\n /**\n * Removes cached keys from browser for given public key thumbprint\n * @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)\n * @returns If keys are properly deleted\n */\n async removeKeys(publicKeyThumbprint: string): Promise<boolean> {\n return await this.cryptoOps.removeTokenBindingKey(publicKeyThumbprint);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;IAmBI,2BAAY,aAA0C,EAAE,UAAqC;QACzF,IAAM,aAAa,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,aAAa,KAAK,EAAE,CAAC;QACrE,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;KACtC;;;;;IAMK,uDAA2B,GAAjC;;;;;4BACoB,qBAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,EAAA;;wBAApE,GAAG,GAAK,CAAA,SAA4D,KAAjE;wBAEX,sBAAO,GAAG,EAAC;;;;KACd;;;;;;;;IASK,uCAAW,GAAjB,UAAkB,OAAe,EAAE,mBAA2B,EAAE,MAAe;;;gBAC3E,sBAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CACrC,OAAO,EACP,mBAAmB,EACnB,IAAI,CAAC,aAAa,EAClB,MAAM,CACT,EAAC;;;KACL;;;;;;IAOK,sCAAU,GAAhB,UAAiB,mBAA2B;;;;4BACjC,qBAAM,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,EAAA;4BAAtE,sBAAO,SAA+D,EAAC;;;;KAC1E;IACL,wBAAC;AAAD,CAAC;;;;"}
\ No newline at end of file
/**
* Class which exposes APIs to decode base64 strings to plaintext. See here for implementation details:
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
*/
export declare class Base64Decode {
/**
* Returns a URL-safe plaintext decoded string from b64 encoded input.
* @param input
*/
decode(input: string): string;
/**
* Decodes base64 into Uint8Array
* @param base64String
* @param nBlockSize
*/
private base64DecToArr;
/**
* Base64 string to array decoding helper
* @param charNum
*/
private b64ToUint6;
}
//# sourceMappingURL=Base64Decode.d.ts.map
\ No newline at end of file
{"version":3,"file":"Base64Decode.d.ts","sourceRoot":"","sources":["../../src/encode/Base64Decode.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,qBAAa,YAAY;IAErB;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAmB7B;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAoBtB;;;OAGG;IACH,OAAO,CAAC,UAAU;CAcrB"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { Constants } from '@azure/msal-common';
import { BrowserStringUtils } from '../utils/BrowserStringUtils.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Class which exposes APIs to decode base64 strings to plaintext. See here for implementation details:
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
*/
var Base64Decode = /** @class */ (function () {
function Base64Decode() {
}
/**
* Returns a URL-safe plaintext decoded string from b64 encoded input.
* @param input
*/
Base64Decode.prototype.decode = function (input) {
var encodedString = input.replace(/-/g, "+").replace(/_/g, "/");
switch (encodedString.length % 4) {
case 0:
break;
case 2:
encodedString += "==";
break;
case 3:
encodedString += "=";
break;
default:
throw new Error("Invalid base64 string");
}
var inputUtf8Arr = this.base64DecToArr(encodedString);
return BrowserStringUtils.utf8ArrToString(inputUtf8Arr);
};
/**
* Decodes base64 into Uint8Array
* @param base64String
* @param nBlockSize
*/
Base64Decode.prototype.base64DecToArr = function (base64String, nBlockSize) {
var sB64Enc = base64String.replace(/[^A-Za-z0-9\+\/]/g, Constants.EMPTY_STRING);
var nInLen = sB64Enc.length;
var nOutLen = nBlockSize ? Math.ceil((nInLen * 3 + 1 >>> 2) / nBlockSize) * nBlockSize : nInLen * 3 + 1 >>> 2;
var aBytes = new Uint8Array(nOutLen);
for (var nMod3 = void 0, nMod4 = void 0, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {
nMod4 = nInIdx & 3;
nUint24 |= this.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;
if (nMod4 === 3 || nInLen - nInIdx === 1) {
for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {
aBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;
}
nUint24 = 0;
}
}
return aBytes;
};
/**
* Base64 string to array decoding helper
* @param charNum
*/
Base64Decode.prototype.b64ToUint6 = function (charNum) {
return charNum > 64 && charNum < 91 ?
charNum - 65
: charNum > 96 && charNum < 123 ?
charNum - 71
: charNum > 47 && charNum < 58 ?
charNum + 4
: charNum === 43 ?
62
: charNum === 47 ?
63
:
0;
};
return Base64Decode;
}());
export { Base64Decode };
//# sourceMappingURL=Base64Decode.js.map
{"version":3,"file":"Base64Decode.js","sources":["../../src/encode/Base64Decode.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"@azure/msal-common\";\nimport { BrowserStringUtils } from \"../utils/BrowserStringUtils\";\n\n/**\n * Class which exposes APIs to decode base64 strings to plaintext. See here for implementation details:\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\n */\nexport class Base64Decode {\n\n /**\n * Returns a URL-safe plaintext decoded string from b64 encoded input.\n * @param input \n */\n decode(input: string): string {\n let encodedString = input.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (encodedString.length % 4) {\n case 0:\n break;\n case 2:\n encodedString += \"==\";\n break;\n case 3:\n encodedString += \"=\";\n break;\n default:\n throw new Error(\"Invalid base64 string\");\n }\n\n const inputUtf8Arr = this.base64DecToArr(encodedString);\n return BrowserStringUtils.utf8ArrToString(inputUtf8Arr);\n }\n\n /**\n * Decodes base64 into Uint8Array\n * @param base64String \n * @param nBlockSize \n */\n private base64DecToArr(base64String: string, nBlockSize?: number): Uint8Array {\n const sB64Enc = base64String.replace(/[^A-Za-z0-9\\+\\/]/g, Constants.EMPTY_STRING);\n const nInLen = sB64Enc.length;\n const nOutLen = nBlockSize ? Math.ceil((nInLen * 3 + 1 >>> 2) / nBlockSize) * nBlockSize : nInLen * 3 + 1 >>> 2;\n const aBytes = new Uint8Array(nOutLen);\n\n for (let nMod3, nMod4, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {\n nMod4 = nInIdx & 3;\n nUint24 |= this.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;\n if (nMod4 === 3 || nInLen - nInIdx === 1) {\n for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {\n aBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;\n }\n nUint24 = 0;\n }\n }\n\n return aBytes;\n }\n\n /**\n * Base64 string to array decoding helper\n * @param charNum \n */\n private b64ToUint6(charNum: number): number {\n return charNum > 64 && charNum < 91 ?\n charNum - 65\n : charNum > 96 && charNum < 123 ? \n charNum - 71\n : charNum > 47 && charNum < 58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,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,EAAE;YACpF,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC;YACnB,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;YACzE,IAAI,KAAK,KAAK,CAAC,IAAI,MAAM,GAAG,MAAM,KAAK,CAAC,EAAE;gBACtC,KAAK,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,IAAI,OAAO,GAAG,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE;oBAChE,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,MAAM,EAAE,KAAK,KAAK,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;iBAC3D;gBACD,OAAO,GAAG,CAAC,CAAC;aACf;SACJ;QAED,OAAO,MAAM,CAAC;KACjB;;;;;IAMO,iCAAU,GAAlB,UAAmB,OAAe;QAC9B,OAAO,OAAO,GAAG,EAAE,IAAI,OAAO,GAAG,EAAE;YAC/B,OAAO,GAAG,EAAE;cACV,OAAO,GAAG,EAAE,IAAI,OAAO,GAAG,GAAG;gBAC3B,OAAO,GAAG,EAAE;kBACV,OAAO,GAAG,EAAE,IAAI,OAAO,GAAG,EAAE;oBAC1B,OAAO,GAAG,CAAC;sBACT,OAAO,KAAK,EAAE;wBACZ,EAAE;0BACA,OAAO,KAAK,EAAE;4BACZ,EAAE;;gCAEF,CAAC,CAAC;KACzB;IACL,mBAAC;AAAD,CAAC;;;;"}
\ No newline at end of file
/**
* Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
*/
export declare class Base64Encode {
/**
* Returns URL Safe b64 encoded string from a plaintext string.
* @param input
*/
urlEncode(input: string): string;
/**
* Returns URL Safe b64 encoded string from an int8Array.
* @param inputArr
*/
urlEncodeArr(inputArr: Uint8Array): string;
/**
* Returns b64 encoded string from plaintext string.
* @param input
*/
encode(input: string): string;
/**
* Base64 encode byte array
* @param aBytes
*/
private base64EncArr;
/**
* Base64 string to array encoding helper
* @param nUint6
*/
private uint6ToB64;
}
//# sourceMappingURL=Base64Encode.d.ts.map
\ No newline at end of file
{"version":3,"file":"Base64Encode.d.ts","sourceRoot":"","sources":["../../src/encode/Base64Encode.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,qBAAa,YAAY;IAErB;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAOhC;;;OAGG;IACH,YAAY,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM;IAO1C;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK7B;;;OAGG;IACH,OAAO,CAAC,YAAY;IAyBpB;;;OAGG;IACH,OAAO,CAAC,UAAU;CAcrB"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { Constants } from '@azure/msal-common';
import { BrowserStringUtils } from '../utils/BrowserStringUtils.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:
* https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64
*/
var Base64Encode = /** @class */ (function () {
function Base64Encode() {
}
/**
* Returns URL Safe b64 encoded string from a plaintext string.
* @param input
*/
Base64Encode.prototype.urlEncode = function (input) {
return encodeURIComponent(this.encode(input)
.replace(/=/g, Constants.EMPTY_STRING)
.replace(/\+/g, "-")
.replace(/\//g, "_"));
};
/**
* Returns URL Safe b64 encoded string from an int8Array.
* @param inputArr
*/
Base64Encode.prototype.urlEncodeArr = function (inputArr) {
return this.base64EncArr(inputArr)
.replace(/=/g, Constants.EMPTY_STRING)
.replace(/\+/g, "-")
.replace(/\//g, "_");
};
/**
* Returns b64 encoded string from plaintext string.
* @param input
*/
Base64Encode.prototype.encode = function (input) {
var inputUtf8Arr = BrowserStringUtils.stringToUtf8Arr(input);
return this.base64EncArr(inputUtf8Arr);
};
/**
* Base64 encode byte array
* @param aBytes
*/
Base64Encode.prototype.base64EncArr = function (aBytes) {
var eqLen = (3 - (aBytes.length % 3)) % 3;
var sB64Enc = Constants.EMPTY_STRING;
for (var nMod3 = void 0, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {
nMod3 = nIdx % 3;
/* Uncomment the following line in order to split the output in lines 76-character long: */
/*
*if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += "\r\n"; }
*/
nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24);
if (nMod3 === 2 || aBytes.length - nIdx === 1) {
sB64Enc += String.fromCharCode(this.uint6ToB64(nUint24 >>> 18 & 63), this.uint6ToB64(nUint24 >>> 12 & 63), this.uint6ToB64(nUint24 >>> 6 & 63), this.uint6ToB64(nUint24 & 63));
nUint24 = 0;
}
}
return eqLen === 0 ? sB64Enc : sB64Enc.substring(0, sB64Enc.length - eqLen) + (eqLen === 1 ? "=" : "==");
};
/**
* Base64 string to array encoding helper
* @param nUint6
*/
Base64Encode.prototype.uint6ToB64 = function (nUint6) {
return nUint6 < 26 ?
nUint6 + 65
: nUint6 < 52 ?
nUint6 + 71
: nUint6 < 62 ?
nUint6 - 4
: nUint6 === 62 ?
43
: nUint6 === 63 ?
47
:
65;
};
return Base64Encode;
}());
export { Base64Encode };
//# sourceMappingURL=Base64Encode.js.map
{"version":3,"file":"Base64Encode.js","sources":["../../src/encode/Base64Encode.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"@azure/msal-common\";\nimport { BrowserStringUtils } from \"../utils/BrowserStringUtils\";\n\n/**\n * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\n */\nexport class Base64Encode {\n \n /**\n * Returns URL Safe b64 encoded string from a plaintext string.\n * @param input \n */\n urlEncode(input: string): string {\n return encodeURIComponent(this.encode(input)\n .replace(/=/g, Constants.EMPTY_STRING)\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\"));\n }\n\n /**\n * Returns URL Safe b64 encoded string from an int8Array.\n * @param inputArr \n */\n urlEncodeArr(inputArr: Uint8Array): string {\n return this.base64EncArr(inputArr)\n .replace(/=/g, Constants.EMPTY_STRING)\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\");\n }\n\n /**\n * Returns b64 encoded string from plaintext string.\n * @param input \n */\n encode(input: string): string {\n const inputUtf8Arr = BrowserStringUtils.stringToUtf8Arr(input);\n return this.base64EncArr(inputUtf8Arr);\n }\n\n /**\n * Base64 encode byte array\n * @param aBytes \n */\n private base64EncArr(aBytes: Uint8Array): string { \n const eqLen = (3 - (aBytes.length % 3)) % 3;\n let sB64Enc = Constants.EMPTY_STRING;\n \n for (let nMod3, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {\n nMod3 = nIdx % 3;\n /* Uncomment the following line in order to split the output in lines 76-character long: */\n /*\n *if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += \"\\r\\n\"; }\n */\n nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24);\n if (nMod3 === 2 || aBytes.length - nIdx === 1) {\n sB64Enc += String.fromCharCode(\n this.uint6ToB64(nUint24 >>> 18 & 63), \n this.uint6ToB64(nUint24 >>> 12 & 63), \n this.uint6ToB64(nUint24 >>> 6 & 63), \n this.uint6ToB64(nUint24 & 63)\n );\n nUint24 = 0;\n }\n }\n\n return eqLen === 0 ? sB64Enc : sB64Enc.substring(0, sB64Enc.length - eqLen) + (eqLen === 1 ? \"=\" : \"==\");\n }\n\n /**\n * Base64 string to array encoding helper\n * @param nUint6 \n */\n private uint6ToB64 (nUint6: number): number {\n return nUint6 < 26 ?\n nUint6 + 65\n : nUint6 < 52 ?\n nUint6 + 71\n : nUint6 < 62 ?\n nUint6 - 4\n : nUint6 === 62 ?\n 43\n : nUint6 === 63 ?\n 47\n :\n 65;\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAQA;;;;;IAIA;KAgFC;;;;;IA1EG,gCAAS,GAAT,UAAU,KAAa;QACnB,OAAO,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;aACvC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC;aACrC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;aACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;KAC7B;;;;;IAMD,mCAAY,GAAZ,UAAa,QAAoB;QAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;aAC7B,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC;aACrC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;aACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KAC5B;;;;;IAMD,6BAAM,GAAN,UAAO,KAAa;QAChB,IAAM,YAAY,GAAG,kBAAkB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;KAC1C;;;;;IAMO,mCAAY,GAApB,UAAqB,MAAkB;QACnC,IAAM,KAAK,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,OAAO,GAAG,SAAS,CAAC,YAAY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,CAAC;;;;"}
\ No newline at end of file
import { AuthError } from "@azure/msal-common";
/**
* BrowserAuthErrorMessage class containing string constants used by error codes and messages.
*/
export declare const BrowserAuthErrorMessage: {
pkceNotGenerated: {
code: string;
desc: string;
};
cryptoDoesNotExist: {
code: string;
desc: string;
};
httpMethodNotImplementedError: {
code: string;
desc: string;
};
emptyNavigateUriError: {
code: string;
desc: string;
};
hashEmptyError: {
code: string;
desc: string;
};
hashDoesNotContainStateError: {
code: string;
desc: string;
};
hashDoesNotContainKnownPropertiesError: {
code: string;
desc: string;
};
unableToParseStateError: {
code: string;
desc: string;
};
stateInteractionTypeMismatchError: {
code: string;
desc: string;
};
interactionInProgress: {
code: string;
desc: string;
};
popupWindowError: {
code: string;
desc: string;
};
emptyWindowError: {
code: string;
desc: string;
};
userCancelledError: {
code: string;
desc: string;
};
monitorPopupTimeoutError: {
code: string;
desc: string;
};
monitorIframeTimeoutError: {
code: string;
desc: string;
};
redirectInIframeError: {
code: string;
desc: string;
};
blockTokenRequestsInHiddenIframeError: {
code: string;
desc: string;
};
blockAcquireTokenInPopupsError: {
code: string;
desc: string;
};
iframeClosedPrematurelyError: {
code: string;
desc: string;
};
silentLogoutUnsupportedError: {
code: string;
desc: string;
};
noAccountError: {
code: string;
desc: string;
};
silentPromptValueError: {
code: string;
desc: string;
};
noTokenRequestCacheError: {
code: string;
desc: string;
};
unableToParseTokenRequestCacheError: {
code: string;
desc: string;
};
noCachedAuthorityError: {
code: string;
desc: string;
};
authRequestNotSet: {
code: string;
desc: string;
};
invalidCacheType: {
code: string;
desc: string;
};
notInBrowserEnvironment: {
code: string;
desc: string;
};
databaseNotOpen: {
code: string;
desc: string;
};
noNetworkConnectivity: {
code: string;
desc: string;
};
postRequestFailed: {
code: string;
desc: string;
};
getRequestFailed: {
code: string;
desc: string;
};
failedToParseNetworkResponse: {
code: string;
desc: string;
};
unableToLoadTokenError: {
code: string;
desc: string;
};
signingKeyNotFoundInStorage: {
code: string;
desc: string;
};
authCodeRequired: {
code: string;
desc: string;
};
authCodeOrNativeAccountRequired: {
code: string;
desc: string;
};
databaseUnavailable: {
code: string;
desc: string;
};
unableToAcquireTokenFromNativePlatform: {
code: string;
desc: string;
};
nativeHandshakeTimeout: {
code: string;
desc: string;
};
nativeExtensionNotInstalled: {
code: string;
desc: string;
};
nativeConnectionNotEstablished: {
code: string;
desc: string;
};
nativeBrokerCalledBeforeInitialize: {
code: string;
desc: string;
};
nativePromptNotSupported: {
code: string;
desc: string;
};
};
/**
* Browser library error class thrown by the MSAL.js library for SPAs
*/
export declare class BrowserAuthError extends AuthError {
constructor(errorCode: string, errorMessage?: string);
/**
* Creates an error thrown when PKCE is not implemented.
* @param errDetail
*/
static createPkceNotGeneratedError(errDetail: string): BrowserAuthError;
/**
* Creates an error thrown when the crypto object is unavailable.
* @param errDetail
*/
static createCryptoNotAvailableError(errDetail: string): BrowserAuthError;
/**
* Creates an error thrown when an HTTP method hasn't been implemented by the browser class.
* @param method
*/
static createHttpMethodNotImplementedError(method: string): BrowserAuthError;
/**
* Creates an error thrown when the navigation URI is empty.
*/
static createEmptyNavigationUriError(): BrowserAuthError;
/**
* Creates an error thrown when the hash string value is unexpectedly empty.
* @param hashValue
*/
static createEmptyHashError(hashValue: string): BrowserAuthError;
/**
* Creates an error thrown when the hash string value is unexpectedly empty.
*/
static createHashDoesNotContainStateError(): BrowserAuthError;
/**
* Creates an error thrown when the hash string value does not contain known properties
*/
static createHashDoesNotContainKnownPropertiesError(): BrowserAuthError;
/**
* Creates an error thrown when the hash string value is unexpectedly empty.
*/
static createUnableToParseStateError(): BrowserAuthError;
/**
* Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.
*/
static createStateInteractionTypeMismatchError(): BrowserAuthError;
/**
* Creates an error thrown when a browser interaction (redirect or popup) is in progress.
*/
static createInteractionInProgressError(): BrowserAuthError;
/**
* Creates an error thrown when the popup window could not be opened.
* @param errDetail
*/
static createPopupWindowError(errDetail?: string): BrowserAuthError;
/**
* Creates an error thrown when window.open returns an empty window object.
* @param errDetail
*/
static createEmptyWindowCreatedError(): BrowserAuthError;
/**
* Creates an error thrown when the user closes a popup.
*/
static createUserCancelledError(): BrowserAuthError;
/**
* Creates an error thrown when monitorPopupFromHash times out for a given popup.
*/
static createMonitorPopupTimeoutError(): BrowserAuthError;
/**
* Creates an error thrown when monitorIframeFromHash times out for a given iframe.
*/
static createMonitorIframeTimeoutError(): BrowserAuthError;
/**
* Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.
* @param windowParentCheck
*/
static createRedirectInIframeError(windowParentCheck: boolean): BrowserAuthError;
/**
* Creates an error thrown when an auth reload is done inside an iframe.
*/
static createBlockReloadInHiddenIframeError(): BrowserAuthError;
/**
* Creates an error thrown when a popup attempts to call an acquireToken API
* @returns
*/
static createBlockAcquireTokenInPopupsError(): BrowserAuthError;
/**
* Creates an error thrown when an iframe is found to be closed before the timeout is reached.
*/
static createIframeClosedPrematurelyError(): BrowserAuthError;
/**
* Creates an error thrown when the logout API is called on any of the silent interaction clients
*/
static createSilentLogoutUnsupportedError(): BrowserAuthError;
/**
* Creates an error thrown when the account object is not provided in the acquireTokenSilent API.
*/
static createNoAccountError(): BrowserAuthError;
/**
* Creates an error thrown when a given prompt value is invalid for silent requests.
*/
static createSilentPromptValueError(givenPrompt: string): BrowserAuthError;
/**
* Creates an error thrown when the cached token request could not be retrieved from the cache
*/
static createUnableToParseTokenRequestCacheError(): BrowserAuthError;
/**
* Creates an error thrown when the token request could not be retrieved from the cache
*/
static createNoTokenRequestCacheError(): BrowserAuthError;
/**
* Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)
*/
static createAuthRequestNotSetError(): BrowserAuthError;
/**
* Creates an error thrown when the authority could not be retrieved from the cache
*/
static createNoCachedAuthorityError(): BrowserAuthError;
/**
* Creates an error thrown if cache type is invalid.
*/
static createInvalidCacheTypeError(): BrowserAuthError;
/**
* Create an error thrown when login and token requests are made from a non-browser environment
*/
static createNonBrowserEnvironmentError(): BrowserAuthError;
/**
* Create an error thrown when indexDB database is not open
*/
static createDatabaseNotOpenError(): BrowserAuthError;
/**
* Create an error thrown when token fetch fails due to no internet
*/
static createNoNetworkConnectivityError(): BrowserAuthError;
/**
* Create an error thrown when token fetch fails due to reasons other than internet connectivity
*/
static createPostRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError;
/**
* Create an error thrown when get request fails due to reasons other than internet connectivity
*/
static createGetRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError;
/**
* Create an error thrown when network client fails to parse network response
*/
static createFailedToParseNetworkResponseError(endpoint: string): BrowserAuthError;
/**
* Create an error thrown when the necessary information is not available to sideload tokens
*/
static createUnableToLoadTokenError(errorDetail: string): BrowserAuthError;
/**
* Create an error thrown when the queried cryptographic key is not found in IndexedDB
*/
static createSigningKeyNotFoundInStorageError(keyId: string): BrowserAuthError;
/**
* Create an error when an authorization code is required but not provided
*/
static createAuthCodeRequiredError(): BrowserAuthError;
/**
* Create an error when an authorization code or native account ID is required but not provided
*/
static createAuthCodeOrNativeAccountIdRequiredError(): BrowserAuthError;
/**
* Create an error when IndexedDB is unavailable
*/
static createDatabaseUnavailableError(): BrowserAuthError;
/**
* Create an error when native token acquisition is not possible
*/
static createUnableToAcquireTokenFromNativePlatformError(): BrowserAuthError;
/**
* Create an error thrown when Handshake with browser extension times out
*/
static createNativeHandshakeTimeoutError(): BrowserAuthError;
/**
* Create an error thrown when browser extension is not installed
*/
static createNativeExtensionNotInstalledError(): BrowserAuthError;
/**
* Create an error when native connection has not been established
* @returns
*/
static createNativeConnectionNotEstablishedError(): BrowserAuthError;
/**
* Create an error thrown when the initialize function hasn't been called
*/
static createNativeBrokerCalledBeforeInitialize(): BrowserAuthError;
/**
* Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create
* These requests must go through eSTS to ensure eSTS is aware of the new account
*/
static createNativePromptParameterNotSupportedError(): BrowserAuthError;
}
//# sourceMappingURL=BrowserAuthError.d.ts.map
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,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,gBAAgB;IAIzF;;OAEG;IACH,MAAM,CAAC,uCAAuC,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB;IAIlF;;OAEG;IACH,MAAM,CAAC,4BAA4B,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB;IAI1E;;OAEG;IACH,MAAM,CAAC,sCAAsC,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;IAI9E;;OAEG;IACH,MAAM,CAAC,2BAA2B,IAAI,gBAAgB;IAItD;;OAEG;IACH,MAAM,CAAC,4CAA4C,IAAI,gBAAgB;IAIvE;;OAEG;IACH,MAAM,CAAC,8BAA8B,IAAI,gBAAgB;IAIzD;;OAEG;IACH,MAAM,CAAC,iDAAiD,IAAI,gBAAgB;IAI5E;;OAEG;IACH,MAAM,CAAC,iCAAiC,IAAI,gBAAgB;IAI5D;;OAEG;IACH,MAAM,CAAC,sCAAsC,IAAI,gBAAgB;IAIjE;;;OAGG;IACH,MAAM,CAAC,yCAAyC,IAAI,gBAAgB;IAIpE;;OAEG;IACH,MAAM,CAAC,wCAAwC,IAAI,gBAAgB;IAInE;;;OAGG;IACH,MAAM,CAAC,4CAA4C,IAAI,gBAAgB;CAG1E"}
\ No newline at end of file
/*! @azure/msal-browser v2.32.1 2022-12-07 */
'use strict';
import { __extends } from '../_virtual/_tslib.js';
import { StringUtils, AuthError } from '@azure/msal-common';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* BrowserAuthErrorMessage class containing string constants used by error codes and messages.
*/
var BrowserAuthErrorMessage = {
pkceNotGenerated: {
code: "pkce_not_created",
desc: "The PKCE code challenge and verifier could not be generated."
},
cryptoDoesNotExist: {
code: "crypto_nonexistent",
desc: "The crypto object or function is not available."
},
httpMethodNotImplementedError: {
code: "http_method_not_implemented",
desc: "The HTTP method given has not been implemented in this library."
},
emptyNavigateUriError: {
code: "empty_navigate_uri",
desc: "Navigation URI is empty. Please check stack trace for more info."
},
hashEmptyError: {
code: "hash_empty_error",
desc: "Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."
},
hashDoesNotContainStateError: {
code: "no_state_in_hash",
desc: "Hash does not contain state. Please verify that the request originated from msal."
},
hashDoesNotContainKnownPropertiesError: {
code: "hash_does_not_contain_known_properties",
desc: "Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."
},
unableToParseStateError: {
code: "unable_to_parse_state",
desc: "Unable to parse state. Please verify that the request originated from msal."
},
stateInteractionTypeMismatchError: {
code: "state_interaction_type_mismatch",
desc: "Hash contains state but the interaction type does not match the caller."
},
interactionInProgress: {
code: "interaction_in_progress",
desc: "Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."
},
popupWindowError: {
code: "popup_window_error",
desc: "Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."
},
emptyWindowError: {
code: "empty_window_error",
desc: "window.open returned null or undefined window object."
},
userCancelledError: {
code: "user_cancelled",
desc: "User cancelled the flow."
},
monitorPopupTimeoutError: {
code: "monitor_window_timeout",
desc: "Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."
},
monitorIframeTimeoutError: {
code: "monitor_window_timeout",
desc: "Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."
},
redirectInIframeError: {
code: "redirect_in_iframe",
desc: "Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."
},
blockTokenRequestsInHiddenIframeError: {
code: "block_iframe_reload",
desc: "Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"
},
blockAcquireTokenInPopupsError: {
code: "block_nested_popups",
desc: "Request was blocked inside a popup because MSAL detected it was running in a popup."
},
iframeClosedPrematurelyError: {
code: "iframe_closed_prematurely",
desc: "The iframe being monitored was closed prematurely."
},
silentLogoutUnsupportedError: {
code: "silent_logout_unsupported",
desc: "Silent logout not supported. Please call logoutRedirect or logoutPopup instead."
},
noAccountError: {
code: "no_account_error",
desc: "No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."
},
silentPromptValueError: {
code: "silent_prompt_value_error",
desc: "The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."
},
noTokenRequestCacheError: {
code: "no_token_request_cache_error",
desc: "No token request found in cache."
},
unableToParseTokenRequestCacheError: {
code: "unable_to_parse_token_request_cache_error",
desc: "The cached token request could not be parsed."
},
noCachedAuthorityError: {
code: "no_cached_authority_error",
desc: "No cached authority found."
},
authRequestNotSet: {
code: "auth_request_not_set_error",
desc: "Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"
},
invalidCacheType: {
code: "invalid_cache_type",
desc: "Invalid cache type"
},
notInBrowserEnvironment: {
code: "non_browser_environment",
desc: "Login and token requests are not supported in non-browser environments."
},
databaseNotOpen: {
code: "database_not_open",
desc: "Database is not open!"
},
noNetworkConnectivity: {
code: "no_network_connectivity",
desc: "No network connectivity. Check your internet connection."
},
postRequestFailed: {
code: "post_request_failed",
desc: "Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"
},
getRequestFailed: {
code: "get_request_failed",
desc: "Network request failed. Please check the network trace to determine root cause."
},
failedToParseNetworkResponse: {
code: "failed_to_parse_response",
desc: "Failed to parse network response. Check network trace."
},
unableToLoadTokenError: {
code: "unable_to_load_token",
desc: "Error loading token to cache."
},
signingKeyNotFoundInStorage: {
code: "crypto_key_not_found",
desc: "Cryptographic Key or Keypair not found in browser storage."
},
authCodeRequired: {
code: "auth_code_required",
desc: "An authorization code must be provided (as the `code` property on the request) to this flow."
},
authCodeOrNativeAccountRequired: {
code: "auth_code_or_nativeAccountId_required",
desc: "An authorization code or nativeAccountId must be provided to this flow."
},
databaseUnavailable: {
code: "database_unavailable",
desc: "IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."
},
unableToAcquireTokenFromNativePlatform: {
code: "unable_to_acquire_token_from_native_platform",
desc: "Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."
},
nativeHandshakeTimeout: {
code: "native_handshake_timeout",
desc: "Timed out while attempting to establish connection to browser extension"
},
nativeExtensionNotInstalled: {
code: "native_extension_not_installed",
desc: "Native extension is not installed. If you think this is a mistake call the initialize function."
},
nativeConnectionNotEstablished: {
code: "native_connection_not_established",
desc: "Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."
},
nativeBrokerCalledBeforeInitialize: {
code: "native_broker_called_before_initialize",
desc: "You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."
},
nativePromptNotSupported: {
code: "native_prompt_not_supported",
desc: "The provided prompt is not supported by the native platform. This request should be routed to the web based flow."
}
};
/**
* Browser library error class thrown by the MSAL.js library for SPAs
*/
var BrowserAuthError = /** @class */ (function (_super) {
__extends(BrowserAuthError, _super);
function BrowserAuthError(errorCode, errorMessage) {
var _this = _super.call(this, errorCode, errorMessage) || this;
Object.setPrototypeOf(_this, BrowserAuthError.prototype);
_this.name = "BrowserAuthError";
return _this;
}
/**
* Creates an error thrown when PKCE is not implemented.
* @param errDetail
*/
BrowserAuthError.createPkceNotGeneratedError = function (errDetail) {
return new BrowserAuthError(BrowserAuthErrorMessage.pkceNotGenerated.code, BrowserAuthErrorMessage.pkceNotGenerated.desc + " Detail:" + errDetail);
};
/**
* Creates an error thrown when the crypto object is unavailable.
* @param errDetail
*/
BrowserAuthError.createCryptoNotAvailableError = function (errDetail) {
return new BrowserAuthError(BrowserAuthErrorMessage.cryptoDoesNotExist.code, BrowserAuthErrorMessage.cryptoDoesNotExist.desc + " Detail:" + errDetail);
};
/**
* Creates an error thrown when an HTTP method hasn't been implemented by the browser class.
* @param method
*/
BrowserAuthError.createHttpMethodNotImplementedError = function (method) {
return new BrowserAuthError(BrowserAuthErrorMessage.httpMethodNotImplementedError.code, BrowserAuthErrorMessage.httpMethodNotImplementedError.desc + " Given Method: " + method);
};
/**
* Creates an error thrown when the navigation URI is empty.
*/
BrowserAuthError.createEmptyNavigationUriError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.emptyNavigateUriError.code, BrowserAuthErrorMessage.emptyNavigateUriError.desc);
};
/**
* Creates an error thrown when the hash string value is unexpectedly empty.
* @param hashValue
*/
BrowserAuthError.createEmptyHashError = function (hashValue) {
return new BrowserAuthError(BrowserAuthErrorMessage.hashEmptyError.code, BrowserAuthErrorMessage.hashEmptyError.desc + " Given Url: " + hashValue);
};
/**
* Creates an error thrown when the hash string value is unexpectedly empty.
*/
BrowserAuthError.createHashDoesNotContainStateError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainStateError.code, BrowserAuthErrorMessage.hashDoesNotContainStateError.desc);
};
/**
* Creates an error thrown when the hash string value does not contain known properties
*/
BrowserAuthError.createHashDoesNotContainKnownPropertiesError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.code, BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.desc);
};
/**
* Creates an error thrown when the hash string value is unexpectedly empty.
*/
BrowserAuthError.createUnableToParseStateError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseStateError.code, BrowserAuthErrorMessage.unableToParseStateError.desc);
};
/**
* Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.
*/
BrowserAuthError.createStateInteractionTypeMismatchError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.stateInteractionTypeMismatchError.code, BrowserAuthErrorMessage.stateInteractionTypeMismatchError.desc);
};
/**
* Creates an error thrown when a browser interaction (redirect or popup) is in progress.
*/
BrowserAuthError.createInteractionInProgressError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.interactionInProgress.code, BrowserAuthErrorMessage.interactionInProgress.desc);
};
/**
* Creates an error thrown when the popup window could not be opened.
* @param errDetail
*/
BrowserAuthError.createPopupWindowError = function (errDetail) {
var errorMessage = BrowserAuthErrorMessage.popupWindowError.desc;
errorMessage = !StringUtils.isEmpty(errDetail) ? errorMessage + " Details: " + errDetail : errorMessage;
return new BrowserAuthError(BrowserAuthErrorMessage.popupWindowError.code, errorMessage);
};
/**
* Creates an error thrown when window.open returns an empty window object.
* @param errDetail
*/
BrowserAuthError.createEmptyWindowCreatedError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.emptyWindowError.code, BrowserAuthErrorMessage.emptyWindowError.desc);
};
/**
* Creates an error thrown when the user closes a popup.
*/
BrowserAuthError.createUserCancelledError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.userCancelledError.code, BrowserAuthErrorMessage.userCancelledError.desc);
};
/**
* Creates an error thrown when monitorPopupFromHash times out for a given popup.
*/
BrowserAuthError.createMonitorPopupTimeoutError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.monitorPopupTimeoutError.code, BrowserAuthErrorMessage.monitorPopupTimeoutError.desc);
};
/**
* Creates an error thrown when monitorIframeFromHash times out for a given iframe.
*/
BrowserAuthError.createMonitorIframeTimeoutError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code, BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);
};
/**
* Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.
* @param windowParentCheck
*/
BrowserAuthError.createRedirectInIframeError = function (windowParentCheck) {
return new BrowserAuthError(BrowserAuthErrorMessage.redirectInIframeError.code, BrowserAuthErrorMessage.redirectInIframeError.desc + " (window.parent !== window) => " + windowParentCheck);
};
/**
* Creates an error thrown when an auth reload is done inside an iframe.
*/
BrowserAuthError.createBlockReloadInHiddenIframeError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.code, BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.desc);
};
/**
* Creates an error thrown when a popup attempts to call an acquireToken API
* @returns
*/
BrowserAuthError.createBlockAcquireTokenInPopupsError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.code, BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.desc);
};
/**
* Creates an error thrown when an iframe is found to be closed before the timeout is reached.
*/
BrowserAuthError.createIframeClosedPrematurelyError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.iframeClosedPrematurelyError.code, BrowserAuthErrorMessage.iframeClosedPrematurelyError.desc);
};
/**
* Creates an error thrown when the logout API is called on any of the silent interaction clients
*/
BrowserAuthError.createSilentLogoutUnsupportedError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.silentLogoutUnsupportedError.code, BrowserAuthErrorMessage.silentLogoutUnsupportedError.desc);
};
/**
* Creates an error thrown when the account object is not provided in the acquireTokenSilent API.
*/
BrowserAuthError.createNoAccountError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.noAccountError.code, BrowserAuthErrorMessage.noAccountError.desc);
};
/**
* Creates an error thrown when a given prompt value is invalid for silent requests.
*/
BrowserAuthError.createSilentPromptValueError = function (givenPrompt) {
return new BrowserAuthError(BrowserAuthErrorMessage.silentPromptValueError.code, BrowserAuthErrorMessage.silentPromptValueError.desc + " Given value: " + givenPrompt);
};
/**
* Creates an error thrown when the cached token request could not be retrieved from the cache
*/
BrowserAuthError.createUnableToParseTokenRequestCacheError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.code, BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.desc);
};
/**
* Creates an error thrown when the token request could not be retrieved from the cache
*/
BrowserAuthError.createNoTokenRequestCacheError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.noTokenRequestCacheError.code, BrowserAuthErrorMessage.noTokenRequestCacheError.desc);
};
/**
* Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)
*/
BrowserAuthError.createAuthRequestNotSetError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.authRequestNotSet.code, BrowserAuthErrorMessage.authRequestNotSet.desc);
};
/**
* Creates an error thrown when the authority could not be retrieved from the cache
*/
BrowserAuthError.createNoCachedAuthorityError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.noCachedAuthorityError.code, BrowserAuthErrorMessage.noCachedAuthorityError.desc);
};
/**
* Creates an error thrown if cache type is invalid.
*/
BrowserAuthError.createInvalidCacheTypeError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.invalidCacheType.code, "" + BrowserAuthErrorMessage.invalidCacheType.desc);
};
/**
* Create an error thrown when login and token requests are made from a non-browser environment
*/
BrowserAuthError.createNonBrowserEnvironmentError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.notInBrowserEnvironment.code, BrowserAuthErrorMessage.notInBrowserEnvironment.desc);
};
/**
* Create an error thrown when indexDB database is not open
*/
BrowserAuthError.createDatabaseNotOpenError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.databaseNotOpen.code, BrowserAuthErrorMessage.databaseNotOpen.desc);
};
/**
* Create an error thrown when token fetch fails due to no internet
*/
BrowserAuthError.createNoNetworkConnectivityError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.noNetworkConnectivity.code, BrowserAuthErrorMessage.noNetworkConnectivity.desc);
};
/**
* Create an error thrown when token fetch fails due to reasons other than internet connectivity
*/
BrowserAuthError.createPostRequestFailedError = function (errorDesc, endpoint) {
return new BrowserAuthError(BrowserAuthErrorMessage.postRequestFailed.code, BrowserAuthErrorMessage.postRequestFailed.desc + " | Network client threw: " + errorDesc + " | Attempted to reach: " + endpoint.split("?")[0]);
};
/**
* Create an error thrown when get request fails due to reasons other than internet connectivity
*/
BrowserAuthError.createGetRequestFailedError = function (errorDesc, endpoint) {
return new BrowserAuthError(BrowserAuthErrorMessage.getRequestFailed.code, BrowserAuthErrorMessage.getRequestFailed.desc + " | Network client threw: " + errorDesc + " | Attempted to reach: " + endpoint.split("?")[0]);
};
/**
* Create an error thrown when network client fails to parse network response
*/
BrowserAuthError.createFailedToParseNetworkResponseError = function (endpoint) {
return new BrowserAuthError(BrowserAuthErrorMessage.failedToParseNetworkResponse.code, BrowserAuthErrorMessage.failedToParseNetworkResponse.desc + " | Attempted to reach: " + endpoint.split("?")[0]);
};
/**
* Create an error thrown when the necessary information is not available to sideload tokens
*/
BrowserAuthError.createUnableToLoadTokenError = function (errorDetail) {
return new BrowserAuthError(BrowserAuthErrorMessage.unableToLoadTokenError.code, BrowserAuthErrorMessage.unableToLoadTokenError.desc + " | " + errorDetail);
};
/**
* Create an error thrown when the queried cryptographic key is not found in IndexedDB
*/
BrowserAuthError.createSigningKeyNotFoundInStorageError = function (keyId) {
return new BrowserAuthError(BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code, BrowserAuthErrorMessage.signingKeyNotFoundInStorage.desc + " | No match found for KeyId: " + keyId);
};
/**
* Create an error when an authorization code is required but not provided
*/
BrowserAuthError.createAuthCodeRequiredError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.authCodeRequired.code, BrowserAuthErrorMessage.authCodeRequired.desc);
};
/**
* Create an error when an authorization code or native account ID is required but not provided
*/
BrowserAuthError.createAuthCodeOrNativeAccountIdRequiredError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.code, BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.desc);
};
/**
* Create an error when IndexedDB is unavailable
*/
BrowserAuthError.createDatabaseUnavailableError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.databaseUnavailable.code, BrowserAuthErrorMessage.databaseUnavailable.desc);
};
/**
* Create an error when native token acquisition is not possible
*/
BrowserAuthError.createUnableToAcquireTokenFromNativePlatformError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.code, BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.desc);
};
/**
* Create an error thrown when Handshake with browser extension times out
*/
BrowserAuthError.createNativeHandshakeTimeoutError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.nativeHandshakeTimeout.code, BrowserAuthErrorMessage.nativeHandshakeTimeout.desc);
};
/**
* Create an error thrown when browser extension is not installed
*/
BrowserAuthError.createNativeExtensionNotInstalledError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.nativeExtensionNotInstalled.code, BrowserAuthErrorMessage.nativeExtensionNotInstalled.desc);
};
/**
* Create an error when native connection has not been established
* @returns
*/
BrowserAuthError.createNativeConnectionNotEstablishedError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.nativeConnectionNotEstablished.code, BrowserAuthErrorMessage.nativeConnectionNotEstablished.desc);
};
/**
* Create an error thrown when the initialize function hasn't been called
*/
BrowserAuthError.createNativeBrokerCalledBeforeInitialize = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.code, BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.desc);
};
/**
* Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create
* These requests must go through eSTS to ensure eSTS is aware of the new account
*/
BrowserAuthError.createNativePromptParameterNotSupportedError = function () {
return new BrowserAuthError(BrowserAuthErrorMessage.nativePromptNotSupported.code, BrowserAuthErrorMessage.nativePromptNotSupported.desc);
};
return BrowserAuthError;
}(AuthError));
export { BrowserAuthError, BrowserAuthErrorMessage };
//# sourceMappingURL=BrowserAuthError.js.map
{"version":3,"file":"BrowserAuthError.js","sources":["../../src/error/BrowserAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError, StringUtils } from \"@azure/msal-common\";\n\n/**\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const BrowserAuthErrorMessage = {\n pkceNotGenerated: {\n code: \"pkce_not_created\",\n desc: \"The PKCE code challenge and verifier could not be generated.\"\n },\n cryptoDoesNotExist: {\n code: \"crypto_nonexistent\",\n desc: \"The crypto object or function is not available.\"\n },\n httpMethodNotImplementedError: {\n code: \"http_method_not_implemented\",\n desc: \"The HTTP method given has not been implemented in this library.\"\n },\n emptyNavigateUriError: {\n code: \"empty_navigate_uri\",\n desc: \"Navigation URI is empty. Please check stack trace for more info.\"\n },\n hashEmptyError: {\n code: \"hash_empty_error\",\n desc: \"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n hashDoesNotContainStateError: {\n code: \"no_state_in_hash\",\n desc: \"Hash does not contain state. Please verify that the request originated from msal.\"\n },\n hashDoesNotContainKnownPropertiesError: {\n code: \"hash_does_not_contain_known_properties\",\n desc: \"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n unableToParseStateError: {\n code: \"unable_to_parse_state\",\n desc: \"Unable to parse state. Please verify that the request originated from msal.\"\n },\n stateInteractionTypeMismatchError: {\n code: \"state_interaction_type_mismatch\",\n desc: \"Hash contains state but the interaction type does not match the caller.\"\n },\n interactionInProgress: {\n code: \"interaction_in_progress\",\n desc: \"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n popupWindowError: {\n code: \"popup_window_error\",\n desc: \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"\n },\n emptyWindowError: {\n code: \"empty_window_error\",\n desc: \"window.open returned null or undefined window object.\"\n },\n userCancelledError: {\n code: \"user_cancelled\",\n desc: \"User cancelled the flow.\"\n },\n monitorPopupTimeoutError: {\n code: \"monitor_window_timeout\",\n desc: \"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n monitorIframeTimeoutError: {\n code: \"monitor_window_timeout\",\n desc: \"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n redirectInIframeError: {\n code: \"redirect_in_iframe\",\n desc: \"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.\"\n },\n blockTokenRequestsInHiddenIframeError: {\n code: \"block_iframe_reload\",\n desc: \"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors\"\n },\n blockAcquireTokenInPopupsError: {\n code: \"block_nested_popups\",\n desc: \"Request was blocked inside a popup because MSAL detected it was running in a popup.\"\n },\n iframeClosedPrematurelyError: {\n code: \"iframe_closed_prematurely\",\n desc: \"The iframe being monitored was closed prematurely.\"\n },\n silentLogoutUnsupportedError: {\n code: \"silent_logout_unsupported\",\n desc: \"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.\"\n },\n noAccountError: {\n code: \"no_account_error\",\n desc: \"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.\"\n },\n silentPromptValueError: {\n code: \"silent_prompt_value_error\",\n desc: \"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.\"\n },\n noTokenRequestCacheError: {\n code: \"no_token_request_cache_error\",\n desc: \"No token request found in cache.\"\n },\n unableToParseTokenRequestCacheError: {\n code: \"unable_to_parse_token_request_cache_error\",\n desc: \"The cached token request could not be parsed.\"\n },\n noCachedAuthorityError: {\n code: \"no_cached_authority_error\",\n desc: \"No cached authority found.\"\n },\n authRequestNotSet: {\n code: \"auth_request_not_set_error\",\n desc: \"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler\"\n },\n invalidCacheType: {\n code: \"invalid_cache_type\",\n desc: \"Invalid cache type\"\n },\n notInBrowserEnvironment: {\n code: \"non_browser_environment\",\n desc: \"Login and token requests are not supported in non-browser environments.\"\n },\n databaseNotOpen: {\n code: \"database_not_open\",\n desc: \"Database is not open!\"\n },\n noNetworkConnectivity: {\n code: \"no_network_connectivity\",\n desc: \"No network connectivity. Check your internet connection.\"\n },\n postRequestFailed: {\n code: \"post_request_failed\",\n desc: \"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'\"\n },\n getRequestFailed: {\n code: \"get_request_failed\",\n desc: \"Network request failed. Please check the network trace to determine root cause.\"\n },\n failedToParseNetworkResponse: {\n code: \"failed_to_parse_response\",\n desc: \"Failed to parse network response. Check network trace.\"\n },\n unableToLoadTokenError: {\n code: \"unable_to_load_token\",\n desc: \"Error loading token to cache.\"\n },\n signingKeyNotFoundInStorage: {\n code: \"crypto_key_not_found\",\n desc: \"Cryptographic Key or Keypair not found in browser storage.\"\n },\n authCodeRequired: {\n code: \"auth_code_required\",\n desc: \"An authorization code must be provided (as the `code` property on the request) to this flow.\"\n },\n authCodeOrNativeAccountRequired: {\n code: \"auth_code_or_nativeAccountId_required\",\n desc: \"An authorization code or nativeAccountId must be provided to this flow.\"\n },\n databaseUnavailable: {\n code: \"database_unavailable\",\n desc: \"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.\"\n },\n unableToAcquireTokenFromNativePlatform: {\n code: \"unable_to_acquire_token_from_native_platform\",\n desc: \"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors.\"\n },\n nativeHandshakeTimeout: {\n code: \"native_handshake_timeout\",\n desc: \"Timed out while attempting to establish connection to browser extension\"\n },\n nativeExtensionNotInstalled: {\n code: \"native_extension_not_installed\",\n desc: \"Native extension is not installed. If you think this is a mistake call the initialize function.\"\n },\n nativeConnectionNotEstablished: {\n code: \"native_connection_not_established\",\n desc: \"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors.\"\n },\n nativeBrokerCalledBeforeInitialize: {\n code: \"native_broker_called_before_initialize\",\n desc: \"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors.\"\n },\n nativePromptNotSupported: {\n code: \"native_prompt_not_supported\",\n desc: \"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.\"\n }\n};\n\n/**\n * Browser library error class thrown by the MSAL.js library for SPAs\n */\nexport class BrowserAuthError extends AuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n\n Object.setPrototypeOf(this, BrowserAuthError.prototype);\n this.name = \"BrowserAuthError\";\n }\n\n /**\n * Creates an error thrown when PKCE is not implemented.\n * @param errDetail\n */\n static createPkceNotGeneratedError(errDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.pkceNotGenerated.code,\n `${BrowserAuthErrorMessage.pkceNotGenerated.desc} Detail:${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the crypto object is unavailable.\n * @param errDetail\n */\n static createCryptoNotAvailableError(errDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.cryptoDoesNotExist.code,\n `${BrowserAuthErrorMessage.cryptoDoesNotExist.desc} Detail:${errDetail}`);\n }\n\n /**\n * Creates an error thrown when an HTTP method hasn't been implemented by the browser class.\n * @param method\n */\n static createHttpMethodNotImplementedError(method: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.httpMethodNotImplementedError.code,\n `${BrowserAuthErrorMessage.httpMethodNotImplementedError.desc} Given Method: ${method}`);\n }\n\n /**\n * Creates an error thrown when the navigation URI is empty.\n */\n static createEmptyNavigationUriError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyNavigateUriError.code, BrowserAuthErrorMessage.emptyNavigateUriError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n * @param hashValue\n */\n static createEmptyHashError(hashValue: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashEmptyError.code, `${BrowserAuthErrorMessage.hashEmptyError.desc} Given Url: ${hashValue}`);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n */\n static createHashDoesNotContainStateError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainStateError.code, BrowserAuthErrorMessage.hashDoesNotContainStateError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value does not contain known properties\n */\n static createHashDoesNotContainKnownPropertiesError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.code, BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n */\n static createUnableToParseStateError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseStateError.code, BrowserAuthErrorMessage.unableToParseStateError.desc);\n }\n\n /**\n * Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.\n */\n static createStateInteractionTypeMismatchError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.stateInteractionTypeMismatchError.code, BrowserAuthErrorMessage.stateInteractionTypeMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when a browser interaction (redirect or popup) is in progress.\n */\n static createInteractionInProgressError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.interactionInProgress.code, BrowserAuthErrorMessage.interactionInProgress.desc);\n }\n\n /**\n * Creates an error thrown when the popup window could not be opened.\n * @param errDetail\n */\n static createPopupWindowError(errDetail?: string): BrowserAuthError {\n let errorMessage = BrowserAuthErrorMessage.popupWindowError.desc;\n errorMessage = !StringUtils.isEmpty(errDetail) ? `${errorMessage} Details: ${errDetail}` : errorMessage;\n return new BrowserAuthError(BrowserAuthErrorMessage.popupWindowError.code, errorMessage);\n }\n\n /**\n * Creates an error thrown when window.open returns an empty window object.\n * @param errDetail\n */\n static createEmptyWindowCreatedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyWindowError.code, BrowserAuthErrorMessage.emptyWindowError.desc);\n }\n\n /**\n * Creates an error thrown when the user closes a popup.\n */\n static createUserCancelledError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.userCancelledError.code,\n BrowserAuthErrorMessage.userCancelledError.desc);\n }\n\n /**\n * Creates an error thrown when monitorPopupFromHash times out for a given popup.\n */\n static createMonitorPopupTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorPopupTimeoutError.code,\n BrowserAuthErrorMessage.monitorPopupTimeoutError.desc);\n }\n\n /**\n * Creates an error thrown when monitorIframeFromHash times out for a given iframe.\n */\n static createMonitorIframeTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code,\n BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);\n }\n\n /**\n * Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.\n * @param windowParentCheck\n */\n static createRedirectInIframeError(windowParentCheck: boolean): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.redirectInIframeError.code,\n `${BrowserAuthErrorMessage.redirectInIframeError.desc} (window.parent !== window) => ${windowParentCheck}`);\n }\n\n /**\n * Creates an error thrown when an auth reload is done inside an iframe.\n */\n static createBlockReloadInHiddenIframeError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.code,\n BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.desc);\n }\n\n /**\n * Creates an error thrown when a popup attempts to call an acquireToken API\n * @returns\n */\n static createBlockAcquireTokenInPopupsError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.code,\n BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.desc);\n }\n\n /**\n * Creates an error thrown when an iframe is found to be closed before the timeout is reached.\n */\n static createIframeClosedPrematurelyError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.iframeClosedPrematurelyError.code, BrowserAuthErrorMessage.iframeClosedPrematurelyError.desc);\n }\n\n /**\n * Creates an error thrown when the logout API is called on any of the silent interaction clients\n */\n static createSilentLogoutUnsupportedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.silentLogoutUnsupportedError.code, BrowserAuthErrorMessage.silentLogoutUnsupportedError.desc);\n }\n\n /**\n * Creates an error thrown when the account object is not provided in the acquireTokenSilent API.\n */\n static createNoAccountError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noAccountError.code, BrowserAuthErrorMessage.noAccountError.desc);\n }\n\n /**\n * Creates an error thrown when a given prompt value is invalid for silent requests.\n */\n static createSilentPromptValueError(givenPrompt: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.silentPromptValueError.code, `${BrowserAuthErrorMessage.silentPromptValueError.desc} Given value: ${givenPrompt}`);\n }\n\n /**\n * Creates an error thrown when the cached token request could not be retrieved from the cache\n */\n static createUnableToParseTokenRequestCacheError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.code,\n BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.desc);\n }\n\n /**\n * Creates an error thrown when the token request could not be retrieved from the cache\n */\n static createNoTokenRequestCacheError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noTokenRequestCacheError.code,\n BrowserAuthErrorMessage.noTokenRequestCacheError.desc);\n }\n\n /**\n * Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)\n */\n static createAuthRequestNotSetError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authRequestNotSet.code,\n BrowserAuthErrorMessage.authRequestNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the authority could not be retrieved from the cache\n */\n static createNoCachedAuthorityError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noCachedAuthorityError.code,\n BrowserAuthErrorMessage.noCachedAuthorityError.desc);\n }\n\n /**\n * Creates an error thrown if cache type is invalid.\n */\n static createInvalidCacheTypeError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.invalidCacheType.code, `${BrowserAuthErrorMessage.invalidCacheType.desc}`);\n }\n\n /**\n * Create an error thrown when login and token requests are made from a non-browser environment\n */\n static createNonBrowserEnvironmentError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.notInBrowserEnvironment.code, BrowserAuthErrorMessage.notInBrowserEnvironment.desc);\n }\n\n /**\n * Create an error thrown when indexDB database is not open\n */\n static createDatabaseNotOpenError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseNotOpen.code, BrowserAuthErrorMessage.databaseNotOpen.desc);\n }\n\n /**\n * Create an error thrown when token fetch fails due to no internet\n */\n static createNoNetworkConnectivityError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noNetworkConnectivity.code, BrowserAuthErrorMessage.noNetworkConnectivity.desc);\n }\n\n /**\n * Create an error thrown when token fetch fails due to reasons other than internet connectivity\n */\n static createPostRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.postRequestFailed.code, `${BrowserAuthErrorMessage.postRequestFailed.desc} | Network client threw: ${errorDesc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when get request fails due to reasons other than internet connectivity\n */\n static createGetRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.getRequestFailed.code, `${BrowserAuthErrorMessage.getRequestFailed.desc} | Network client threw: ${errorDesc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when network client fails to parse network response\n */\n static createFailedToParseNetworkResponseError(endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.failedToParseNetworkResponse.code, `${BrowserAuthErrorMessage.failedToParseNetworkResponse.desc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when the necessary information is not available to sideload tokens\n */\n static createUnableToLoadTokenError(errorDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToLoadTokenError.code, `${BrowserAuthErrorMessage.unableToLoadTokenError.desc} | ${errorDetail}`);\n }\n\n /**\n * Create an error thrown when the queried cryptographic key is not found in IndexedDB\n */\n static createSigningKeyNotFoundInStorageError(keyId: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code, `${BrowserAuthErrorMessage.signingKeyNotFoundInStorage.desc} | No match found for KeyId: ${keyId}`);\n }\n\n /**\n * Create an error when an authorization code is required but not provided\n */\n static createAuthCodeRequiredError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeRequired.code, BrowserAuthErrorMessage.authCodeRequired.desc);\n }\n\n /**\n * Create an error when an authorization code or native account ID is required but not provided\n */\n static createAuthCodeOrNativeAccountIdRequiredError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.code, BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.desc);\n }\n\n /**\n * Create an error when IndexedDB is unavailable\n */\n static createDatabaseUnavailableError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseUnavailable.code, BrowserAuthErrorMessage.databaseUnavailable.desc);\n }\n\n /**\n * Create an error when native token acquisition is not possible\n */\n static createUnableToAcquireTokenFromNativePlatformError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.code, BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.desc);\n }\n\n /**\n * Create an error thrown when Handshake with browser extension times out\n */\n static createNativeHandshakeTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeHandshakeTimeout.code, BrowserAuthErrorMessage.nativeHandshakeTimeout.desc);\n }\n\n /**\n * Create an error thrown when browser extension is not installed\n */\n static createNativeExtensionNotInstalledError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeExtensionNotInstalled.code, BrowserAuthErrorMessage.nativeExtensionNotInstalled.desc);\n }\n\n /**\n * Create an error when native connection has not been established\n * @returns\n */\n static createNativeConnectionNotEstablishedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeConnectionNotEstablished.code, BrowserAuthErrorMessage.nativeConnectionNotEstablished.desc);\n }\n\n /**\n * Create an error thrown when the initialize function hasn't been called\n */\n static createNativeBrokerCalledBeforeInitialize(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.code, BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.desc);\n }\n\n /**\n * Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create\n * These requests must go through eSTS to ensure eSTS is aware of the new account\n */\n static createNativePromptParameterNotSupportedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativePromptNotSupported.code, BrowserAuthErrorMessage.nativePromptNotSupported.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,uBAAuB,GAAG;IACnC,gBAAgB,EAAE;QACd,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,8DAA8D;KACvE;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,iDAAiD;KAC1D;IACD,6BAA6B,EAAE;QAC3B,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,iEAAiE;KAC1E;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,kEAAkE;KAC3E;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,iKAAiK;KAC1K;IACD,4BAA4B,EAAE;QAC1B,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,mFAAmF;KAC5F;IACD,sCAAsC,EAAE;QACpC,IAAI,EAAE,wCAAwC;QAC9C,IAAI,EAAE,qJAAqJ;KAC9J;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CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;KACzI;;;;IAKM,uDAAsC,GAA7C;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,2BAA2B,CAAC,IAAI,EAAE,uBAAuB,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;KACnJ;;;;;IAMM,0DAAyC,GAAhD;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,8BAA8B,CAAC,IAAI,EAAE,uBAAuB,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC;KACzJ;;;;IAKM,yDAAwC,GAA/C;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,kCAAkC,CAAC,IAAI,EAAE,uBAAuB,CAAC,kCAAkC,CAAC,IAAI,CAAC,CAAC;KACjK;;;;;IAMM,6DAA4C,GAAnD;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,IAAI,EAAE,uBAAuB,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;KAC7I;IACL,uBAAC;AAAD,CArVA,CAAsC,SAAS;;;;"}
\ No newline at end of file
import { AuthError } from "@azure/msal-common";
/**
* BrowserAuthErrorMessage class containing string constants used by error codes and messages.
*/
export declare const BrowserConfigurationAuthErrorMessage: {
redirectUriNotSet: {
code: string;
desc: string;
};
postLogoutUriNotSet: {
code: string;
desc: string;
};
storageNotSupportedError: {
code: string;
desc: string;
};
noRedirectCallbacksSet: {
code: string;
desc: string;
};
invalidCallbackObject: {
code: string;
desc: string;
};
stubPcaInstanceCalled: {
code: string;
desc: string;
};
inMemRedirectUnavailable: {
code: string;
desc: string;
};
entropyNotProvided: {
code: string;
desc: string;
};
};
/**
* Browser library error class thrown by the MSAL.js library for SPAs
*/
export declare class BrowserConfigurationAuthError extends AuthError {
constructor(errorCode: string, errorMessage?: string);
/**
* Creates an error thrown when the redirect uri is empty (not set by caller)
*/
static createRedirectUriEmptyError(): BrowserConfigurationAuthError;
/**
* Creates an error thrown when the post-logout redirect uri is empty (not set by caller)
*/
static createPostLogoutRedirectUriEmptyError(): BrowserConfigurationAuthError;
/**
* Creates error thrown when given storage location is not supported.
* @param givenStorageLocation
*/
static createStorageNotSupportedError(givenStorageLocation: string): BrowserConfigurationAuthError;
/**
* Creates error thrown when redirect callbacks are not set before calling loginRedirect() or acquireTokenRedirect().
*/
static createRedirectCallbacksNotSetError(): BrowserConfigurationAuthError;
/**
* Creates error thrown when the stub instance of PublicClientApplication is called.
*/
static createStubPcaInstanceCalledError(): BrowserConfigurationAuthError;
static createInMemoryRedirectUnavailableError(): BrowserConfigurationAuthError;
/**
* Creates an error thrown when a crypto interface that requires entropy is initialized without entropy
*/
static createEntropyNotProvided(): BrowserConfigurationAuthError;
}
//# sourceMappingURL=BrowserConfigurationAuthError.d.ts.map
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment