Commit iniziale

This commit is contained in:
Paolo A
2025-02-18 22:59:07 +00:00
commit 4bbf35cefb
6879 changed files with 623784 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import { AccountInfo, AuthenticationResult as CommonAuthenticationResult } from "@azure/msal-common/browser";
export type AuthenticationResult = CommonAuthenticationResult & {
account: AccountInfo;
};
//# sourceMappingURL=AuthenticationResult.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AuthenticationResult.d.ts","sourceRoot":"","sources":["../../src/response/AuthenticationResult.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,WAAW,EACX,oBAAoB,IAAI,0BAA0B,EACrD,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAAG,0BAA0B,GAAG;IAC5D,OAAO,EAAE,WAAW,CAAC;CACxB,CAAC"}

View File

@@ -0,0 +1,8 @@
import { ICrypto, Logger, ServerAuthorizationCodeResponse } from "@azure/msal-common/browser";
import { InteractionType } from "../utils/BrowserConstants.js";
export declare function deserializeResponse(responseString: string, responseLocation: string, logger: Logger): ServerAuthorizationCodeResponse;
/**
* Returns the interaction type that the response object belongs to
*/
export declare function validateInteractionType(response: ServerAuthorizationCodeResponse, browserCrypto: ICrypto, interactionType: InteractionType): void;
//# sourceMappingURL=ResponseHandler.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ResponseHandler.d.ts","sourceRoot":"","sources":["../../src/response/ResponseHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,OAAO,EACP,MAAM,EACN,+BAA+B,EAElC,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,MAAM,EACxB,MAAM,EAAE,MAAM,GACf,+BAA+B,CAuBjC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACnC,QAAQ,EAAE,+BAA+B,EACzC,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,eAAe,GACjC,IAAI,CAkBN"}

View File

@@ -0,0 +1,46 @@
/*! @azure/msal-browser v4.2.1 2025-02-11 */
'use strict';
import { UrlUtils } from '@azure/msal-common/browser';
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
import { extractBrowserRequestState } from '../utils/BrowserProtocolUtils.mjs';
import { hashEmptyError, hashDoesNotContainKnownProperties, noStateInHash, unableToParseState, stateInteractionTypeMismatch } from '../error/BrowserAuthErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
function deserializeResponse(responseString, responseLocation, logger) {
// Deserialize hash fragment response parameters.
const serverParams = UrlUtils.getDeserializedResponse(responseString);
if (!serverParams) {
if (!UrlUtils.stripLeadingHashOrQuery(responseString)) {
// Hash or Query string is empty
logger.error(`The request has returned to the redirectUri but a ${responseLocation} is not present. It's likely that the ${responseLocation} has been removed or the page has been redirected by code running on the redirectUri page.`);
throw createBrowserAuthError(hashEmptyError);
}
else {
logger.error(`A ${responseLocation} is present in the iframe but it does not contain known properties. It's likely that the ${responseLocation} has been replaced by code running on the redirectUri page.`);
logger.errorPii(`The ${responseLocation} detected is: ${responseString}`);
throw createBrowserAuthError(hashDoesNotContainKnownProperties);
}
}
return serverParams;
}
/**
* Returns the interaction type that the response object belongs to
*/
function validateInteractionType(response, browserCrypto, interactionType) {
if (!response.state) {
throw createBrowserAuthError(noStateInHash);
}
const platformStateObj = extractBrowserRequestState(browserCrypto, response.state);
if (!platformStateObj) {
throw createBrowserAuthError(unableToParseState);
}
if (platformStateObj.interactionType !== interactionType) {
throw createBrowserAuthError(stateInteractionTypeMismatch);
}
}
export { deserializeResponse, validateInteractionType };
//# sourceMappingURL=ResponseHandler.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ResponseHandler.mjs","sources":["../../src/response/ResponseHandler.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.hashEmptyError","BrowserAuthErrorCodes.hashDoesNotContainKnownProperties","BrowserAuthErrorCodes.noStateInHash","BrowserAuthErrorCodes.unableToParseState","BrowserAuthErrorCodes.stateInteractionTypeMismatch"],"mappings":";;;;;;;AAAA;;;AAGG;SAea,mBAAmB,CAC/B,cAAsB,EACtB,gBAAwB,EACxB,MAAc,EAAA;;IAGd,MAAM,YAAY,GAAG,QAAQ,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACtE,IAAI,CAAC,YAAY,EAAE;AACf,QAAA,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,cAAc,CAAC,EAAE;;YAEnD,MAAM,CAAC,KAAK,CACR,CAAA,kDAAA,EAAqD,gBAAgB,CAAyC,sCAAA,EAAA,gBAAgB,CAA4F,0FAAA,CAAA,CAC7N,CAAC;AACF,YAAA,MAAM,sBAAsB,CAACA,cAAoC,CAAC,CAAC;AACtE,SAAA;AAAM,aAAA;YACH,MAAM,CAAC,KAAK,CACR,CAAA,EAAA,EAAK,gBAAgB,CAA4F,yFAAA,EAAA,gBAAgB,CAA6D,2DAAA,CAAA,CACjM,CAAC;YACF,MAAM,CAAC,QAAQ,CACX,CAAA,IAAA,EAAO,gBAAgB,CAAiB,cAAA,EAAA,cAAc,CAAE,CAAA,CAC3D,CAAC;AACF,YAAA,MAAM,sBAAsB,CACxBC,iCAAuD,CAC1D,CAAC;AACL,SAAA;AACJ,KAAA;AACD,IAAA,OAAO,YAAY,CAAC;AACxB,CAAC;AAED;;AAEG;SACa,uBAAuB,CACnC,QAAyC,EACzC,aAAsB,EACtB,eAAgC,EAAA;AAEhC,IAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;AACjB,QAAA,MAAM,sBAAsB,CAACC,aAAmC,CAAC,CAAC;AACrE,KAAA;IAED,MAAM,gBAAgB,GAAG,0BAA0B,CAC/C,aAAa,EACb,QAAQ,CAAC,KAAK,CACjB,CAAC;IACF,IAAI,CAAC,gBAAgB,EAAE;AACnB,QAAA,MAAM,sBAAsB,CAACC,kBAAwC,CAAC,CAAC;AAC1E,KAAA;AAED,IAAA,IAAI,gBAAgB,CAAC,eAAe,KAAK,eAAe,EAAE;AACtD,QAAA,MAAM,sBAAsB,CACxBC,4BAAkD,CACrD,CAAC;AACL,KAAA;AACL;;;;"}