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

Initial commit

parents
{"version":3,"file":"ICrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/ICrypto.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;GAIG;AACH,oBAAY,SAAS,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAC;AAEF,oBAAY,2BAA2B,GAAG,IAAI,CAAC,eAAe,EAAE,uBAAuB,GAAG,oBAAoB,GAAG,WAAW,GAAG,UAAU,CAAE,GAAG;IAC1I,aAAa,CAAC,EAAE,MAAM,CAAA;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,OAAO;IACpB;;OAEG;IACH,aAAa,IAAI,MAAM,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC;;OAEG;IACH,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IACxC;;;OAGG;IACH,sBAAsB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9E;;;OAGG;IACH,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1F;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,6BAA6B,EAAE,OAqC3C,CAAC"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __awaiter, __generator } from '../_virtual/_tslib.js';
import { AuthError } from '../error/AuthError.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var DEFAULT_CRYPTO_IMPLEMENTATION = {
createNewGuid: function () {
var notImplErr = "Crypto interface - createNewGuid() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
},
base64Decode: function () {
var notImplErr = "Crypto interface - base64Decode() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
},
base64Encode: function () {
var notImplErr = "Crypto interface - base64Encode() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
},
generatePkceCodes: function () {
return __awaiter(this, void 0, void 0, function () {
var notImplErr;
return __generator(this, function (_a) {
notImplErr = "Crypto interface - generatePkceCodes() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
});
});
},
getPublicKeyThumbprint: function () {
return __awaiter(this, void 0, void 0, function () {
var notImplErr;
return __generator(this, function (_a) {
notImplErr = "Crypto interface - getPublicKeyThumbprint() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
});
});
},
removeTokenBindingKey: function () {
return __awaiter(this, void 0, void 0, function () {
var notImplErr;
return __generator(this, function (_a) {
notImplErr = "Crypto interface - removeTokenBindingKey() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
});
});
},
clearKeystore: function () {
return __awaiter(this, void 0, void 0, function () {
var notImplErr;
return __generator(this, function (_a) {
notImplErr = "Crypto interface - clearKeystore() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
});
});
},
signJwt: function () {
return __awaiter(this, void 0, void 0, function () {
var notImplErr;
return __generator(this, function (_a) {
notImplErr = "Crypto interface - signJwt() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
});
});
},
hashString: function () {
return __awaiter(this, void 0, void 0, function () {
var notImplErr;
return __generator(this, function (_a) {
notImplErr = "Crypto interface - hashString() has not been implemented";
throw AuthError.createUnexpectedError(notImplErr);
});
});
}
};
export { DEFAULT_CRYPTO_IMPLEMENTATION };
//# sourceMappingURL=ICrypto.js.map
{"version":3,"file":"ICrypto.js","sources":["../../src/crypto/ICrypto.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"../error/AuthError\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\nimport { SignedHttpRequest } from \"./SignedHttpRequest\";\n\n/**\n * The PkceCodes type describes the structure\n * of objects that contain PKCE code\n * challenge and verifier pairs\n */\nexport type PkceCodes = {\n verifier: string,\n challenge: string\n};\n\nexport type SignedHttpRequestParameters = Pick<BaseAuthRequest, \"resourceRequestMethod\" | \"resourceRequestUri\" | \"shrClaims\" | \"shrNonce\" > & {\n correlationId?: string\n};\n\n/**\n * Interface for crypto functions used by library\n */\nexport interface ICrypto {\n /**\n * Creates a guid randomly.\n */\n createNewGuid(): string;\n /**\n * base64 Encode string\n * @param input \n */\n base64Encode(input: string): string;\n /**\n * base64 decode string\n * @param input \n */\n base64Decode(input: string): string;\n /**\n * Generate PKCE codes for OAuth. See RFC here: https://tools.ietf.org/html/rfc7636\n */\n generatePkceCodes(): Promise<PkceCodes>;\n /**\n * Generates an JWK RSA S256 Thumbprint\n * @param request\n */\n getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string>;\n /**\n * Removes cryptographic keypair from key store matching the keyId passed in\n * @param kid \n */\n removeTokenBindingKey(kid: string): Promise<boolean>;\n /**\n * Removes all cryptographic keys from IndexedDB storage\n */\n clearKeystore(): Promise<boolean>;\n /** \n * Returns a signed proof-of-possession token with a given acces token that contains a cnf claim with the required kid.\n * @param accessToken \n */\n signJwt(payload: SignedHttpRequest, kid: string, correlationId?: string): Promise<string>;\n /**\n * Returns the SHA-256 hash of an input string\n * @param plainText\n */\n hashString(plainText: string): Promise<string>;\n}\n\nexport const DEFAULT_CRYPTO_IMPLEMENTATION: ICrypto = {\n createNewGuid: (): string => {\n const notImplErr = \"Crypto interface - createNewGuid() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n base64Decode: (): string => {\n const notImplErr = \"Crypto interface - base64Decode() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n base64Encode: (): string => {\n const notImplErr = \"Crypto interface - base64Encode() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async generatePkceCodes(): Promise<PkceCodes> {\n const notImplErr = \"Crypto interface - generatePkceCodes() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async getPublicKeyThumbprint(): Promise<string> {\n const notImplErr = \"Crypto interface - getPublicKeyThumbprint() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async removeTokenBindingKey(): Promise<boolean> {\n const notImplErr = \"Crypto interface - removeTokenBindingKey() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async clearKeystore(): Promise<boolean> {\n const notImplErr = \"Crypto interface - clearKeystore() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async signJwt(): Promise<string> {\n const notImplErr = \"Crypto interface - signJwt() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async hashString(): Promise<string> {\n const notImplErr = \"Crypto interface - hashString() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n};\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAoEU,IAAA,6BAA6B,GAAY;AAClD,IAAA,aAAa,EAAE,YAAA;QACX,IAAM,UAAU,GAAG,6DAA6D,CAAC;AACjF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,YAAY,EAAE,YAAA;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,YAAY,EAAE,YAAA;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACK,IAAA,iBAAiB,EAAvB,YAAA;;;;gBACU,UAAU,GAAG,iEAAiE,CAAC;AACrF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,sBAAsB,EAA5B,YAAA;;;;gBACU,UAAU,GAAG,sEAAsE,CAAC;AAC1F,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,qBAAqB,EAA3B,YAAA;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;AACzF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,aAAa,EAAnB,YAAA;;;;gBACU,UAAU,GAAG,6DAA6D,CAAC;AACjF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,OAAO,EAAb,YAAA;;;;gBACU,UAAU,GAAG,uDAAuD,CAAC;AAC3E,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,UAAU,EAAhB,YAAA;;;;gBACU,UAAU,GAAG,0DAA0D,CAAC;AAC9E,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;;;;;"}
\ No newline at end of file
{"version":3,"file":"IGuidGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/IGuidGenerator.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc;IAC3B,YAAY,IAAI,MAAM,CAAC;IACvB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC"}
\ No newline at end of file
{"version":3,"file":"JoseHeader.d.ts","sourceRoot":"","sources":["../../src/crypto/JoseHeader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,oBAAY,iBAAiB,GAAG;IAC5B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,qBAAa,UAAU;IACZ,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;gBAEP,OAAO,EAAE,iBAAiB;IAMvC;;;;;;;OAOG;IACH,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,MAAM;CAoBzE"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { JoseHeaderError } from '../error/JoseHeaderError.js';
import { JsonTypes } from '../utils/Constants.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var JoseHeader = /** @class */ (function () {
function JoseHeader(options) {
this.typ = options.typ;
this.alg = options.alg;
this.kid = options.kid;
}
/**
* Builds SignedHttpRequest formatted JOSE Header from the
* JOSE Header options provided or previously set on the object and returns
* the stringified header object.
* Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
* @param shrHeaderOptions
* @returns
*/
JoseHeader.getShrHeaderString = function (shrHeaderOptions) {
// KeyID is required on the SHR header
if (!shrHeaderOptions.kid) {
throw JoseHeaderError.createMissingKidError();
}
// Alg is required on the SHR header
if (!shrHeaderOptions.alg) {
throw JoseHeaderError.createMissingAlgError();
}
var shrHeader = new JoseHeader({
// Access Token PoP headers must have type JWT, but the type header can be overriden for special cases
typ: shrHeaderOptions.typ || JsonTypes.Jwt,
kid: shrHeaderOptions.kid,
alg: shrHeaderOptions.alg
});
return JSON.stringify(shrHeader);
};
return JoseHeader;
}());
export { JoseHeader };
//# sourceMappingURL=JoseHeader.js.map
{"version":3,"file":"JoseHeader.js","sources":["../../src/crypto/JoseHeader.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { JoseHeaderError } from \"../error/JoseHeaderError\";\nimport { JsonTypes } from \"../utils/Constants\";\n\nexport type JoseHeaderOptions = {\n typ?: JsonTypes,\n alg?: string,\n kid?: string\n};\n\nexport class JoseHeader {\n public typ?: JsonTypes;\n public alg?: string;\n public kid?: string;\n\n constructor (options: JoseHeaderOptions) {\n this.typ = options.typ;\n this.alg = options.alg;\n this.kid = options.kid;\n }\n\n /**\n * Builds SignedHttpRequest formatted JOSE Header from the\n * JOSE Header options provided or previously set on the object and returns\n * the stringified header object.\n * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.\n * @param shrHeaderOptions \n * @returns \n */\n static getShrHeaderString(shrHeaderOptions: JoseHeaderOptions): string {\n // KeyID is required on the SHR header\n if (!shrHeaderOptions.kid) {\n throw JoseHeaderError.createMissingKidError();\n }\n\n // Alg is required on the SHR header\n if (!shrHeaderOptions.alg) {\n throw JoseHeaderError.createMissingAlgError();\n }\n\n const shrHeader = new JoseHeader({\n // Access Token PoP headers must have type JWT, but the type header can be overriden for special cases\n typ: shrHeaderOptions.typ || JsonTypes.Jwt,\n kid: shrHeaderOptions.kid,\n alg: shrHeaderOptions.alg\n });\n\n return JSON.stringify(shrHeader);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAWH,IAAA,UAAA,kBAAA,YAAA;AAKI,IAAA,SAAA,UAAA,CAAa,OAA0B,EAAA;AACnC,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,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AIhC;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC;IAW5E;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IASxE;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7G;;;;;;;OAOG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAmB5H"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
import { TimeUtils } from '../utils/TimeUtils.js';
import { UrlString } from '../url/UrlString.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
var KeyLocation;
(function (KeyLocation) {
KeyLocation["SW"] = "sw";
KeyLocation["UHW"] = "uhw";
})(KeyLocation || (KeyLocation = {}));
var PopTokenGenerator = /** @class */ (function () {
function PopTokenGenerator(cryptoUtils) {
this.cryptoUtils = cryptoUtils;
}
/**
* Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
* and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash
* @param request
* @returns
*/
PopTokenGenerator.prototype.generateCnf = function (request) {
return __awaiter(this, void 0, void 0, function () {
var reqCnf, reqCnfString, _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, this.generateKid(request)];
case 1:
reqCnf = _b.sent();
reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
_a = {
kid: reqCnf.kid,
reqCnfString: reqCnfString
};
return [4 /*yield*/, this.cryptoUtils.hashString(reqCnfString)];
case 2: return [2 /*return*/, (_a.reqCnfHash = _b.sent(),
_a)];
}
});
});
};
/**
* Generates key_id for a SHR token request
* @param request
* @returns
*/
PopTokenGenerator.prototype.generateKid = function (request) {
return __awaiter(this, void 0, void 0, function () {
var kidThumbprint;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.cryptoUtils.getPublicKeyThumbprint(request)];
case 1:
kidThumbprint = _a.sent();
return [2 /*return*/, {
kid: kidThumbprint,
xms_ksl: KeyLocation.SW
}];
}
});
});
};
/**
* Signs the POP access_token with the local generated key-pair
* @param accessToken
* @param request
* @returns
*/
PopTokenGenerator.prototype.signPopToken = function (accessToken, keyId, request) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.signPayload(accessToken, keyId, request)];
});
});
};
/**
* Utility function to generate the signed JWT for an access_token
* @param payload
* @param kid
* @param request
* @param claims
* @returns
*/
PopTokenGenerator.prototype.signPayload = function (payload, keyId, request, claims) {
return __awaiter(this, void 0, void 0, function () {
var resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce, resourceUrlString, resourceUrlComponents;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
resourceRequestMethod = request.resourceRequestMethod, resourceRequestUri = request.resourceRequestUri, shrClaims = request.shrClaims, shrNonce = request.shrNonce;
resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;
resourceUrlComponents = resourceUrlString === null || resourceUrlString === void 0 ? void 0 : resourceUrlString.getUrlComponents();
return [4 /*yield*/, this.cryptoUtils.signJwt(__assign({ at: payload, ts: TimeUtils.nowSeconds(), m: resourceRequestMethod === null || resourceRequestMethod === void 0 ? void 0 : resourceRequestMethod.toUpperCase(), u: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.HostNameAndPort, nonce: shrNonce || this.cryptoUtils.createNewGuid(), p: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.AbsolutePath, q: (resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined, client_claims: shrClaims || undefined }, claims), keyId, request.correlationId)];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
return PopTokenGenerator;
}());
export { PopTokenGenerator };
//# sourceMappingURL=PopTokenGenerator.js.map
{"version":3,"file":"PopTokenGenerator.js","sources":["../../src/crypto/PopTokenGenerator.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICrypto, SignedHttpRequestParameters } from \"./ICrypto\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { UrlString } from \"../url/UrlString\";\n\n/**\n * See eSTS docs for more info.\n * - A kid element, with the value containing an RFC 7638-compliant JWK thumbprint that is base64 encoded.\n * - xms_ksl element, representing the storage location of the key's secret component on the client device. One of two values:\n * - sw: software storage\n * - uhw: hardware storage\n */\ntype ReqCnf = {\n kid: string;\n xms_ksl: KeyLocation;\n};\n\nexport type ReqCnfData = {\n kid: string;\n reqCnfString: string;\n reqCnfHash: string;\n};\n\nenum KeyLocation {\n SW = \"sw\",\n UHW = \"uhw\"\n}\n\nexport class PopTokenGenerator {\n\n private cryptoUtils: ICrypto;\n\n constructor(cryptoUtils: ICrypto) {\n this.cryptoUtils = cryptoUtils;\n }\n\n /**\n * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters\n * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash\n * @param request\n * @returns\n */\n async generateCnf(request: SignedHttpRequestParameters): Promise<ReqCnfData> {\n const reqCnf = await this.generateKid(request);\n const reqCnfString: string = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));\n\n return {\n kid: reqCnf.kid,\n reqCnfString, \n reqCnfHash: await this.cryptoUtils.hashString(reqCnfString) \n };\n }\n\n /**\n * Generates key_id for a SHR token request\n * @param request\n * @returns\n */\n async generateKid(request: SignedHttpRequestParameters): Promise<ReqCnf> {\n const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);\n\n return {\n kid: kidThumbprint,\n xms_ksl: KeyLocation.SW\n };\n }\n\n /**\n * Signs the POP access_token with the local generated key-pair\n * @param accessToken\n * @param request\n * @returns\n */\n async signPopToken(accessToken: string, keyId: string, request: SignedHttpRequestParameters): Promise<string> {\n return this.signPayload(accessToken, keyId, request);\n }\n\n /**\n * Utility function to generate the signed JWT for an access_token\n * @param payload\n * @param kid\n * @param request\n * @param claims\n * @returns\n */\n async signPayload(payload: string, keyId: string, request: SignedHttpRequestParameters, claims?: object): Promise<string> {\n\n // Deconstruct request to extract SHR parameters\n const { resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce } = request;\n\n const resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;\n const resourceUrlComponents = resourceUrlString?.getUrlComponents();\n return await this.cryptoUtils.signJwt({\n at: payload,\n ts: TimeUtils.nowSeconds(),\n m: resourceRequestMethod?.toUpperCase(),\n u: resourceUrlComponents?.HostNameAndPort,\n nonce: shrNonce || this.cryptoUtils.createNewGuid(),\n p: resourceUrlComponents?.AbsolutePath,\n q: (resourceUrlComponents?.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined,\n client_claims: shrClaims || undefined,\n ...claims\n }, keyId, request.correlationId);\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAwBH,IAAK,WAGJ,CAAA;AAHD,CAAA,UAAK,WAAW,EAAA;AACZ,IAAA,WAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACf,CAAC,EAHI,WAAW,KAAX,WAAW,GAGf,EAAA,CAAA,CAAA,CAAA;AAED,IAAA,iBAAA,kBAAA,YAAA;AAII,IAAA,SAAA,iBAAA,CAAY,WAAoB,EAAA;AAC5B,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;KAClC;AAED;;;;;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F,aAAa,EAAE,SAAS,IAAI,SAAS,EAAA,EAClC,MAAM,CACV,EAAA,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA,CAAA;AAVhC,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,aAAO,SAUyB,CAAC,CAAA;;;;AACpC,KAAA,CAAA;IACL,OAAC,iBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
\ No newline at end of file
{"version":3,"file":"SignedHttpRequest.d.ts","sourceRoot":"","sources":["../../src/crypto/SignedHttpRequest.ts"],"names":[],"mappings":"AAKA,oBAAY,iBAAiB,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC"}
\ No newline at end of file
/**
* AuthErrorMessage class containing string constants used by error codes and messages.
*/
export declare const AuthErrorMessage: {
unexpectedError: {
code: string;
desc: string;
};
postRequestFailed: {
code: string;
desc: string;
};
};
/**
* General error class thrown by the MSAL.js library.
*/
export declare class AuthError extends Error {
/**
* Short string denoting error
*/
errorCode: string;
/**
* Detailed description of error
*/
errorMessage: string;
/**
* Describes the subclass of an error
*/
subError: string;
/**
* CorrelationId associated with the error
*/
correlationId: string;
constructor(errorCode?: string, errorMessage?: string, suberror?: string);
setCorrelationId(correlationId: string): void;
/**
* Creates an error that is thrown when something unexpected happens in the library.
* @param errDesc
*/
static createUnexpectedError(errDesc: string): AuthError;
/**
* Creates an error for post request failures.
* @param errDesc
* @returns
*/
static createPostRequestFailed(errDesc: string): AuthError;
}
//# sourceMappingURL=AuthError.d.ts.map
\ No newline at end of file
{"version":3,"file":"AuthError.d.ts","sourceRoot":"","sources":["../../src/error/AuthError.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;CAS5B,CAAC;AAEF;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAEhC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;gBAEV,SAAS,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAWxE,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAI7C;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS;IAIxD;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS;CAG7D"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __extends } from '../_virtual/_tslib.js';
import { Constants } from '../utils/Constants.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* AuthErrorMessage class containing string constants used by error codes and messages.
*/
var AuthErrorMessage = {
unexpectedError: {
code: "unexpected_error",
desc: "Unexpected error in authentication."
},
postRequestFailed: {
code: "post_request_failed",
desc: "Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."
}
};
/**
* General error class thrown by the MSAL.js library.
*/
var AuthError = /** @class */ (function (_super) {
__extends(AuthError, _super);
function AuthError(errorCode, errorMessage, suberror) {
var _this = this;
var errorString = errorMessage ? errorCode + ": " + errorMessage : errorCode;
_this = _super.call(this, errorString) || this;
Object.setPrototypeOf(_this, AuthError.prototype);
_this.errorCode = errorCode || Constants.EMPTY_STRING;
_this.errorMessage = errorMessage || Constants.EMPTY_STRING;
_this.subError = suberror || Constants.EMPTY_STRING;
_this.name = "AuthError";
return _this;
}
AuthError.prototype.setCorrelationId = function (correlationId) {
this.correlationId = correlationId;
};
/**
* Creates an error that is thrown when something unexpected happens in the library.
* @param errDesc
*/
AuthError.createUnexpectedError = function (errDesc) {
return new AuthError(AuthErrorMessage.unexpectedError.code, AuthErrorMessage.unexpectedError.desc + ": " + errDesc);
};
/**
* Creates an error for post request failures.
* @param errDesc
* @returns
*/
AuthError.createPostRequestFailed = function (errDesc) {
return new AuthError(AuthErrorMessage.postRequestFailed.code, AuthErrorMessage.postRequestFailed.desc + ": " + errDesc);
};
return AuthError;
}(Error));
export { AuthError, AuthErrorMessage };
//# sourceMappingURL=AuthError.js.map
{"version":3,"file":"AuthError.js","sources":["../../src/error/AuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"../utils/Constants\";\n\n/**\n * AuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const AuthErrorMessage = {\n unexpectedError: {\n code: \"unexpected_error\",\n desc: \"Unexpected error in authentication.\"\n },\n postRequestFailed: {\n code: \"post_request_failed\",\n desc: \"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details.\"\n }\n};\n\n/**\n * General error class thrown by the MSAL.js library.\n */\nexport class AuthError extends Error {\n\n /**\n * Short string denoting error\n */\n errorCode: string;\n\n /**\n * Detailed description of error\n */\n errorMessage: string;\n\n /**\n * Describes the subclass of an error\n */\n subError: string;\n\n /**\n * CorrelationId associated with the error\n */\n correlationId: string;\n\n constructor(errorCode?: string, errorMessage?: string, suberror?: string) {\n const errorString = errorMessage ? `${errorCode}: ${errorMessage}` : errorCode;\n super(errorString);\n Object.setPrototypeOf(this, AuthError.prototype);\n\n this.errorCode = errorCode || Constants.EMPTY_STRING;\n this.errorMessage = errorMessage || Constants.EMPTY_STRING;\n this.subError = suberror || Constants.EMPTY_STRING;\n this.name = \"AuthError\";\n }\n\n setCorrelationId(correlationId: string): void {\n this.correlationId = correlationId;\n }\n\n /**\n * Creates an error that is thrown when something unexpected happens in the library.\n * @param errDesc\n */\n static createUnexpectedError(errDesc: string): AuthError {\n return new AuthError(AuthErrorMessage.unexpectedError.code, `${AuthErrorMessage.unexpectedError.desc}: ${errDesc}`);\n }\n\n /**\n * Creates an error for post request failures.\n * @param errDesc \n * @returns \n */\n static createPostRequestFailed(errDesc: string): AuthError {\n return new AuthError(AuthErrorMessage.postRequestFailed.code, `${AuthErrorMessage.postRequestFailed.desc}: ${errDesc}`);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAIH;;AAEG;AACU,IAAA,gBAAgB,GAAG;AAC5B,IAAA,eAAe,EAAE;AACb,QAAA,IAAI,EAAE,kBAAkB;AACxB,QAAA,IAAI,EAAE,qCAAqC;AAC9C,KAAA;AACD,IAAA,iBAAiB,EAAE;AACf,QAAA,IAAI,EAAE,qBAAqB;AAC3B,QAAA,IAAI,EAAE,sIAAsI;AAC/I,KAAA;EACH;AAEF;;AAEG;AACH,IAAA,SAAA,kBAAA,UAAA,MAAA,EAAA;IAA+B,SAAK,CAAA,SAAA,EAAA,MAAA,CAAA,CAAA;AAsBhC,IAAA,SAAA,SAAA,CAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB,EAAA;QAAxE,IASC,KAAA,GAAA,IAAA,CAAA;AARG,QAAA,IAAM,WAAW,GAAG,YAAY,GAAM,SAAS,GAAA,IAAA,GAAK,YAAc,GAAG,SAAS,CAAC;QAC/E,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM,WAAW,CAAC,IAAC,IAAA,CAAA;QACnB,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAEjD,KAAI,CAAC,SAAS,GAAG,SAAS,IAAI,SAAS,CAAC,YAAY,CAAC;QACrD,KAAI,CAAC,YAAY,GAAG,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC;QAC3D,KAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,SAAS,CAAC,YAAY,CAAC;AACnD,QAAA,KAAI,CAAC,IAAI,GAAG,WAAW,CAAC;;KAC3B;IAED,SAAgB,CAAA,SAAA,CAAA,gBAAA,GAAhB,UAAiB,aAAqB,EAAA;AAClC,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;KACtC,CAAA;AAED;;;AAGG;IACI,SAAqB,CAAA,qBAAA,GAA5B,UAA6B,OAAe,EAAA;AACxC,QAAA,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,EAAK,gBAAgB,CAAC,eAAe,CAAC,IAAI,GAAK,IAAA,GAAA,OAAS,CAAC,CAAC;KACvH,CAAA;AAED;;;;AAIG;IACI,SAAuB,CAAA,uBAAA,GAA9B,UAA+B,OAAe,EAAA;AAC1C,QAAA,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,EAAK,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,GAAK,IAAA,GAAA,OAAS,CAAC,CAAC;KAC3H,CAAA;IACL,OAAC,SAAA,CAAA;AAAD,CArDA,CAA+B,KAAK,CAqDnC;;;;"}
\ No newline at end of file
import { AuthError } from "./AuthError";
/**
* ClientAuthErrorMessage class containing string constants used by error codes and messages.
*/
export declare const ClientAuthErrorMessage: {
clientInfoDecodingError: {
code: string;
desc: string;
};
clientInfoEmptyError: {
code: string;
desc: string;
};
tokenParsingError: {
code: string;
desc: string;
};
nullOrEmptyToken: {
code: string;
desc: string;
};
endpointResolutionError: {
code: string;
desc: string;
};
networkError: {
code: string;
desc: string;
};
unableToGetOpenidConfigError: {
code: string;
desc: string;
};
hashNotDeserialized: {
code: string;
desc: string;
};
blankGuidGenerated: {
code: string;
desc: string;
};
invalidStateError: {
code: string;
desc: string;
};
stateMismatchError: {
code: string;
desc: string;
};
stateNotFoundError: {
code: string;
desc: string;
};
nonceMismatchError: {
code: string;
desc: string;
};
nonceNotFoundError: {
code: string;
desc: string;
};
authTimeNotFoundError: {
code: string;
desc: string;
};
maxAgeTranspiredError: {
code: string;
desc: string;
};
noTokensFoundError: {
code: string;
desc: string;
};
multipleMatchingTokens: {
code: string;
desc: string;
};
multipleMatchingAccounts: {
code: string;
desc: string;
};
multipleMatchingAppMetadata: {
code: string;
desc: string;
};
tokenRequestCannotBeMade: {
code: string;
desc: string;
};
appendEmptyScopeError: {
code: string;
desc: string;
};
removeEmptyScopeError: {
code: string;
desc: string;
};
appendScopeSetError: {
code: string;
desc: string;
};
emptyInputScopeSetError: {
code: string;
desc: string;
};
DeviceCodePollingCancelled: {
code: string;
desc: string;
};
DeviceCodeExpired: {
code: string;
desc: string;
};
DeviceCodeUnknownError: {
code: string;
desc: string;
};
NoAccountInSilentRequest: {
code: string;
desc: string;
};
invalidCacheRecord: {
code: string;
desc: string;
};
invalidCacheEnvironment: {
code: string;
desc: string;
};
noAccountFound: {
code: string;
desc: string;
};
CachePluginError: {
code: string;
desc: string;
};
noCryptoObj: {
code: string;
desc: string;
};
invalidCacheType: {
code: string;
desc: string;
};
unexpectedAccountType: {
code: string;
desc: string;
};
unexpectedCredentialType: {
code: string;
desc: string;
};
invalidAssertion: {
code: string;
desc: string;
};
invalidClientCredential: {
code: string;
desc: string;
};
tokenRefreshRequired: {
code: string;
desc: string;
};
userTimeoutReached: {
code: string;
desc: string;
};
tokenClaimsRequired: {
code: string;
desc: string;
};
noAuthorizationCodeFromServer: {
code: string;
desc: string;
};
noAzureRegionDetected: {
code: string;
desc: string;
};
accessTokenEntityNullError: {
code: string;
desc: string;
};
bindingKeyNotRemovedError: {
code: string;
desc: string;
};
logoutNotSupported: {
code: string;
desc: string;
};
keyIdMissing: {
code: string;
desc: string;
};
};
/**
* Error thrown when there is an error in the client code running on the browser.
*/
export declare class ClientAuthError extends AuthError {
constructor(errorCode: string, errorMessage?: string);
/**
* Creates an error thrown when client info object doesn't decode correctly.
* @param caughtError
*/
static createClientInfoDecodingError(caughtError: string): ClientAuthError;
/**
* Creates an error thrown if the client info is empty.
* @param rawClientInfo
*/
static createClientInfoEmptyError(): ClientAuthError;
/**
* Creates an error thrown when the id token extraction errors out.
* @param err
*/
static createTokenParsingError(caughtExtractionError: string): ClientAuthError;
/**
* Creates an error thrown when the id token string is null or empty.
* @param invalidRawTokenString
*/
static createTokenNullOrEmptyError(invalidRawTokenString: string): ClientAuthError;
/**
* Creates an error thrown when the endpoint discovery doesn't complete correctly.
*/
static createEndpointDiscoveryIncompleteError(errDetail: string): ClientAuthError;
/**
* Creates an error thrown when the fetch client throws
*/
static createNetworkError(endpoint: string, errDetail: string): ClientAuthError;
/**
* Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data
*/
static createUnableToGetOpenidConfigError(errDetail: string): ClientAuthError;
/**
* Creates an error thrown when the hash cannot be deserialized.
* @param hashParamObj
*/
static createHashNotDeserializedError(hashParamObj: string): ClientAuthError;
/**
* Creates an error thrown when the state cannot be parsed.
* @param invalidState
*/
static createInvalidStateError(invalidState: string, errorString?: string): ClientAuthError;
/**
* Creates an error thrown when two states do not match.
*/
static createStateMismatchError(): ClientAuthError;
/**
* Creates an error thrown when the state is not present
* @param missingState
*/
static createStateNotFoundError(missingState: string): ClientAuthError;
/**
* Creates an error thrown when the nonce does not match.
*/
static createNonceMismatchError(): ClientAuthError;
/**
* Creates an error thrown when max_age was provided in the request, but auth_time is not in the token claims
* @param missingNonce
*/
static createAuthTimeNotFoundError(): ClientAuthError;
/**
* Creates an error thrown when too much time has elapsed since the last end-user authentication
*/
static createMaxAgeTranspiredError(): ClientAuthError;
/**
* Creates an error thrown when the mnonce is not present
* @param missingNonce
*/
static createNonceNotFoundError(missingNonce: string): ClientAuthError;
/**
* Throws error when multiple tokens are in cache.
*/
static createMultipleMatchingTokensInCacheError(): ClientAuthError;
/**
* Throws error when multiple accounts are in cache for the given params
*/
static createMultipleMatchingAccountsInCacheError(): ClientAuthError;
/**
* Throws error when multiple appMetada are in cache for the given clientId.
*/
static createMultipleMatchingAppMetadataInCacheError(): ClientAuthError;
/**
* Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.
*/
static createTokenRequestCannotBeMadeError(): ClientAuthError;
/**
* Throws error when attempting to append a null, undefined or empty scope to a set
* @param givenScope
*/
static createAppendEmptyScopeToSetError(givenScope: string): ClientAuthError;
/**
* Throws error when attempting to append a null, undefined or empty scope to a set
* @param givenScope
*/
static createRemoveEmptyScopeFromSetError(givenScope: string): ClientAuthError;
/**
* Throws error when attempting to append null or empty ScopeSet.
* @param appendError
*/
static createAppendScopeSetError(appendError: string): ClientAuthError;
/**
* Throws error if ScopeSet is null or undefined.
* @param givenScopeSet
*/
static createEmptyInputScopeSetError(): ClientAuthError;
/**
* Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow
*/
static createDeviceCodeCancelledError(): ClientAuthError;
/**
* Throws error if device code is expired
*/
static createDeviceCodeExpiredError(): ClientAuthError;
/**
* Throws error if device code is expired
*/
static createDeviceCodeUnknownError(): ClientAuthError;
/**
* Throws error when silent requests are made without an account object
*/
static createNoAccountInSilentRequestError(): ClientAuthError;
/**
* Throws error when cache record is null or undefined.
*/
static createNullOrUndefinedCacheRecord(): ClientAuthError;
/**
* Throws error when provided environment is not part of the CloudDiscoveryMetadata object
*/
static createInvalidCacheEnvironmentError(): ClientAuthError;
/**
* Throws error when account is not found in cache.
*/
static createNoAccountFoundError(): ClientAuthError;
/**
* Throws error if ICachePlugin not set on CacheManager.
*/
static createCachePluginError(): ClientAuthError;
/**
* Throws error if crypto object not found.
* @param operationName
*/
static createNoCryptoObjectError(operationName: string): ClientAuthError;
/**
* Throws error if cache type is invalid.
*/
static createInvalidCacheTypeError(): ClientAuthError;
/**
* Throws error if unexpected account type.
*/
static createUnexpectedAccountTypeError(): ClientAuthError;
/**
* Throws error if unexpected credential type.
*/
static createUnexpectedCredentialTypeError(): ClientAuthError;
/**
* Throws error if client assertion is not valid.
*/
static createInvalidAssertionError(): ClientAuthError;
/**
* Throws error if client assertion is not valid.
*/
static createInvalidCredentialError(): ClientAuthError;
/**
* Throws error if token cannot be retrieved from cache due to refresh being required.
*/
static createRefreshRequiredError(): ClientAuthError;
/**
* Throws error if the user defined timeout is reached.
*/
static createUserTimeoutReachedError(): ClientAuthError;
static createTokenClaimsRequiredError(): ClientAuthError;
/**
* Throws error when the authorization code is missing from the server response
*/
static createNoAuthCodeInServerResponseError(): ClientAuthError;
static createBindingKeyNotRemovedError(): ClientAuthError;
/**
* Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint
*/
static createLogoutNotSupportedError(): ClientAuthError;
/**
* Create an error when kid attribute is missing from a PoP token's cache record
*/
static createKeyIdMissingError(): ClientAuthError;
}
//# sourceMappingURL=ClientAuthError.d.ts.map
\ No newline at end of file
{"version":3,"file":"ClientAuthError.d.ts","sourceRoot":"","sources":["../../src/error/ClientAuthError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoMlC,CAAC;AAEF;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS;gBAE9B,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;IAOpD;;;OAGG;IACH,MAAM,CAAC,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe;IAK1E;;;OAGG;IACH,MAAM,CAAC,0BAA0B,IAAI,eAAe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6B,IAAI,eAAe;IAIvD;;OAEG;IACH,MAAM,CAAC,uBAAuB,IAAI,eAAe;CAGpD"}
\ No newline at end of file
/*! @azure/msal-common v9.0.1 2022-12-07 */
'use strict';
import { __extends } from '../_virtual/_tslib.js';
import { AuthError } from './AuthError.js';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* ClientAuthErrorMessage class containing string constants used by error codes and messages.
*/
var ClientAuthErrorMessage = {
clientInfoDecodingError: {
code: "client_info_decoding_error",
desc: "The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."
},
clientInfoEmptyError: {
code: "client_info_empty_error",
desc: "The client info was empty. Please review the trace to determine the root cause."
},
tokenParsingError: {
code: "token_parsing_error",
desc: "Token cannot be parsed. Please review stack trace to determine root cause."
},
nullOrEmptyToken: {
code: "null_or_empty_token",
desc: "The token is null or empty. Please review the trace to determine the root cause."
},
endpointResolutionError: {
code: "endpoints_resolution_error",
desc: "Error: could not resolve endpoints. Please check network and try again."
},
networkError: {
code: "network_error",
desc: "Network request failed. Please check network trace to determine root cause."
},
unableToGetOpenidConfigError: {
code: "openid_config_error",
desc: "Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."
},
hashNotDeserialized: {
code: "hash_not_deserialized",
desc: "The hash parameters could not be deserialized. Please review the trace to determine the root cause."
},
blankGuidGenerated: {
code: "blank_guid_generated",
desc: "The guid generated was blank. Please review the trace to determine the root cause."
},
invalidStateError: {
code: "invalid_state",
desc: "State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."
},
stateMismatchError: {
code: "state_mismatch",
desc: "State mismatch error. Please check your network. Continued requests may cause cache overflow."
},
stateNotFoundError: {
code: "state_not_found",
desc: "State not found"
},
nonceMismatchError: {
code: "nonce_mismatch",
desc: "Nonce mismatch error. This may be caused by a race condition in concurrent requests."
},
nonceNotFoundError: {
code: "nonce_not_found",
desc: "nonce not found"
},
authTimeNotFoundError: {
code: "auth_time_not_found",
desc: "Max Age was requested and the ID token is missing the auth_time variable." +
" auth_time is an optional claim and is not enabled by default - it must be enabled." +
" See https://aka.ms/msaljs/optional-claims for more information."
},
maxAgeTranspiredError: {
code: "max_age_transpired",
desc: "Max Age is set to 0, or too much time has elapsed since the last end-user authentication."
},
noTokensFoundError: {
code: "no_tokens_found",
desc: "No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."
},
multipleMatchingTokens: {
code: "multiple_matching_tokens",
desc: "The cache contains multiple tokens satisfying the requirements. " +
"Call AcquireToken again providing more requirements such as authority or account."
},
multipleMatchingAccounts: {
code: "multiple_matching_accounts",
desc: "The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"
},
multipleMatchingAppMetadata: {
code: "multiple_matching_appMetadata",
desc: "The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"
},
tokenRequestCannotBeMade: {
code: "request_cannot_be_made",
desc: "Token request cannot be made without authorization code or refresh token."
},
appendEmptyScopeError: {
code: "cannot_append_empty_scope",
desc: "Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."
},
removeEmptyScopeError: {
code: "cannot_remove_empty_scope",
desc: "Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."
},
appendScopeSetError: {
code: "cannot_append_scopeset",
desc: "Cannot append ScopeSet due to error."
},
emptyInputScopeSetError: {
code: "empty_input_scopeset",
desc: "Empty input ScopeSet cannot be processed."
},
DeviceCodePollingCancelled: {
code: "device_code_polling_cancelled",
desc: "Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."
},
DeviceCodeExpired: {
code: "device_code_expired",
desc: "Device code is expired."
},
DeviceCodeUnknownError: {
code: "device_code_unknown_error",
desc: "Device code stopped polling for unknown reasons."
},
NoAccountInSilentRequest: {
code: "no_account_in_silent_request",
desc: "Please pass an account object, silent flow is not supported without account information"
},
invalidCacheRecord: {
code: "invalid_cache_record",
desc: "Cache record object was null or undefined."
},
invalidCacheEnvironment: {
code: "invalid_cache_environment",
desc: "Invalid environment when attempting to create cache entry"
},
noAccountFound: {
code: "no_account_found",
desc: "No account found in cache for given key."
},
CachePluginError: {
code: "no cache plugin set on CacheManager",
desc: "ICachePlugin needs to be set before using readFromStorage or writeFromStorage"
},
noCryptoObj: {
code: "no_crypto_object",
desc: "No crypto object detected. This is required for the following operation: "
},
invalidCacheType: {
code: "invalid_cache_type",
desc: "Invalid cache type"
},
unexpectedAccountType: {
code: "unexpected_account_type",
desc: "Unexpected account type."
},
unexpectedCredentialType: {
code: "unexpected_credential_type",
desc: "Unexpected credential type."
},
invalidAssertion: {
code: "invalid_assertion",
desc: "Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"
},
invalidClientCredential: {
code: "invalid_client_credential",
desc: "Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"
},
tokenRefreshRequired: {
code: "token_refresh_required",
desc: "Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."
},
userTimeoutReached: {
code: "user_timeout_reached",
desc: "User defined timeout for device code polling reached",
},
tokenClaimsRequired: {
code: "token_claims_cnf_required_for_signedjwt",
desc: "Cannot generate a POP jwt if the token_claims are not populated"
},
noAuthorizationCodeFromServer: {
code: "authorization_code_missing_from_server_response",
desc: "Server response does not contain an authorization code to proceed"
},
noAzureRegionDetected: {
code: "no_azure_region_detected",
desc: "No azure region was detected and no fallback was made available"
},
accessTokenEntityNullError: {
code: "access_token_entity_null",
desc: "Access token entity is null, please check logs and cache to ensure a valid access token is present."
},
bindingKeyNotRemovedError: {
code: "binding_key_not_removed",
desc: "Could not remove the credential's binding key from storage."
},
logoutNotSupported: {
code: "end_session_endpoint_not_supported",
desc: "Provided authority does not support logout."
},
keyIdMissing: {
code: "key_id_missing",
desc: "A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."
}
};
/**
* Error thrown when there is an error in the client code running on the browser.
*/
var ClientAuthError = /** @class */ (function (_super) {
__extends(ClientAuthError, _super);
function ClientAuthError(errorCode, errorMessage) {
var _this = _super.call(this, errorCode, errorMessage) || this;
_this.name = "ClientAuthError";
Object.setPrototypeOf(_this, ClientAuthError.prototype);
return _this;
}
/**
* Creates an error thrown when client info object doesn't decode correctly.
* @param caughtError
*/
ClientAuthError.createClientInfoDecodingError = function (caughtError) {
return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code, ClientAuthErrorMessage.clientInfoDecodingError.desc + " Failed with error: " + caughtError);
};
/**
* Creates an error thrown if the client info is empty.
* @param rawClientInfo
*/
ClientAuthError.createClientInfoEmptyError = function () {
return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code, "" + ClientAuthErrorMessage.clientInfoEmptyError.desc);
};
/**
* Creates an error thrown when the id token extraction errors out.
* @param err
*/
ClientAuthError.createTokenParsingError = function (caughtExtractionError) {
return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code, ClientAuthErrorMessage.tokenParsingError.desc + " Failed with error: " + caughtExtractionError);
};
/**
* Creates an error thrown when the id token string is null or empty.
* @param invalidRawTokenString
*/
ClientAuthError.createTokenNullOrEmptyError = function (invalidRawTokenString) {
return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code, ClientAuthErrorMessage.nullOrEmptyToken.desc + " Raw Token Value: " + invalidRawTokenString);
};
/**
* Creates an error thrown when the endpoint discovery doesn't complete correctly.
*/
ClientAuthError.createEndpointDiscoveryIncompleteError = function (errDetail) {
return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code, ClientAuthErrorMessage.endpointResolutionError.desc + " Detail: " + errDetail);
};
/**
* Creates an error thrown when the fetch client throws
*/
ClientAuthError.createNetworkError = function (endpoint, errDetail) {
return new ClientAuthError(ClientAuthErrorMessage.networkError.code, ClientAuthErrorMessage.networkError.desc + " | Fetch client threw: " + errDetail + " | Attempted to reach: " + endpoint.split("?")[0]);
};
/**
* Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data
*/
ClientAuthError.createUnableToGetOpenidConfigError = function (errDetail) {
return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code, ClientAuthErrorMessage.unableToGetOpenidConfigError.desc + " Attempted to retrieve endpoints from: " + errDetail);
};
/**
* Creates an error thrown when the hash cannot be deserialized.
* @param hashParamObj
*/
ClientAuthError.createHashNotDeserializedError = function (hashParamObj) {
return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code, ClientAuthErrorMessage.hashNotDeserialized.desc + " Given Object: " + hashParamObj);
};
/**
* Creates an error thrown when the state cannot be parsed.
* @param invalidState
*/
ClientAuthError.createInvalidStateError = function (invalidState, errorString) {
return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code, ClientAuthErrorMessage.invalidStateError.desc + " Invalid State: " + invalidState + ", Root Err: " + errorString);
};
/**
* Creates an error thrown when two states do not match.
*/
ClientAuthError.createStateMismatchError = function () {
return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code, ClientAuthErrorMessage.stateMismatchError.desc);
};
/**
* Creates an error thrown when the state is not present
* @param missingState
*/
ClientAuthError.createStateNotFoundError = function (missingState) {
return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code, ClientAuthErrorMessage.stateNotFoundError.desc + ": " + missingState);
};
/**
* Creates an error thrown when the nonce does not match.
*/
ClientAuthError.createNonceMismatchError = function () {
return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code, ClientAuthErrorMessage.nonceMismatchError.desc);
};
/**
* Creates an error thrown when max_age was provided in the request, but auth_time is not in the token claims
* @param missingNonce
*/
ClientAuthError.createAuthTimeNotFoundError = function () {
return new ClientAuthError(ClientAuthErrorMessage.authTimeNotFoundError.code, ClientAuthErrorMessage.authTimeNotFoundError.desc);
};
/**
* Creates an error thrown when too much time has elapsed since the last end-user authentication
*/
ClientAuthError.createMaxAgeTranspiredError = function () {
return new ClientAuthError(ClientAuthErrorMessage.maxAgeTranspiredError.code, ClientAuthErrorMessage.maxAgeTranspiredError.desc);
};
/**
* Creates an error thrown when the mnonce is not present
* @param missingNonce
*/
ClientAuthError.createNonceNotFoundError = function (missingNonce) {
return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code, ClientAuthErrorMessage.nonceNotFoundError.desc + ": " + missingNonce);
};
/**
* Throws error when multiple tokens are in cache.
*/
ClientAuthError.createMultipleMatchingTokensInCacheError = function () {
return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code, ClientAuthErrorMessage.multipleMatchingTokens.desc + ".");
};
/**
* Throws error when multiple accounts are in cache for the given params
*/
ClientAuthError.createMultipleMatchingAccountsInCacheError = function () {
return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code, ClientAuthErrorMessage.multipleMatchingAccounts.desc);
};
/**
* Throws error when multiple appMetada are in cache for the given clientId.
*/
ClientAuthError.createMultipleMatchingAppMetadataInCacheError = function () {
return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code, ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);
};
/**
* Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.
*/
ClientAuthError.createTokenRequestCannotBeMadeError = function () {
return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);
};
/**
* Throws error when attempting to append a null, undefined or empty scope to a set
* @param givenScope
*/
ClientAuthError.createAppendEmptyScopeToSetError = function (givenScope) {
return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, ClientAuthErrorMessage.appendEmptyScopeError.desc + " Given Scope: " + givenScope);
};
/**
* Throws error when attempting to append a null, undefined or empty scope to a set
* @param givenScope
*/
ClientAuthError.createRemoveEmptyScopeFromSetError = function (givenScope) {
return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, ClientAuthErrorMessage.removeEmptyScopeError.desc + " Given Scope: " + givenScope);
};
/**
* Throws error when attempting to append null or empty ScopeSet.
* @param appendError
*/
ClientAuthError.createAppendScopeSetError = function (appendError) {
return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, ClientAuthErrorMessage.appendScopeSetError.desc + " Detail Error: " + appendError);
};
/**
* Throws error if ScopeSet is null or undefined.
* @param givenScopeSet
*/
ClientAuthError.createEmptyInputScopeSetError = function () {
return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, "" + ClientAuthErrorMessage.emptyInputScopeSetError.desc);
};
/**
* Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow
*/
ClientAuthError.createDeviceCodeCancelledError = function () {
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, "" + ClientAuthErrorMessage.DeviceCodePollingCancelled.desc);
};
/**
* Throws error if device code is expired
*/
ClientAuthError.createDeviceCodeExpiredError = function () {
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, "" + ClientAuthErrorMessage.DeviceCodeExpired.desc);
};
/**
* Throws error if device code is expired
*/
ClientAuthError.createDeviceCodeUnknownError = function () {
return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, "" + ClientAuthErrorMessage.DeviceCodeUnknownError.desc);
};
/**
* Throws error when silent requests are made without an account object
*/
ClientAuthError.createNoAccountInSilentRequestError = function () {
return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, "" + ClientAuthErrorMessage.NoAccountInSilentRequest.desc);
};
/**
* Throws error when cache record is null or undefined.
*/
ClientAuthError.createNullOrUndefinedCacheRecord = function () {
return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);
};
/**
* Throws error when provided environment is not part of the CloudDiscoveryMetadata object
*/
ClientAuthError.createInvalidCacheEnvironmentError = function () {
return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);
};
/**
* Throws error when account is not found in cache.
*/
ClientAuthError.createNoAccountFoundError = function () {
return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);
};
/**
* Throws error if ICachePlugin not set on CacheManager.
*/
ClientAuthError.createCachePluginError = function () {
return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, "" + ClientAuthErrorMessage.CachePluginError.desc);
};
/**
* Throws error if crypto object not found.
* @param operationName
*/
ClientAuthError.createNoCryptoObjectError = function (operationName) {
return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, "" + ClientAuthErrorMessage.noCryptoObj.desc + operationName);
};
/**
* Throws error if cache type is invalid.
*/
ClientAuthError.createInvalidCacheTypeError = function () {
return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code, "" + ClientAuthErrorMessage.invalidCacheType.desc);
};
/**
* Throws error if unexpected account type.
*/
ClientAuthError.createUnexpectedAccountTypeError = function () {
return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, "" + ClientAuthErrorMessage.unexpectedAccountType.desc);
};
/**
* Throws error if unexpected credential type.
*/
ClientAuthError.createUnexpectedCredentialTypeError = function () {
return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, "" + ClientAuthErrorMessage.unexpectedCredentialType.desc);
};
/**
* Throws error if client assertion is not valid.
*/
ClientAuthError.createInvalidAssertionError = function () {
return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, "" + ClientAuthErrorMessage.invalidAssertion.desc);
};
/**
* Throws error if client assertion is not valid.
*/
ClientAuthError.createInvalidCredentialError = function () {
return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code, "" + ClientAuthErrorMessage.invalidClientCredential.desc);
};
/**
* Throws error if token cannot be retrieved from cache due to refresh being required.
*/
ClientAuthError.createRefreshRequiredError = function () {
return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);
};
/**
* Throws error if the user defined timeout is reached.
*/
ClientAuthError.createUserTimeoutReachedError = function () {
return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);
};
/*
* Throws error if token claims are not populated for a signed jwt generation
*/
ClientAuthError.createTokenClaimsRequiredError = function () {
return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);
};
/**
* Throws error when the authorization code is missing from the server response
*/
ClientAuthError.createNoAuthCodeInServerResponseError = function () {
return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);
};
ClientAuthError.createBindingKeyNotRemovedError = function () {
return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);
};
/**
* Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint
*/
ClientAuthError.createLogoutNotSupportedError = function () {
return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);
};
/**
* Create an error when kid attribute is missing from a PoP token's cache record
*/
ClientAuthError.createKeyIdMissingError = function () {
return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);
};
return ClientAuthError;
}(AuthError));
export { ClientAuthError, ClientAuthErrorMessage };
//# sourceMappingURL=ClientAuthError.js.map
{"version":3,"file":"ClientAuthError.js","sources":["../../src/error/ClientAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * ClientAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const ClientAuthErrorMessage = {\n clientInfoDecodingError: {\n code: \"client_info_decoding_error\",\n desc: \"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause.\"\n },\n clientInfoEmptyError: {\n code: \"client_info_empty_error\",\n desc: \"The client info was empty. Please review the trace to determine the root cause.\"\n },\n tokenParsingError: {\n code: \"token_parsing_error\",\n desc: \"Token cannot be parsed. Please review stack trace to determine root cause.\"\n },\n nullOrEmptyToken: {\n code: \"null_or_empty_token\",\n desc: \"The token is null or empty. Please review the trace to determine the root cause.\"\n },\n endpointResolutionError: {\n code: \"endpoints_resolution_error\",\n desc: \"Error: could not resolve endpoints. Please check network and try again.\"\n },\n networkError: {\n code: \"network_error\",\n desc: \"Network request failed. Please check network trace to determine root cause.\"\n },\n unableToGetOpenidConfigError: {\n code: \"openid_config_error\",\n desc: \"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.\"\n },\n hashNotDeserialized: {\n code: \"hash_not_deserialized\",\n desc: \"The hash parameters could not be deserialized. Please review the trace to determine the root cause.\"\n },\n blankGuidGenerated: {\n code: \"blank_guid_generated\",\n desc: \"The guid generated was blank. Please review the trace to determine the root cause.\"\n },\n invalidStateError: {\n code: \"invalid_state\",\n desc: \"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState().\"\n },\n stateMismatchError: {\n code: \"state_mismatch\",\n desc: \"State mismatch error. Please check your network. Continued requests may cause cache overflow.\"\n },\n stateNotFoundError: {\n code: \"state_not_found\",\n desc: \"State not found\"\n },\n nonceMismatchError: {\n code: \"nonce_mismatch\",\n desc: \"Nonce mismatch error. This may be caused by a race condition in concurrent requests.\"\n },\n nonceNotFoundError: {\n code: \"nonce_not_found\",\n desc: \"nonce not found\"\n },\n authTimeNotFoundError: {\n code: \"auth_time_not_found\",\n desc: \"Max Age was requested and the ID token is missing the auth_time variable.\" +\n \" auth_time is an optional claim and is not enabled by default - it must be enabled.\" +\n \" See https://aka.ms/msaljs/optional-claims for more information.\"\n },\n maxAgeTranspiredError: {\n code: \"max_age_transpired\",\n desc: \"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.\"\n },\n noTokensFoundError: {\n code: \"no_tokens_found\",\n desc: \"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken().\"\n },\n multipleMatchingTokens: {\n code: \"multiple_matching_tokens\",\n desc: \"The cache contains multiple tokens satisfying the requirements. \" +\n \"Call AcquireToken again providing more requirements such as authority or account.\"\n },\n multipleMatchingAccounts: {\n code: \"multiple_matching_accounts\",\n desc: \"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account\"\n },\n multipleMatchingAppMetadata: {\n code: \"multiple_matching_appMetadata\",\n desc: \"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata\"\n },\n tokenRequestCannotBeMade: {\n code: \"request_cannot_be_made\",\n desc: \"Token request cannot be made without authorization code or refresh token.\"\n },\n appendEmptyScopeError: {\n code: \"cannot_append_empty_scope\",\n desc: \"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info.\"\n },\n removeEmptyScopeError: {\n code: \"cannot_remove_empty_scope\",\n desc: \"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info.\"\n },\n appendScopeSetError: {\n code: \"cannot_append_scopeset\",\n desc: \"Cannot append ScopeSet due to error.\"\n },\n emptyInputScopeSetError: {\n code: \"empty_input_scopeset\",\n desc: \"Empty input ScopeSet cannot be processed.\"\n },\n DeviceCodePollingCancelled: {\n code: \"device_code_polling_cancelled\",\n desc: \"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.\"\n },\n DeviceCodeExpired: {\n code: \"device_code_expired\",\n desc: \"Device code is expired.\"\n },\n DeviceCodeUnknownError: {\n code: \"device_code_unknown_error\",\n desc: \"Device code stopped polling for unknown reasons.\"\n },\n NoAccountInSilentRequest: {\n code: \"no_account_in_silent_request\",\n desc: \"Please pass an account object, silent flow is not supported without account information\"\n },\n invalidCacheRecord: {\n code: \"invalid_cache_record\",\n desc: \"Cache record object was null or undefined.\"\n },\n invalidCacheEnvironment: {\n code: \"invalid_cache_environment\",\n desc: \"Invalid environment when attempting to create cache entry\"\n },\n noAccountFound: {\n code: \"no_account_found\",\n desc: \"No account found in cache for given key.\"\n },\n CachePluginError: {\n code: \"no cache plugin set on CacheManager\",\n desc: \"ICachePlugin needs to be set before using readFromStorage or writeFromStorage\"\n },\n noCryptoObj: {\n code: \"no_crypto_object\",\n desc: \"No crypto object detected. This is required for the following operation: \"\n },\n invalidCacheType: {\n code: \"invalid_cache_type\",\n desc: \"Invalid cache type\"\n },\n unexpectedAccountType: {\n code: \"unexpected_account_type\",\n desc: \"Unexpected account type.\"\n },\n unexpectedCredentialType: {\n code: \"unexpected_credential_type\",\n desc: \"Unexpected credential type.\"\n },\n invalidAssertion: {\n code: \"invalid_assertion\",\n desc: \"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515\"\n },\n invalidClientCredential: {\n code: \"invalid_client_credential\",\n desc: \"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential\"\n },\n tokenRefreshRequired: {\n code: \"token_refresh_required\",\n desc: \"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.\"\n },\n userTimeoutReached: {\n code: \"user_timeout_reached\",\n desc: \"User defined timeout for device code polling reached\",\n },\n tokenClaimsRequired: {\n code: \"token_claims_cnf_required_for_signedjwt\",\n desc: \"Cannot generate a POP jwt if the token_claims are not populated\"\n },\n noAuthorizationCodeFromServer: {\n code: \"authorization_code_missing_from_server_response\",\n desc: \"Server response does not contain an authorization code to proceed\"\n },\n noAzureRegionDetected: {\n code: \"no_azure_region_detected\",\n desc: \"No azure region was detected and no fallback was made available\"\n },\n accessTokenEntityNullError: {\n code: \"access_token_entity_null\",\n desc: \"Access token entity is null, please check logs and cache to ensure a valid access token is present.\"\n },\n bindingKeyNotRemovedError: {\n code: \"binding_key_not_removed\",\n desc: \"Could not remove the credential's binding key from storage.\"\n },\n logoutNotSupported: {\n code: \"end_session_endpoint_not_supported\",\n desc: \"Provided authority does not support logout.\"\n },\n keyIdMissing: {\n code: \"key_id_missing\",\n desc: \"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.\"\n }\n};\n\n/**\n * Error thrown when there is an error in the client code running on the browser.\n */\nexport class ClientAuthError extends AuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n this.name = \"ClientAuthError\";\n\n Object.setPrototypeOf(this, ClientAuthError.prototype);\n }\n\n /**\n * Creates an error thrown when client info object doesn't decode correctly.\n * @param caughtError\n */\n static createClientInfoDecodingError(caughtError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code,\n `${ClientAuthErrorMessage.clientInfoDecodingError.desc} Failed with error: ${caughtError}`);\n }\n\n /**\n * Creates an error thrown if the client info is empty.\n * @param rawClientInfo\n */\n static createClientInfoEmptyError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code,\n `${ClientAuthErrorMessage.clientInfoEmptyError.desc}`);\n }\n\n /**\n * Creates an error thrown when the id token extraction errors out.\n * @param err\n */\n static createTokenParsingError(caughtExtractionError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code,\n `${ClientAuthErrorMessage.tokenParsingError.desc} Failed with error: ${caughtExtractionError}`);\n }\n\n /**\n * Creates an error thrown when the id token string is null or empty.\n * @param invalidRawTokenString\n */\n static createTokenNullOrEmptyError(invalidRawTokenString: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code,\n `${ClientAuthErrorMessage.nullOrEmptyToken.desc} Raw Token Value: ${invalidRawTokenString}`);\n }\n\n /**\n * Creates an error thrown when the endpoint discovery doesn't complete correctly.\n */\n static createEndpointDiscoveryIncompleteError(errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code,\n `${ClientAuthErrorMessage.endpointResolutionError.desc} Detail: ${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the fetch client throws\n */\n static createNetworkError(endpoint: string, errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.networkError.code,\n `${ClientAuthErrorMessage.networkError.desc} | Fetch client threw: ${errDetail} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data\n */\n static createUnableToGetOpenidConfigError(errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code,\n `${ClientAuthErrorMessage.unableToGetOpenidConfigError.desc} Attempted to retrieve endpoints from: ${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the hash cannot be deserialized.\n * @param hashParamObj\n */\n static createHashNotDeserializedError(hashParamObj: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code,\n `${ClientAuthErrorMessage.hashNotDeserialized.desc} Given Object: ${hashParamObj}`);\n }\n\n /**\n * Creates an error thrown when the state cannot be parsed.\n * @param invalidState\n */\n static createInvalidStateError(invalidState: string, errorString?: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code,\n `${ClientAuthErrorMessage.invalidStateError.desc} Invalid State: ${invalidState}, Root Err: ${errorString}`);\n }\n\n /**\n * Creates an error thrown when two states do not match.\n */\n static createStateMismatchError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code,\n ClientAuthErrorMessage.stateMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when the state is not present\n * @param missingState\n */\n static createStateNotFoundError(missingState: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code,\n `${ClientAuthErrorMessage.stateNotFoundError.desc}: ${missingState}`);\n }\n\n /**\n * Creates an error thrown when the nonce does not match.\n */\n static createNonceMismatchError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code,\n ClientAuthErrorMessage.nonceMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when max_age was provided in the request, but auth_time is not in the token claims\n * @param missingNonce\n */\n static createAuthTimeNotFoundError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.authTimeNotFoundError.code,\n ClientAuthErrorMessage.authTimeNotFoundError.desc);\n }\n\n /**\n * Creates an error thrown when too much time has elapsed since the last end-user authentication\n */\n static createMaxAgeTranspiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.maxAgeTranspiredError.code,\n ClientAuthErrorMessage.maxAgeTranspiredError.desc);\n }\n\n /**\n * Creates an error thrown when the mnonce is not present\n * @param missingNonce\n */\n static createNonceNotFoundError(missingNonce: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code,\n `${ClientAuthErrorMessage.nonceNotFoundError.desc}: ${missingNonce}`);\n }\n\n /**\n * Throws error when multiple tokens are in cache.\n */\n static createMultipleMatchingTokensInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code,\n `${ClientAuthErrorMessage.multipleMatchingTokens.desc}.`);\n }\n\n /**\n * Throws error when multiple accounts are in cache for the given params\n */\n static createMultipleMatchingAccountsInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code,\n ClientAuthErrorMessage.multipleMatchingAccounts.desc);\n }\n\n /**\n * Throws error when multiple appMetada are in cache for the given clientId.\n */\n static createMultipleMatchingAppMetadataInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code,\n ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);\n }\n\n /**\n * Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.\n */\n static createTokenRequestCannotBeMadeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);\n }\n\n /**\n * Throws error when attempting to append a null, undefined or empty scope to a set\n * @param givenScope\n */\n static createAppendEmptyScopeToSetError(givenScope: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, `${ClientAuthErrorMessage.appendEmptyScopeError.desc} Given Scope: ${givenScope}`);\n }\n\n /**\n * Throws error when attempting to append a null, undefined or empty scope to a set\n * @param givenScope\n */\n static createRemoveEmptyScopeFromSetError(givenScope: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, `${ClientAuthErrorMessage.removeEmptyScopeError.desc} Given Scope: ${givenScope}`);\n }\n\n /**\n * Throws error when attempting to append null or empty ScopeSet.\n * @param appendError\n */\n static createAppendScopeSetError(appendError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, `${ClientAuthErrorMessage.appendScopeSetError.desc} Detail Error: ${appendError}`);\n }\n\n /**\n * Throws error if ScopeSet is null or undefined.\n * @param givenScopeSet\n */\n static createEmptyInputScopeSetError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, `${ClientAuthErrorMessage.emptyInputScopeSetError.desc}`);\n }\n\n /**\n * Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow\n */\n static createDeviceCodeCancelledError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, `${ClientAuthErrorMessage.DeviceCodePollingCancelled.desc}`);\n }\n\n /**\n * Throws error if device code is expired\n */\n static createDeviceCodeExpiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, `${ClientAuthErrorMessage.DeviceCodeExpired.desc}`);\n }\n\n /**\n * Throws error if device code is expired\n */\n static createDeviceCodeUnknownError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, `${ClientAuthErrorMessage.DeviceCodeUnknownError.desc}`);\n }\n\n /**\n * Throws error when silent requests are made without an account object\n */\n static createNoAccountInSilentRequestError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, `${ClientAuthErrorMessage.NoAccountInSilentRequest.desc}`);\n }\n\n /**\n * Throws error when cache record is null or undefined.\n */\n static createNullOrUndefinedCacheRecord(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);\n }\n\n /**\n * Throws error when provided environment is not part of the CloudDiscoveryMetadata object\n */\n static createInvalidCacheEnvironmentError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);\n }\n\n /**\n * Throws error when account is not found in cache.\n */\n static createNoAccountFoundError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);\n }\n\n /**\n * Throws error if ICachePlugin not set on CacheManager.\n */\n static createCachePluginError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, `${ClientAuthErrorMessage.CachePluginError.desc}`);\n }\n\n /**\n * Throws error if crypto object not found.\n * @param operationName\n */\n static createNoCryptoObjectError(operationName: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, `${ClientAuthErrorMessage.noCryptoObj.desc}${operationName}`);\n }\n\n /**\n * Throws error if cache type is invalid.\n */\n static createInvalidCacheTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code, `${ClientAuthErrorMessage.invalidCacheType.desc}`);\n }\n\n /**\n * Throws error if unexpected account type.\n */\n static createUnexpectedAccountTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, `${ClientAuthErrorMessage.unexpectedAccountType.desc}`);\n }\n\n /**\n * Throws error if unexpected credential type.\n */\n static createUnexpectedCredentialTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, `${ClientAuthErrorMessage.unexpectedCredentialType.desc}`);\n }\n\n /**\n * Throws error if client assertion is not valid.\n */\n static createInvalidAssertionError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, `${ClientAuthErrorMessage.invalidAssertion.desc}`);\n }\n\n /**\n * Throws error if client assertion is not valid.\n */\n static createInvalidCredentialError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code, `${ClientAuthErrorMessage.invalidClientCredential.desc}`);\n }\n\n /**\n * Throws error if token cannot be retrieved from cache due to refresh being required.\n */\n static createRefreshRequiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);\n }\n\n /**\n * Throws error if the user defined timeout is reached.\n */\n static createUserTimeoutReachedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);\n }\n\n /*\n * Throws error if token claims are not populated for a signed jwt generation\n */\n static createTokenClaimsRequiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);\n }\n\n /**\n * Throws error when the authorization code is missing from the server response\n */\n static createNoAuthCodeInServerResponseError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);\n }\n\n static createBindingKeyNotRemovedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);\n }\n\n /**\n * Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint\n */\n static createLogoutNotSupportedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);\n }\n\n /**\n * Create an error when kid attribute is missing from a PoP token's cache record\n */\n static createKeyIdMissingError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAIH;;AAEG;AACU,IAAA,sBAAsB,GAAG;AAClC,IAAA,uBAAuB,EAAE;AACrB,QAAA,IAAI,EAAE,4BAA4B;AAClC,QAAA,IAAI,EAAE,6GAA6G;AACtH,KAAA;AACD,IAAA,oBAAoB,EAAE;AAClB,QAAA,IAAI,EAAE,yBAAyB;AAC/B,QAAA,IAAI,EAAE,iFAAiF;AAC1F,KAAA;AACD,IAAA,iBAAiB,EAAE;AACf,QAAA,IAAI,EAAE,qBAAqB;AAC3B,QAAA,IAAI,EAAE,4EAA4E;AACrF,KAAA;AACD,IAAA,gBAAgB,EAAE;AACd,QAAA,IAAI,EAAE,qBAAqB;AAC3B,QAAA,IAAI,EAAE,kFAAkF;AAC3F,KAAA;AACD,IAAA,uBAAuB,EAAE;AACrB,QAAA,IAAI,EAAE,4BAA4B;AAClC,QAAA,IAAI,EAAE,yEAAyE;AAClF,KAAA;AACD,IAAA,YAAY,EAAE;AACV,QAAA,IAAI,EAAE,eAAe;AACrB,QAAA,IAAI,EAAE,6EAA6E;AACtF,KAAA;AACD,IAAA,4BAA4B,EAAE;AAC1B,QAAA,IAAI,EAAE,qBAAqB;AAC3B,QAAA,IAAI,EAAE,6IAA6I;AACtJ,KAAA;AACD,IAAA,mBAAmB,EAAE;AACjB,QAAA,IAAI,EAAE,uBAAuB;AAC7B,QAAA,IAAI,EAAE,qGAAqG;AAC9G,KAAA;AACD,IAAA,kBAAkB,EAAE;AAChB,QAAA,IAAI,EAAE,sBAAsB;AAC5B,QAAA,IAAI,EAAE,oFAAoF;AAC7F,KAAA;AACD,IAAA,iBAAiB,EAAE;AACf,QAAA,IAAI,EAAE,eAAe;AACrB,QAAA,IAAI,EAAE,2IAA2I;AACpJ,KAAA;AACD,IAAA,kBAAkB,EAAE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;IACL,OAAC,eAAA,CAAA;AAAD,CAzVA,CAAqC,SAAS,CAyV7C;;;;"}
\ No newline at end of file
import { ClientAuthError } from "./ClientAuthError";
/**
* ClientConfigurationErrorMessage class containing string constants used by error codes and messages.
*/
export declare const ClientConfigurationErrorMessage: {
redirectUriNotSet: {
code: string;
desc: string;
};
postLogoutUriNotSet: {
code: string;
desc: string;
};
claimsRequestParsingError: {
code: string;
desc: string;
};
authorityUriInsecure: {
code: string;
desc: string;
};
urlParseError: {
code: string;
desc: string;
};
urlEmptyError: {
code: string;
desc: string;
};
emptyScopesError: {
code: string;
desc: string;
};
nonArrayScopesError: {
code: string;
desc: string;
};
clientIdSingleScopeError: {
code: string;
desc: string;
};
invalidPrompt: {
code: string;
desc: string;
};
invalidClaimsRequest: {
code: string;
desc: string;
};
tokenRequestEmptyError: {
code: string;
desc: string;
};
logoutRequestEmptyError: {
code: string;
desc: string;
};
invalidCodeChallengeMethod: {
code: string;
desc: string;
};
invalidCodeChallengeParams: {
code: string;
desc: string;
};
invalidCloudDiscoveryMetadata: {
code: string;
desc: string;
};
invalidAuthorityMetadata: {
code: string;
desc: string;
};
untrustedAuthority: {
code: string;
desc: string;
};
invalidAzureCloudInstance: {
code: string;
desc: string;
};
missingSshJwk: {
code: string;
desc: string;
};
missingSshKid: {
code: string;
desc: string;
};
missingNonceAuthenticationHeader: {
code: string;
desc: string;
};
invalidAuthenticationHeader: {
code: string;
desc: string;
};
};
/**
* Error thrown when there is an error in configuration of the MSAL.js library.
*/
export declare class ClientConfigurationError extends ClientAuthError {
constructor(errorCode: string, errorMessage?: string);
/**
* Creates an error thrown when the redirect uri is empty (not set by caller)
*/
static createRedirectUriEmptyError(): ClientConfigurationError;
/**
* Creates an error thrown when the post-logout redirect uri is empty (not set by caller)
*/
static createPostLogoutRedirectUriEmptyError(): ClientConfigurationError;
/**
* Creates an error thrown when the claims request could not be successfully parsed
*/
static createClaimsRequestParsingError(claimsRequestParseError: string): ClientConfigurationError;
/**
* Creates an error thrown if authority uri is given an insecure protocol.
* @param urlString
*/
static createInsecureAuthorityUriError(urlString: string): ClientConfigurationError;
/**
* Creates an error thrown if URL string does not parse into separate segments.
* @param urlString
*/
static createUrlParseError(urlParseError: string): ClientConfigurationError;
/**
* Creates an error thrown if URL string is empty or null.
* @param urlString
*/
static createUrlEmptyError(): ClientConfigurationError;
/**
* Error thrown when scopes are empty.
* @param scopesValue
*/
static createEmptyScopesArrayError(): ClientConfigurationError;
/**
* Error thrown when client id scope is not provided as single scope.
* @param inputScopes
*/
static createClientIdSingleScopeError(inputScopes: Array<string>): ClientConfigurationError;
/**
* Error thrown when prompt is not an allowed type.
* @param promptValue
*/
static createInvalidPromptError(promptValue: string): ClientConfigurationError;
/**
* Creates error thrown when claims parameter is not a stringified JSON object
*/
static createInvalidClaimsRequestError(): ClientConfigurationError;
/**
* Throws error when token request is empty and nothing cached in storage.
*/
static createEmptyLogoutRequestError(): ClientConfigurationError;
/**
* Throws error when token request is empty and nothing cached in storage.
*/
static createEmptyTokenRequestError(): ClientConfigurationError;
/**
* Throws error when an invalid code_challenge_method is passed by the user
*/
static createInvalidCodeChallengeMethodError(): ClientConfigurationError;
/**
* Throws error when both params: code_challenge and code_challenge_method are not passed together
*/
static createInvalidCodeChallengeParamsError(): ClientConfigurationError;
/**
* Throws an error when the user passes invalid cloudDiscoveryMetadata
*/
static createInvalidCloudDiscoveryMetadataError(): ClientConfigurationError;
/**
* Throws an error when the user passes invalid cloudDiscoveryMetadata
*/
static createInvalidAuthorityMetadataError(): ClientConfigurationError;
/**
* Throws error when provided authority is not a member of the trusted host list
*/
static createUntrustedAuthorityError(): ClientConfigurationError;
/**
* Throws error when the AzureCloudInstance is set to an invalid value
*/
static createInvalidAzureCloudInstanceError(): ClientConfigurationError;
/**
* Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request
*/
static createMissingSshJwkError(): ClientConfigurationError;
/**
* Throws an error when the authentication scheme is set to SSH but the SSH public key ID is omitted from the request
*/
static createMissingSshKidError(): ClientConfigurationError;
/**
* Throws error when provided headers don't contain a header that a server nonce can be extracted from
*/
static createMissingNonceAuthenticationHeadersError(): ClientConfigurationError;
/**
* Throws error when a provided header is invalid in any way
*/
static createInvalidAuthenticationHeaderError(invalidHeaderName: string, details: string): ClientConfigurationError;
}
//# sourceMappingURL=ClientConfigurationError.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