Commit iniziale
This commit is contained in:
21
node_modules/@azure/msal-browser/LICENSE
generated
vendored
Normal file
21
node_modules/@azure/msal-browser/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
152
node_modules/@azure/msal-browser/README.md
generated
vendored
Normal file
152
node_modules/@azure/msal-browser/README.md
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
# Microsoft Authentication Library for JavaScript (MSAL.js) for Browser-Based Single-Page Applications
|
||||
|
||||
[](https://www.npmjs.com/package/@azure/msal-browser/)
|
||||
[](https://nodei.co/npm/@azure/msal-browser/)
|
||||
[](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)
|
||||
|
||||
| <a href="https://docs.microsoft.com/azure/active-directory/develop/guidedsetups/active-directory-javascriptspa" target="_blank">Getting Started</a> | <a href="https://aka.ms/aaddevv2" target="_blank">AAD Docs</a> | <a href="https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_browser.html" target="_blank">Library Reference</a> |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
|
||||
1. [About](#about)
|
||||
1. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md)
|
||||
1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/CHANGELOG.md)
|
||||
1. [Roadmap](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/roadmap.md)
|
||||
1. [Prerequisites](#prerequisites)
|
||||
1. [Installation](#installation)
|
||||
1. [Usage](#usage)
|
||||
- [Migrating from Previous MSAL Versions](#migrating-from-previous-msal-versions)
|
||||
- [MSAL Basics](#msal-basics)
|
||||
- [Advanced Topics](#advanced-topics)
|
||||
1. [Samples](#samples)
|
||||
1. [Build and Test](#build-and-test)
|
||||
1. [Authorization Code vs Implicit](#implicit-flow-vs-authorization-code-flow-with-pkce)
|
||||
1. [Framework Wrappers](#framework-wrappers)
|
||||
1. [Security Reporting](#security-reporting)
|
||||
1. [License](#license)
|
||||
1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
|
||||
|
||||
## About
|
||||
|
||||
The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using [Azure AD](https://docs.microsoft.com/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).
|
||||
|
||||
The `@azure/msal-browser` package described by the code in this folder uses the [`@azure/msal-common` package](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-common) as a dependency to enable authentication in JavaScript Single-Page Applications without backend servers. This version of the library uses the OAuth 2.0 Authorization Code Flow with PKCE. To read more about this protocol, as well as the differences between implicit flow and authorization code flow, see the section [below](#implicit-flow-vs-authorization-code-flow-with-pkce).
|
||||
|
||||
This is an improvement upon the previous `@azure/msal` library which will utilize the authorization code flow in the browser. Most features available in the old library will be available in this one, but there are nuances to the authentication flow in both. The `@azure/msal-browser` package does NOT support the implicit flow.
|
||||
|
||||
## FAQ
|
||||
|
||||
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md).
|
||||
|
||||
## Roadmap
|
||||
|
||||
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/roadmap.md).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- `@azure/msal-browser` is meant to be used in [Single-Page Application scenarios](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-overview).
|
||||
|
||||
- Before using `@azure/msal-browser` you will need to [register a Single Page Application in Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-app-registration) to get a valid `clientId` for configuration, and to register the routes that your app will accept redirect traffic on.
|
||||
|
||||
## Installation
|
||||
|
||||
### Via NPM
|
||||
|
||||
```javascript
|
||||
npm install @azure/msal-browser
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Migrating from Previous MSAL Versions
|
||||
|
||||
- [Migrating from MSAL v1.x to MSAL v2.x](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v1-migration.md)
|
||||
- [Migrating from MSAL v2.x to MSAL v3.x](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v2-migration.md)
|
||||
|
||||
### MSAL Basics
|
||||
|
||||
1. [Initialization](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md)
|
||||
2. [Logging in a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md)
|
||||
3. [Acquiring and Using an Access Token](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/acquire-token.md)
|
||||
4. [Managing Token Lifetimes](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/token-lifetimes.md)
|
||||
5. [Managing Accounts](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/Accounts.md)
|
||||
6. [Logging Out a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/logout.md)
|
||||
|
||||
### Advanced Topics
|
||||
|
||||
- [Configuration Options](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md)
|
||||
- [Request and Response Details](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/request-response-object.md)
|
||||
- [Cache Storage](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/caching.md)
|
||||
- [Performance Enhancements](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/performance.md)
|
||||
- [Instance Aware Flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/instance-aware.md)
|
||||
|
||||
## Samples
|
||||
|
||||
The [`msal-browser-samples` folder](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples) contains sample applications for our libraries.
|
||||
|
||||
More instructions to run the samples can be found in the [`README.md` file](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/Readme.md) of the VanillaJSTestApp2.0 folder.
|
||||
|
||||
More advanced samples backed with a tutorial can be found in the [Azure Samples](https://github.com/Azure-Samples) space on GitHub:
|
||||
|
||||
- [JavaScript SPA calling Express.js web API](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/3-Authorization-II/1-call-api)
|
||||
- [JavaScript SPA calling Microsoft Graph via Express.js web API using on-behalf-of flow](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/4-AdvancedGrants/1-call-api-graph)
|
||||
- [Deployment tutorial for Azure App Service and Azure Storage](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/5-Deployment)
|
||||
|
||||
We also provide samples for addin/plugin scenarios:
|
||||
|
||||
- [Office Addin-in using MSAL.js](https://github.com/OfficeDev/PnP-OfficeAddins/blob/main/Samples/auth/Office-Add-in-Microsoft-Graph-React/)
|
||||
- [Teams Tab using MSAL.js](https://github.com/pnp/teams-dev-samples/tree/main/samples/tab-sso/src/nodejs)
|
||||
- [Chromium Extension using MSAL.js](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/ChromiumExtensionSample)
|
||||
|
||||
## Build and Test
|
||||
|
||||
See the [`contributing.md`](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/contributing.md) file for more information.
|
||||
|
||||
### Building the package
|
||||
|
||||
To build the `@azure/msal-browser` library, you can do the following:
|
||||
|
||||
```bash
|
||||
// Change to the msal-browser package directory
|
||||
cd lib/msal-browser/
|
||||
// To run build only for browser package
|
||||
npm run build
|
||||
```
|
||||
|
||||
To build both the `@azure/msal-browser` library and `@azure/msal-common` libraries, you can do the following:
|
||||
|
||||
```bash
|
||||
// Change to the msal-browser package directory
|
||||
cd lib/msal-browser/
|
||||
// To run build for both browser and common packages
|
||||
npm run build:all
|
||||
```
|
||||
|
||||
### Running Tests
|
||||
|
||||
`@azure/msal-browser` uses [jest](https://jestjs.io) to run unit tests.
|
||||
|
||||
```bash
|
||||
// To run tests
|
||||
npm test
|
||||
// To run tests with code coverage
|
||||
npm run test:coverage
|
||||
```
|
||||
|
||||
## Framework Wrappers
|
||||
|
||||
If you are using a framework such as Angular or React you may be interested in using one of our wrapper libraries:
|
||||
|
||||
- Angular: [@azure/msal-angular v2](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular)
|
||||
- React: [@azure/msal-react](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-react)
|
||||
|
||||
## Security Reporting
|
||||
|
||||
If you find a security issue with our libraries or services please report it to [secure@microsoft.com](mailto:secure@microsoft.com) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/security/dd252948) and subscribing to Security Advisory Alerts.
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
|
||||
|
||||
## We Value and Adhere to the Microsoft Open Source Code of Conduct
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
55
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.d.ts
generated
vendored
Normal file
55
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { AccountFilter, AccountInfo, Logger, PerformanceCallbackFunction } from "@azure/msal-common/browser";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
export interface IPublicClientApplication {
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
removeEventCallback(callbackId: string): void;
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
enableAccountStorageEvents(): void;
|
||||
disableAccountStorageEvents(): void;
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
getAccountByLocalId(localId: string): AccountInfo | null;
|
||||
getAccountByUsername(userName: string): AccountInfo | null;
|
||||
getAllAccounts(): AccountInfo[];
|
||||
handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;
|
||||
loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;
|
||||
loginRedirect(request?: RedirectRequest): Promise<void>;
|
||||
logout(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;
|
||||
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
||||
getTokenCache(): ITokenCache;
|
||||
getLogger(): Logger;
|
||||
setLogger(logger: Logger): void;
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
/** @internal */
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
}
|
||||
export declare const stubbedPublicClientApplication: IPublicClientApplication;
|
||||
//# sourceMappingURL=IPublicClientApplication.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IPublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/IPublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,WAAW,EACX,MAAM,EACN,2BAA2B,EAC9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAKpE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;A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BAAgB;IAChB,gBAAgB,IAAI,oBAAoB,CAAC;IACzC,YAAY,CACR,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;AAED,eAAO,MAAM,8BAA8B,EAAE,wBAkK5C,CAAC"}
|
||||
113
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.mjs
generated
vendored
Normal file
113
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.mjs
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';
|
||||
import { stubbedPublicClientApplicationCalled } from '../error/BrowserConfigurationAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
const stubbedPublicClientApplication = {
|
||||
initialize: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
acquireTokenPopup: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
acquireTokenRedirect: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
acquireTokenSilent: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
acquireTokenByCode: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
getAllAccounts: () => {
|
||||
return [];
|
||||
},
|
||||
getAccount: () => {
|
||||
return null;
|
||||
},
|
||||
getAccountByHomeId: () => {
|
||||
return null;
|
||||
},
|
||||
getAccountByUsername: () => {
|
||||
return null;
|
||||
},
|
||||
getAccountByLocalId: () => {
|
||||
return null;
|
||||
},
|
||||
handleRedirectPromise: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
loginPopup: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
loginRedirect: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
logout: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
logoutRedirect: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
logoutPopup: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
ssoSilent: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
addEventCallback: () => {
|
||||
return null;
|
||||
},
|
||||
removeEventCallback: () => {
|
||||
return;
|
||||
},
|
||||
addPerformanceCallback: () => {
|
||||
return "";
|
||||
},
|
||||
removePerformanceCallback: () => {
|
||||
return false;
|
||||
},
|
||||
enableAccountStorageEvents: () => {
|
||||
return;
|
||||
},
|
||||
disableAccountStorageEvents: () => {
|
||||
return;
|
||||
},
|
||||
getTokenCache: () => {
|
||||
throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled);
|
||||
},
|
||||
getLogger: () => {
|
||||
throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled);
|
||||
},
|
||||
setLogger: () => {
|
||||
return;
|
||||
},
|
||||
setActiveAccount: () => {
|
||||
return;
|
||||
},
|
||||
getActiveAccount: () => {
|
||||
return null;
|
||||
},
|
||||
initializeWrapperLibrary: () => {
|
||||
return;
|
||||
},
|
||||
setNavigationClient: () => {
|
||||
return;
|
||||
},
|
||||
getConfiguration: () => {
|
||||
throw createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled);
|
||||
},
|
||||
hydrateCache: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
clearCache: () => {
|
||||
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
|
||||
},
|
||||
};
|
||||
|
||||
export { stubbedPublicClientApplication };
|
||||
//# sourceMappingURL=IPublicClientApplication.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IPublicClientApplication.mjs","sources":["../../src/app/IPublicClientApplication.ts"],"sourcesContent":[null],"names":["BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled"],"mappings":";;;;;AAAA;;;AAGG;AAiFU,MAAA,8BAA8B,GAA6B;IACpE,UAAU,EAAE,MAAK;QACb,OAAO,OAAO,CAAC,MAAM,CACjB,mCAAmC,CAC/BA,oCAAuE,CAC1E,CACJ,CAAC;KACL;IACD,iBAAiB,EAAE,MAAK;QACpB,OAAO,OAAO,CAAC,MAAM,CACjB,mCAAmC,CAC/BA,oCAAuE,CAC1E,CACJ,CAAC;KACL;IACD,oBAAoB,EAAE,MAAK;QACvB,OAAO,OAAO,CAAC,MAAM,CACjB,mCAAmC,CAC/BA,oCAAuE,CAC1E,CACJ,CAAC;KACL;IACD,kBAAkB,EAAE,MAAK;QACrB,OAAO,OAAO,CAAC,MAAM,CACjB,mCAAmC,CAC/BA,oCAAuE,CAC1E,CACJ,CAAC;KACL;IACD,kBAAkB,EAAE,MAAK;QACrB,OAAO,OAAO,CAAC,MAAM,CACjB,mCAAmC,CAC/BA,o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E,CAAC;KACb;IACD,yBAAyB,EAAE,MAAK;AAC5B,QAAA,OAAO,KAAK,CAAC;KAChB;IACD,0BAA0B,EAAE,MAAK;QAC7B,OAAO;KACV;IACD,2BAA2B,EAAE,MAAK;QAC9B,OAAO;KACV;IACD,aAAa,EAAE,MAAK;AAChB,QAAA,MAAM,mCAAmC,CACrCA,oCAAuE,CAC1E,CAAC;KACL;IACD,SAAS,EAAE,MAAK;AACZ,QAAA,MAAM,mCAAmC,CACrCA,oCAAuE,CAC1E,CAAC;KACL;IACD,SAAS,EAAE,MAAK;QACZ,OAAO;KACV;IACD,gBAAgB,EAAE,MAAK;QACnB,OAAO;KACV;IACD,gBAAgB,EAAE,MAAK;AACnB,QAAA,OAAO,IAAI,CAAC;KACf;IACD,wBAAwB,EAAE,MAAK;QAC3B,OAAO;KACV;IACD,mBAAmB,EAAE,MAAK;QACtB,OAAO;KACV;IACD,gBAAgB,EAAE,MAAK;AACnB,QAAA,MAAM,mCAAmC,CACrCA,oCAAuE,CAC1E,CAAC;KACL;IACD,YAAY,EAAE,MAAK;QACf,OAAO,OAAO,CAAC,MAAM,CACjB,mCAAmC,CAC/BA,oCAAuE,CAC1E,CACJ,CAAC;KACL;IACD,UAAU,EAAE,MAAK;QACb,OAAO,OAAO,CAAC,MAAM,CACjB,mCAAmC,CAC/BA,oCAAuE,CAC1E,CACJ,CAAC;KACL;;;;;"}
|
||||
296
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.d.ts
generated
vendored
Normal file
296
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.d.ts
generated
vendored
Normal file
@@ -0,0 +1,296 @@
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { IPublicClientApplication } from "./IPublicClientApplication.js";
|
||||
import { IController } from "../controllers/IController.js";
|
||||
import { PerformanceCallbackFunction, AccountInfo, AccountFilter, Logger } from "@azure/msal-common/browser";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { BrowserConfiguration, Configuration } from "../config/Configuration.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
/**
|
||||
* The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications
|
||||
* to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.
|
||||
*/
|
||||
export declare class PublicClientApplication implements IPublicClientApplication {
|
||||
protected controller: IController;
|
||||
/**
|
||||
* Creates StandardController and passes it to the PublicClientApplication
|
||||
*
|
||||
* @param configuration {Configuration}
|
||||
*/
|
||||
static createPublicClientApplication(configuration: Configuration): Promise<IPublicClientApplication>;
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
|
||||
*
|
||||
* Important attributes in the Configuration object for auth are:
|
||||
* - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
|
||||
* - authority: the authority URL for your application.
|
||||
* - redirect_uri: the uri of your application registered in the portal.
|
||||
*
|
||||
* In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
|
||||
* It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
|
||||
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
|
||||
* If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
|
||||
* If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
|
||||
* To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
|
||||
*
|
||||
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
|
||||
* Full B2C functionality will be available in this library in future versions.
|
||||
*
|
||||
* @param configuration Object for the MSAL PublicClientApplication instance
|
||||
* @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)
|
||||
*/
|
||||
constructor(configuration: Configuration, controller?: IController);
|
||||
/**
|
||||
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
||||
* @param request {?InitializeApplicationRequest}
|
||||
*/
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
|
||||
* the page, so any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
|
||||
*
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object
|
||||
*/
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
||||
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
||||
* This API is not indended for normal authorization code acquisition and redemption.
|
||||
*
|
||||
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
||||
*
|
||||
* @param request {@link AuthorizationCodeRequest}
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
* @param eventTypes
|
||||
*/
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId: string): void;
|
||||
/**
|
||||
* Registers a callback to receive performance events.
|
||||
*
|
||||
* @param {PerformanceCallbackFunction} callback
|
||||
* @returns {string}
|
||||
*/
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
/**
|
||||
* Removes a callback registered with addPerformanceCallback.
|
||||
*
|
||||
* @param {string} callbackId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
/**
|
||||
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
enableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
disableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByLocalId(localId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param userName
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByUsername(userName: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
/**
|
||||
* Event handler function which allows users to fire events after the PublicClientApplication object
|
||||
* has loaded during redirect flows. This should be invoked on all page loads involved in redirect
|
||||
* auth flows.
|
||||
* @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
|
||||
* @returns Token response or null. If the return value is null, then no auth redirect was detected.
|
||||
*/
|
||||
handleRedirectPromise(hash?: string | undefined): Promise<AuthenticationResult | null>;
|
||||
/**
|
||||
* Use when initiating the login process via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
loginPopup(request?: PopupRequest | undefined): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
|
||||
* any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
loginRedirect(request?: RedirectRequest | undefined): Promise<void>;
|
||||
/**
|
||||
* Deprecated logout function. Use logoutRedirect or logoutPopup instead
|
||||
* @param logoutRequest
|
||||
* @deprecated
|
||||
*/
|
||||
logout(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
||||
* Default behaviour is to redirect the user to `window.location.href`.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;
|
||||
/**
|
||||
* This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
|
||||
* - Any browser using a form of Intelligent Tracking Prevention
|
||||
* - If there is not an established session with the service
|
||||
*
|
||||
* In these cases, the request must be done inside a popup or full frame redirect.
|
||||
*
|
||||
* For the cases where interaction is required, you cannot send a request with prompt=none.
|
||||
*
|
||||
* If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
|
||||
* you session on the server still exists.
|
||||
* @param request {@link SsoSilentRequest}
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Gets the token cache for the application.
|
||||
*/
|
||||
getTokenCache(): ITokenCache;
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger(): Logger;
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger: Logger): void;
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
/**
|
||||
* Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
|
||||
* @param sku
|
||||
* @param version
|
||||
*/
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
/**
|
||||
* Sets navigation client
|
||||
* @param navigationClient
|
||||
*/
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
/**
|
||||
* Returns the configuration object
|
||||
* @internal
|
||||
*/
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
/**
|
||||
* Hydrates cache with the tokens and account in the AuthenticationResult object
|
||||
* @param result
|
||||
* @param request - The request object that was used to obtain the AuthenticationResult
|
||||
* @returns
|
||||
*/
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
/**
|
||||
* Clears tokens and account from the browser cache.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
}
|
||||
/**
|
||||
* creates NestedAppAuthController and passes it to the PublicClientApplication,
|
||||
* falls back to StandardController if NestedAppAuthController is not available
|
||||
*
|
||||
* @param configuration
|
||||
* @returns IPublicClientApplication
|
||||
*
|
||||
*/
|
||||
export declare function createNestablePublicClientApplication(configuration: Configuration): Promise<IPublicClientApplication>;
|
||||
/**
|
||||
* creates PublicClientApplication using StandardController
|
||||
*
|
||||
* @param configuration
|
||||
* @returns IPublicClientApplication
|
||||
*
|
||||
*/
|
||||
export declare function createStandardPublicClientApplication(configuration: Configuration): Promise<IPublicClientApplication>;
|
||||
//# sourceMappingURL=PublicClientApplication.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/PublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACH,2BAA2B,EAC3B,WAAW,EACX,aAAa,EACb,MAAM,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,OAAO,EACH,oBAAoB,EACpB,aAAa,EAChB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OA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AW;IAI5B;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI;IAInD;;OAEG;IACH,gBAAgB,IAAI,WAAW,GAAG,IAAI;IAItC;;;;OAIG;IACH,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIhE;;;OAGG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI;IAI9D;;;OAGG;IACH,gBAAgB,IAAI,oBAAoB;IAIxC;;;;;OAKG;IACG,YAAY,CACd,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;IAIhB;;;OAGG;IACH,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D;AAED;;;;;;;GAOG;AACH,wBAAsB,qCAAqC,CACvD,aAAa,EAAE,aAAa,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CAenC;AAED;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACvD,aAAa,EAAE,aAAa,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CAInC"}
|
||||
378
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.mjs
generated
vendored
Normal file
378
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.mjs
generated
vendored
Normal file
@@ -0,0 +1,378 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { createV3Controller } from '../controllers/ControllerFactory.mjs';
|
||||
import { StandardController } from '../controllers/StandardController.mjs';
|
||||
import { StandardOperatingContext } from '../operatingcontext/StandardOperatingContext.mjs';
|
||||
import { NestedAppAuthController } from '../controllers/NestedAppAuthController.mjs';
|
||||
import { NestedAppOperatingContext } from '../operatingcontext/NestedAppOperatingContext.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications
|
||||
* to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.
|
||||
*/
|
||||
class PublicClientApplication {
|
||||
/**
|
||||
* Creates StandardController and passes it to the PublicClientApplication
|
||||
*
|
||||
* @param configuration {Configuration}
|
||||
*/
|
||||
static async createPublicClientApplication(configuration) {
|
||||
const controller = await createV3Controller(configuration);
|
||||
const pca = new PublicClientApplication(configuration, controller);
|
||||
return pca;
|
||||
}
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
|
||||
*
|
||||
* Important attributes in the Configuration object for auth are:
|
||||
* - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
|
||||
* - authority: the authority URL for your application.
|
||||
* - redirect_uri: the uri of your application registered in the portal.
|
||||
*
|
||||
* In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
|
||||
* It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
|
||||
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
|
||||
* If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
|
||||
* If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
|
||||
* To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
|
||||
*
|
||||
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
|
||||
* Full B2C functionality will be available in this library in future versions.
|
||||
*
|
||||
* @param configuration Object for the MSAL PublicClientApplication instance
|
||||
* @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)
|
||||
*/
|
||||
constructor(configuration, controller) {
|
||||
this.controller =
|
||||
controller ||
|
||||
new StandardController(new StandardOperatingContext(configuration));
|
||||
}
|
||||
/**
|
||||
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
||||
* @param request {?InitializeApplicationRequest}
|
||||
*/
|
||||
async initialize(request) {
|
||||
return this.controller.initialize(request);
|
||||
}
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
async acquireTokenPopup(request) {
|
||||
return this.controller.acquireTokenPopup(request);
|
||||
}
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
|
||||
* the page, so any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request) {
|
||||
return this.controller.acquireTokenRedirect(request);
|
||||
}
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
|
||||
*
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object
|
||||
*/
|
||||
acquireTokenSilent(silentRequest) {
|
||||
return this.controller.acquireTokenSilent(silentRequest);
|
||||
}
|
||||
/**
|
||||
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
||||
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
||||
* This API is not indended for normal authorization code acquisition and redemption.
|
||||
*
|
||||
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
||||
*
|
||||
* @param request {@link AuthorizationCodeRequest}
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenByCode(request) {
|
||||
return this.controller.acquireTokenByCode(request);
|
||||
}
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
* @param eventTypes
|
||||
*/
|
||||
addEventCallback(callback, eventTypes) {
|
||||
return this.controller.addEventCallback(callback, eventTypes);
|
||||
}
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId) {
|
||||
return this.controller.removeEventCallback(callbackId);
|
||||
}
|
||||
/**
|
||||
* Registers a callback to receive performance events.
|
||||
*
|
||||
* @param {PerformanceCallbackFunction} callback
|
||||
* @returns {string}
|
||||
*/
|
||||
addPerformanceCallback(callback) {
|
||||
return this.controller.addPerformanceCallback(callback);
|
||||
}
|
||||
/**
|
||||
* Removes a callback registered with addPerformanceCallback.
|
||||
*
|
||||
* @param {string} callbackId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
removePerformanceCallback(callbackId) {
|
||||
return this.controller.removePerformanceCallback(callbackId);
|
||||
}
|
||||
/**
|
||||
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
enableAccountStorageEvents() {
|
||||
this.controller.enableAccountStorageEvents();
|
||||
}
|
||||
/**
|
||||
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
disableAccountStorageEvents() {
|
||||
this.controller.disableAccountStorageEvents();
|
||||
}
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter) {
|
||||
return this.controller.getAccount(accountFilter);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId) {
|
||||
return this.controller.getAccountByHomeId(homeAccountId);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByLocalId(localId) {
|
||||
return this.controller.getAccountByLocalId(localId);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param userName
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByUsername(userName) {
|
||||
return this.controller.getAccountByUsername(userName);
|
||||
}
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter) {
|
||||
return this.controller.getAllAccounts(accountFilter);
|
||||
}
|
||||
/**
|
||||
* Event handler function which allows users to fire events after the PublicClientApplication object
|
||||
* has loaded during redirect flows. This should be invoked on all page loads involved in redirect
|
||||
* auth flows.
|
||||
* @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
|
||||
* @returns Token response or null. If the return value is null, then no auth redirect was detected.
|
||||
*/
|
||||
handleRedirectPromise(hash) {
|
||||
return this.controller.handleRedirectPromise(hash);
|
||||
}
|
||||
/**
|
||||
* Use when initiating the login process via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
loginPopup(request) {
|
||||
return this.controller.loginPopup(request);
|
||||
}
|
||||
/**
|
||||
* Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
|
||||
* any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
loginRedirect(request) {
|
||||
return this.controller.loginRedirect(request);
|
||||
}
|
||||
/**
|
||||
* Deprecated logout function. Use logoutRedirect or logoutPopup instead
|
||||
* @param logoutRequest
|
||||
* @deprecated
|
||||
*/
|
||||
logout(logoutRequest) {
|
||||
return this.controller.logout(logoutRequest);
|
||||
}
|
||||
/**
|
||||
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
||||
* Default behaviour is to redirect the user to `window.location.href`.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutRedirect(logoutRequest) {
|
||||
return this.controller.logoutRedirect(logoutRequest);
|
||||
}
|
||||
/**
|
||||
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutPopup(logoutRequest) {
|
||||
return this.controller.logoutPopup(logoutRequest);
|
||||
}
|
||||
/**
|
||||
* This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
|
||||
* - Any browser using a form of Intelligent Tracking Prevention
|
||||
* - If there is not an established session with the service
|
||||
*
|
||||
* In these cases, the request must be done inside a popup or full frame redirect.
|
||||
*
|
||||
* For the cases where interaction is required, you cannot send a request with prompt=none.
|
||||
*
|
||||
* If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
|
||||
* you session on the server still exists.
|
||||
* @param request {@link SsoSilentRequest}
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
ssoSilent(request) {
|
||||
return this.controller.ssoSilent(request);
|
||||
}
|
||||
/**
|
||||
* Gets the token cache for the application.
|
||||
*/
|
||||
getTokenCache() {
|
||||
return this.controller.getTokenCache();
|
||||
}
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger() {
|
||||
return this.controller.getLogger();
|
||||
}
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger) {
|
||||
this.controller.setLogger(logger);
|
||||
}
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account) {
|
||||
this.controller.setActiveAccount(account);
|
||||
}
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount() {
|
||||
return this.controller.getActiveAccount();
|
||||
}
|
||||
/**
|
||||
* Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
|
||||
* @param sku
|
||||
* @param version
|
||||
*/
|
||||
initializeWrapperLibrary(sku, version) {
|
||||
return this.controller.initializeWrapperLibrary(sku, version);
|
||||
}
|
||||
/**
|
||||
* Sets navigation client
|
||||
* @param navigationClient
|
||||
*/
|
||||
setNavigationClient(navigationClient) {
|
||||
this.controller.setNavigationClient(navigationClient);
|
||||
}
|
||||
/**
|
||||
* Returns the configuration object
|
||||
* @internal
|
||||
*/
|
||||
getConfiguration() {
|
||||
return this.controller.getConfiguration();
|
||||
}
|
||||
/**
|
||||
* Hydrates cache with the tokens and account in the AuthenticationResult object
|
||||
* @param result
|
||||
* @param request - The request object that was used to obtain the AuthenticationResult
|
||||
* @returns
|
||||
*/
|
||||
async hydrateCache(result, request) {
|
||||
return this.controller.hydrateCache(result, request);
|
||||
}
|
||||
/**
|
||||
* Clears tokens and account from the browser cache.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
clearCache(logoutRequest) {
|
||||
return this.controller.clearCache(logoutRequest);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* creates NestedAppAuthController and passes it to the PublicClientApplication,
|
||||
* falls back to StandardController if NestedAppAuthController is not available
|
||||
*
|
||||
* @param configuration
|
||||
* @returns IPublicClientApplication
|
||||
*
|
||||
*/
|
||||
async function createNestablePublicClientApplication(configuration) {
|
||||
const nestedAppAuth = new NestedAppOperatingContext(configuration);
|
||||
await nestedAppAuth.initialize();
|
||||
if (nestedAppAuth.isAvailable()) {
|
||||
const controller = new NestedAppAuthController(nestedAppAuth);
|
||||
const nestablePCA = new PublicClientApplication(configuration, controller);
|
||||
await nestablePCA.initialize();
|
||||
return nestablePCA;
|
||||
}
|
||||
return createStandardPublicClientApplication(configuration);
|
||||
}
|
||||
/**
|
||||
* creates PublicClientApplication using StandardController
|
||||
*
|
||||
* @param configuration
|
||||
* @returns IPublicClientApplication
|
||||
*
|
||||
*/
|
||||
async function createStandardPublicClientApplication(configuration) {
|
||||
const pca = new PublicClientApplication(configuration);
|
||||
await pca.initialize();
|
||||
return pca;
|
||||
}
|
||||
|
||||
export { PublicClientApplication, createNestablePublicClientApplication, createStandardPublicClientApplication };
|
||||
//# sourceMappingURL=PublicClientApplication.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/app/PublicClientApplication.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PublicClientApplication.mjs","sources":["../../src/app/PublicClientApplication.ts"],"sourcesContent":[null],"names":["ControllerFactory.createV3Controller"],"mappings":";;;;;;;;AAAA;;;AAGG;AAmCH;;;AAGG;MACU,uBAAuB,CAAA;AAGhC;;;;AAIG;AACI,IAAA,aAAa,6BAA6B,CAC7C,aAA4B,EAAA;QAE5B,MAAM,UAAU,GAAG,MAAMA,kBAAoC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CAAC,aAAa,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;AAMG;AACI,eAAe,qCAAqC,CACvD,aAA4B,EAAA;AAE5B,IAAA,MAAM,GAAG,GAAG,IAAI,uBAAuB,CAAC,aAAa,CAAC,CAAC;AACvD,IAAA,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;AACvB,IAAA,OAAO,GAAG,CAAC;AACf;;;;"}
|
||||
278
node_modules/@azure/msal-browser/dist/app/PublicClientNext.d.ts
generated
vendored
Normal file
278
node_modules/@azure/msal-browser/dist/app/PublicClientNext.d.ts
generated
vendored
Normal file
@@ -0,0 +1,278 @@
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { IPublicClientApplication } from "./IPublicClientApplication.js";
|
||||
import { IController } from "../controllers/IController.js";
|
||||
import { PerformanceCallbackFunction, AccountInfo, AccountFilter, Logger } from "@azure/msal-common/browser";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { BrowserConfiguration, Configuration } from "../config/Configuration.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
/**
|
||||
* PublicClientNext is an early look at the planned implementation of PublicClientApplication in the next major version of MSAL.js.
|
||||
* It contains support for multiple API implementations based on the runtime environment that it is running in.
|
||||
*
|
||||
* The goals of these changes are to provide a clean separation of behavior between different operating contexts (Nested App Auth, Platform Brokers, Plain old Browser, etc.)
|
||||
* while still providing a consistent API surface for developers.
|
||||
*
|
||||
* Please use PublicClientApplication for any prod/real-world scenarios.
|
||||
* Note: PublicClientNext is experimental and subject to breaking changes without following semver
|
||||
*
|
||||
*/
|
||||
export declare class PublicClientNext implements IPublicClientApplication {
|
||||
protected controller: IController;
|
||||
protected configuration: Configuration;
|
||||
static createPublicClientApplication(configuration: Configuration): Promise<IPublicClientApplication>;
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor for the PublicClientNext used to instantiate the PublicClientNext object
|
||||
*
|
||||
* Important attributes in the Configuration object for auth are:
|
||||
* - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
|
||||
* - authority: the authority URL for your application.
|
||||
* - redirect_uri: the uri of your application registered in the portal.
|
||||
*
|
||||
* In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
|
||||
* It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
|
||||
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
|
||||
* If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
|
||||
* If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
|
||||
* To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
|
||||
*
|
||||
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
|
||||
* Full B2C functionality will be available in this library in future versions.
|
||||
*
|
||||
* @param configuration Object for the MSAL PublicClientApplication instance
|
||||
* @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)
|
||||
*/
|
||||
private constructor();
|
||||
/**
|
||||
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
||||
*/
|
||||
initialize(): Promise<void>;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
|
||||
* the page, so any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
|
||||
*
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object
|
||||
*/
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
||||
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
||||
* This API is not indended for normal authorization code acquisition and redemption.
|
||||
*
|
||||
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
||||
*
|
||||
* @param request {@link AuthorizationCodeRequest}
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
*/
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId: string): void;
|
||||
/**
|
||||
* Registers a callback to receive performance events.
|
||||
*
|
||||
* @param {PerformanceCallbackFunction} callback
|
||||
* @returns {string}
|
||||
*/
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
/**
|
||||
* Removes a callback registered with addPerformanceCallback.
|
||||
*
|
||||
* @param {string} callbackId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
/**
|
||||
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
enableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
disableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByLocalId(localId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param userName
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByUsername(userName: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
/**
|
||||
* Event handler function which allows users to fire events after the PublicClientApplication object
|
||||
* has loaded during redirect flows. This should be invoked on all page loads involved in redirect
|
||||
* auth flows.
|
||||
* @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
|
||||
* @returns Token response or null. If the return value is null, then no auth redirect was detected.
|
||||
*/
|
||||
handleRedirectPromise(hash?: string | undefined): Promise<AuthenticationResult | null>;
|
||||
/**
|
||||
* Use when initiating the login process via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
loginPopup(request?: PopupRequest | undefined): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
|
||||
* any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
loginRedirect(request?: RedirectRequest | undefined): Promise<void>;
|
||||
/**
|
||||
* Deprecated logout function. Use logoutRedirect or logoutPopup instead
|
||||
* @param logoutRequest
|
||||
* @deprecated
|
||||
*/
|
||||
logout(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
||||
* Default behaviour is to redirect the user to `window.location.href`.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutPopup(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
|
||||
* - Any browser using a form of Intelligent Tracking Prevention
|
||||
* - If there is not an established session with the service
|
||||
*
|
||||
* In these cases, the request must be done inside a popup or full frame redirect.
|
||||
*
|
||||
* For the cases where interaction is required, you cannot send a request with prompt=none.
|
||||
*
|
||||
* If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
|
||||
* you session on the server still exists.
|
||||
* @param request {@link SsoSilentRequest}
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Gets the token cache for the application.
|
||||
*/
|
||||
getTokenCache(): ITokenCache;
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger(): Logger;
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger: Logger): void;
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
/**
|
||||
* Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
|
||||
* @param sku
|
||||
* @param version
|
||||
*/
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
/**
|
||||
* Sets navigation client
|
||||
* @param navigationClient
|
||||
*/
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
/**
|
||||
* Returns the configuration object
|
||||
* @internal
|
||||
*/
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
/**
|
||||
* Hydrates cache with the tokens and account in the AuthenticationResult object
|
||||
* @param result
|
||||
* @param request - The request object that was used to obtain the AuthenticationResult
|
||||
* @returns
|
||||
*/
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
/**
|
||||
* Clears tokens and account from the browser cache.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=PublicClientNext.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/app/PublicClientNext.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/app/PublicClientNext.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PublicClientNext.d.ts","sourceRoot":"","sources":["../../src/app/PublicClientNext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACH,2BAA2B,EAC3B,WAAW,EACX,aAAa,EACb,MAAM,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM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oB,CAAC;IAInE;;OAEG;IACH,aAAa,IAAI,WAAW;IAI5B;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI;IAInD;;OAEG;IACH,gBAAgB,IAAI,WAAW,GAAG,IAAI;IAItC;;;;OAIG;IACH,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIhE;;;OAGG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI;IAI9D;;;OAGG;IACH,gBAAgB,IAAI,oBAAoB;IAIxC;;;;;OAKG;IACG,YAAY,CACd,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;IAIhB;;;OAGG;IACH,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/D"}
|
||||
363
node_modules/@azure/msal-browser/dist/app/PublicClientNext.mjs
generated
vendored
Normal file
363
node_modules/@azure/msal-browser/dist/app/PublicClientNext.mjs
generated
vendored
Normal file
@@ -0,0 +1,363 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { createController } from '../controllers/ControllerFactory.mjs';
|
||||
import { UnknownOperatingContextController } from '../controllers/UnknownOperatingContextController.mjs';
|
||||
import { UnknownOperatingContext } from '../operatingcontext/UnknownOperatingContext.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* PublicClientNext is an early look at the planned implementation of PublicClientApplication in the next major version of MSAL.js.
|
||||
* It contains support for multiple API implementations based on the runtime environment that it is running in.
|
||||
*
|
||||
* The goals of these changes are to provide a clean separation of behavior between different operating contexts (Nested App Auth, Platform Brokers, Plain old Browser, etc.)
|
||||
* while still providing a consistent API surface for developers.
|
||||
*
|
||||
* Please use PublicClientApplication for any prod/real-world scenarios.
|
||||
* Note: PublicClientNext is experimental and subject to breaking changes without following semver
|
||||
*
|
||||
*/
|
||||
class PublicClientNext {
|
||||
static async createPublicClientApplication(configuration) {
|
||||
const controller = await createController(configuration);
|
||||
let pca;
|
||||
if (controller !== null) {
|
||||
pca = new PublicClientNext(configuration, controller);
|
||||
}
|
||||
else {
|
||||
pca = new PublicClientNext(configuration);
|
||||
}
|
||||
return pca;
|
||||
}
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor for the PublicClientNext used to instantiate the PublicClientNext object
|
||||
*
|
||||
* Important attributes in the Configuration object for auth are:
|
||||
* - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
|
||||
* - authority: the authority URL for your application.
|
||||
* - redirect_uri: the uri of your application registered in the portal.
|
||||
*
|
||||
* In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
|
||||
* It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
|
||||
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
|
||||
* If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
|
||||
* If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
|
||||
* To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
|
||||
*
|
||||
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
|
||||
* Full B2C functionality will be available in this library in future versions.
|
||||
*
|
||||
* @param configuration Object for the MSAL PublicClientApplication instance
|
||||
* @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)
|
||||
*/
|
||||
constructor(configuration, controller) {
|
||||
this.configuration = configuration;
|
||||
if (controller) {
|
||||
this.controller = controller;
|
||||
}
|
||||
else {
|
||||
const operatingContext = new UnknownOperatingContext(configuration);
|
||||
this.controller = new UnknownOperatingContextController(operatingContext);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
||||
*/
|
||||
async initialize() {
|
||||
if (this.controller instanceof UnknownOperatingContextController) {
|
||||
const result = await createController(this.configuration);
|
||||
if (result !== null) {
|
||||
this.controller = result;
|
||||
}
|
||||
return this.controller.initialize();
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
async acquireTokenPopup(request) {
|
||||
return this.controller.acquireTokenPopup(request);
|
||||
}
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
|
||||
* the page, so any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request) {
|
||||
return this.controller.acquireTokenRedirect(request);
|
||||
}
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
|
||||
*
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object
|
||||
*/
|
||||
acquireTokenSilent(silentRequest) {
|
||||
return this.controller.acquireTokenSilent(silentRequest);
|
||||
}
|
||||
/**
|
||||
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
||||
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
||||
* This API is not indended for normal authorization code acquisition and redemption.
|
||||
*
|
||||
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
||||
*
|
||||
* @param request {@link AuthorizationCodeRequest}
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenByCode(request) {
|
||||
return this.controller.acquireTokenByCode(request);
|
||||
}
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
*/
|
||||
addEventCallback(callback, eventTypes) {
|
||||
return this.controller.addEventCallback(callback, eventTypes);
|
||||
}
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId) {
|
||||
return this.controller.removeEventCallback(callbackId);
|
||||
}
|
||||
/**
|
||||
* Registers a callback to receive performance events.
|
||||
*
|
||||
* @param {PerformanceCallbackFunction} callback
|
||||
* @returns {string}
|
||||
*/
|
||||
addPerformanceCallback(callback) {
|
||||
return this.controller.addPerformanceCallback(callback);
|
||||
}
|
||||
/**
|
||||
* Removes a callback registered with addPerformanceCallback.
|
||||
*
|
||||
* @param {string} callbackId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
removePerformanceCallback(callbackId) {
|
||||
return this.controller.removePerformanceCallback(callbackId);
|
||||
}
|
||||
/**
|
||||
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
enableAccountStorageEvents() {
|
||||
this.controller.enableAccountStorageEvents();
|
||||
}
|
||||
/**
|
||||
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
*/
|
||||
disableAccountStorageEvents() {
|
||||
this.controller.disableAccountStorageEvents();
|
||||
}
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter) {
|
||||
return this.controller.getAccount(accountFilter);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId) {
|
||||
return this.controller.getAccountByHomeId(homeAccountId);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByLocalId(localId) {
|
||||
return this.controller.getAccountByLocalId(localId);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param userName
|
||||
* @returns The account object stored in MSAL
|
||||
* @deprecated - Use getAccount instead
|
||||
*/
|
||||
getAccountByUsername(userName) {
|
||||
return this.controller.getAccountByUsername(userName);
|
||||
}
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter) {
|
||||
return this.controller.getAllAccounts(accountFilter);
|
||||
}
|
||||
/**
|
||||
* Event handler function which allows users to fire events after the PublicClientApplication object
|
||||
* has loaded during redirect flows. This should be invoked on all page loads involved in redirect
|
||||
* auth flows.
|
||||
* @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
|
||||
* @returns Token response or null. If the return value is null, then no auth redirect was detected.
|
||||
*/
|
||||
handleRedirectPromise(hash) {
|
||||
return this.controller.handleRedirectPromise(hash);
|
||||
}
|
||||
/**
|
||||
* Use when initiating the login process via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
loginPopup(request) {
|
||||
return this.controller.loginPopup(request);
|
||||
}
|
||||
/**
|
||||
* Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
|
||||
* any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
loginRedirect(request) {
|
||||
return this.controller.loginRedirect(request);
|
||||
}
|
||||
/**
|
||||
* Deprecated logout function. Use logoutRedirect or logoutPopup instead
|
||||
* @param logoutRequest
|
||||
* @deprecated
|
||||
*/
|
||||
logout(logoutRequest) {
|
||||
return this.controller.logout(logoutRequest);
|
||||
}
|
||||
/**
|
||||
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
||||
* Default behaviour is to redirect the user to `window.location.href`.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutRedirect(logoutRequest) {
|
||||
return this.controller.logoutRedirect(logoutRequest);
|
||||
}
|
||||
/**
|
||||
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutPopup(logoutRequest) {
|
||||
return this.controller.logoutPopup(logoutRequest);
|
||||
}
|
||||
/**
|
||||
* This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
|
||||
* - Any browser using a form of Intelligent Tracking Prevention
|
||||
* - If there is not an established session with the service
|
||||
*
|
||||
* In these cases, the request must be done inside a popup or full frame redirect.
|
||||
*
|
||||
* For the cases where interaction is required, you cannot send a request with prompt=none.
|
||||
*
|
||||
* If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
|
||||
* you session on the server still exists.
|
||||
* @param request {@link SsoSilentRequest}
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
ssoSilent(request) {
|
||||
return this.controller.ssoSilent(request);
|
||||
}
|
||||
/**
|
||||
* Gets the token cache for the application.
|
||||
*/
|
||||
getTokenCache() {
|
||||
return this.controller.getTokenCache();
|
||||
}
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger() {
|
||||
return this.controller.getLogger();
|
||||
}
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger) {
|
||||
this.controller.setLogger(logger);
|
||||
}
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account) {
|
||||
this.controller.setActiveAccount(account);
|
||||
}
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount() {
|
||||
return this.controller.getActiveAccount();
|
||||
}
|
||||
/**
|
||||
* Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
|
||||
* @param sku
|
||||
* @param version
|
||||
*/
|
||||
initializeWrapperLibrary(sku, version) {
|
||||
return this.controller.initializeWrapperLibrary(sku, version);
|
||||
}
|
||||
/**
|
||||
* Sets navigation client
|
||||
* @param navigationClient
|
||||
*/
|
||||
setNavigationClient(navigationClient) {
|
||||
this.controller.setNavigationClient(navigationClient);
|
||||
}
|
||||
/**
|
||||
* Returns the configuration object
|
||||
* @internal
|
||||
*/
|
||||
getConfiguration() {
|
||||
return this.controller.getConfiguration();
|
||||
}
|
||||
/**
|
||||
* Hydrates cache with the tokens and account in the AuthenticationResult object
|
||||
* @param result
|
||||
* @param request - The request object that was used to obtain the AuthenticationResult
|
||||
* @returns
|
||||
*/
|
||||
async hydrateCache(result, request) {
|
||||
return this.controller.hydrateCache(result, request);
|
||||
}
|
||||
/**
|
||||
* Clears tokens and account from the browser cache.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
clearCache(logoutRequest) {
|
||||
return this.controller.clearCache(logoutRequest);
|
||||
}
|
||||
}
|
||||
|
||||
export { PublicClientNext };
|
||||
//# sourceMappingURL=PublicClientNext.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/app/PublicClientNext.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/app/PublicClientNext.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PublicClientNext.mjs","sources":["../../src/app/PublicClientNext.ts"],"sourcesContent":[null],"names":["ControllerFactory.createController"],"mappings":";;;;;;AAAA;;;AAGG;AA+BH;;;;;;;;;;AAUG;MACU,gBAAgB,CAAA;AAQlB,IAAA,aAAa,6BAA6B,CAC7C,aAA4B,EAAA;QAE5B,MAAM,UAAU,GAAG,MAAMA,gBAAkC,CACvD,aAAa,CAChB,CAAC;AACF,QAAA,IAAI,GAAG,CAAC;QACR,IAAI,UAAU,KAAK,IAAI,EAAE;YACrB,GAAG,GAAG,IAAI,gBAAgB,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AACzD,SAAA;AAAM,aAAA;AACH,YAAA,GAAG,GAAG,IAAI,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAC7C,SAAA;AACD,QAAA,OAAO,GAAG,CAAC;KACd;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;IACH,WACI,CAAA,aAA4B,EAC5B,UAAwB,EAAA;AAExB,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;AACnC,QAAA,IAAI,UAAU,EAAE;AACZ,YAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAChC,SAAA;AAAM,aAAA;AACH,YAAA,MAAM,gBAAgB,GAAG,IAAI,uBAAuB,CAAC,aAAa,CAAC,CAAC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;KAC7C;AAED;;AAEG;IACH,gBAAgB,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;KAC7C;AAED;;;;AAIG;IACH,wBAAwB,CAAC,GAAe,EAAE,OAAe,EAAA;QACrD,OAAO,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACjE;AAED;;;AAGG;AACH,IAAA,mBAAmB,CAAC,gBAAmC,EAAA;AACnD,QAAA,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;KACzD;AAED;;;AAGG;IACH,gBAAgB,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;KAC7C;AAED;;;;;AAKG;AACH,IAAA,MAAM,YAAY,CACd,MAA4B,EAC5B,OAIkB,EAAA;QAElB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACxD;AAED;;;AAGG;AACH,IAAA,UAAU,CAAC,aAAiC,EAAA;QACxC,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;KACpD;AACJ;;;;"}
|
||||
63
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.d.ts
generated
vendored
Normal file
63
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.d.ts
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
import { Logger, AuthenticationScheme, IPerformanceClient } from "@azure/msal-common/browser";
|
||||
import { NativeExtensionRequestBody } from "./NativeRequest.js";
|
||||
import { BrowserConfiguration } from "../../config/Configuration.js";
|
||||
export declare class NativeMessageHandler {
|
||||
private extensionId;
|
||||
private extensionVersion;
|
||||
private logger;
|
||||
private readonly handshakeTimeoutMs;
|
||||
private timeoutId;
|
||||
private resolvers;
|
||||
private handshakeResolvers;
|
||||
private messageChannel;
|
||||
private readonly windowListener;
|
||||
private readonly performanceClient;
|
||||
private readonly handshakeEvent;
|
||||
constructor(logger: Logger, handshakeTimeoutMs: number, performanceClient: IPerformanceClient, extensionId?: string);
|
||||
/**
|
||||
* Sends a given message to the extension and resolves with the extension response
|
||||
* @param body
|
||||
*/
|
||||
sendMessage(body: NativeExtensionRequestBody): Promise<object>;
|
||||
/**
|
||||
* Returns an instance of the MessageHandler that has successfully established a connection with an extension
|
||||
* @param {Logger} logger
|
||||
* @param {number} handshakeTimeoutMs
|
||||
* @param {IPerformanceClient} performanceClient
|
||||
* @param {ICrypto} crypto
|
||||
*/
|
||||
static createProvider(logger: Logger, handshakeTimeoutMs: number, performanceClient: IPerformanceClient): Promise<NativeMessageHandler>;
|
||||
/**
|
||||
* Send handshake request helper.
|
||||
*/
|
||||
private sendHandshakeRequest;
|
||||
/**
|
||||
* Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.
|
||||
* @param event
|
||||
*/
|
||||
private onWindowMessage;
|
||||
/**
|
||||
* Invoked when a message is received from the extension on the MessageChannel port
|
||||
* @param event
|
||||
*/
|
||||
private onChannelMessage;
|
||||
/**
|
||||
* Returns the Id for the browser extension this handler is communicating with
|
||||
* @returns
|
||||
*/
|
||||
getExtensionId(): string | undefined;
|
||||
/**
|
||||
* Returns the version for the browser extension this handler is communicating with
|
||||
* @returns
|
||||
*/
|
||||
getExtensionVersion(): string | undefined;
|
||||
/**
|
||||
* Returns boolean indicating whether or not the request should attempt to use native broker
|
||||
* @param logger
|
||||
* @param config
|
||||
* @param nativeExtensionProvider
|
||||
* @param authenticationScheme
|
||||
*/
|
||||
static isPlatformBrokerAvailable(config: BrowserConfiguration, logger: Logger, nativeExtensionProvider?: NativeMessageHandler, authenticationScheme?: AuthenticationScheme): boolean;
|
||||
}
|
||||
//# sourceMappingURL=NativeMessageHandler.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NativeMessageHandler.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/NativeMessageHandler.ts"],"names":[],"mappings":"AASA,OAAO,EACH,MAAM,EAIN,oBAAoB,EAGpB,kBAAkB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,0BAA0B,EAC7B,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAUrE,qBAAa,oBAAoB;IAC7B,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;IAC5C,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,kBAAkB,CAAuC;IACjE,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgC;IAC/D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAqB;IACvD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6B;gBAGxD,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,MAAM,EAC1B,iBAAiB,EAAE,kBAAkB,EACrC,WAAW,CAAC,EAAE,MAAM;IAexB;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,MAAM,CAAC;IAwBpE;;;;;;OAMG;WACU,cAAc,CACvB,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,MAAM,EAC1B,iBAAiB,EAAE,kBAAkB,GACtC,OAAO,CAAC,oBAAoB,CAAC;IAuBhC;;OAEG;YACW,oBAAoB;IAsDlC;;;OAGG;IACH,OAAO,CAAC,eAAe;IAyDvB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAiGxB;;;OAGG;IACH,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC;;;OAGG;IACH,mBAAmB,IAAI,MAAM,GAAG,SAAS;IAIzC;;;;;;OAMG;IACH,MAAM,CAAC,yBAAyB,CAC5B,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,MAAM,EACd,uBAAuB,CAAC,EAAE,oBAAoB,EAC9C,oBAAoB,CAAC,EAAE,oBAAoB,GAC5C,OAAO;CAoCb"}
|
||||
266
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.mjs
generated
vendored
Normal file
266
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.mjs
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { NativeConstants, NativeExtensionMethod } from '../../utils/BrowserConstants.mjs';
|
||||
import { PerformanceEvents, createAuthError, AuthErrorCodes, AuthenticationScheme } from '@azure/msal-common/browser';
|
||||
import { createNativeAuthError } from '../../error/NativeAuthError.mjs';
|
||||
import { createBrowserAuthError } from '../../error/BrowserAuthError.mjs';
|
||||
import { createNewGuid } from '../../crypto/BrowserCrypto.mjs';
|
||||
import { nativeHandshakeTimeout, nativeExtensionNotInstalled } from '../../error/BrowserAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
class NativeMessageHandler {
|
||||
constructor(logger, handshakeTimeoutMs, performanceClient, extensionId) {
|
||||
this.logger = logger;
|
||||
this.handshakeTimeoutMs = handshakeTimeoutMs;
|
||||
this.extensionId = extensionId;
|
||||
this.resolvers = new Map(); // Used for non-handshake messages
|
||||
this.handshakeResolvers = new Map(); // Used for handshake messages
|
||||
this.messageChannel = new MessageChannel();
|
||||
this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound
|
||||
this.performanceClient = performanceClient;
|
||||
this.handshakeEvent = performanceClient.startMeasurement(PerformanceEvents.NativeMessageHandlerHandshake);
|
||||
}
|
||||
/**
|
||||
* Sends a given message to the extension and resolves with the extension response
|
||||
* @param body
|
||||
*/
|
||||
async sendMessage(body) {
|
||||
this.logger.trace("NativeMessageHandler - sendMessage called.");
|
||||
const req = {
|
||||
channel: NativeConstants.CHANNEL_ID,
|
||||
extensionId: this.extensionId,
|
||||
responseId: createNewGuid(),
|
||||
body: body,
|
||||
};
|
||||
this.logger.trace("NativeMessageHandler - Sending request to browser extension");
|
||||
this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(req)}`);
|
||||
this.messageChannel.port1.postMessage(req);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.resolvers.set(req.responseId, { resolve, reject });
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Returns an instance of the MessageHandler that has successfully established a connection with an extension
|
||||
* @param {Logger} logger
|
||||
* @param {number} handshakeTimeoutMs
|
||||
* @param {IPerformanceClient} performanceClient
|
||||
* @param {ICrypto} crypto
|
||||
*/
|
||||
static async createProvider(logger, handshakeTimeoutMs, performanceClient) {
|
||||
logger.trace("NativeMessageHandler - createProvider called.");
|
||||
try {
|
||||
const preferredProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient, NativeConstants.PREFERRED_EXTENSION_ID);
|
||||
await preferredProvider.sendHandshakeRequest();
|
||||
return preferredProvider;
|
||||
}
|
||||
catch (e) {
|
||||
// If preferred extension fails for whatever reason, fallback to using any installed extension
|
||||
const backupProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient);
|
||||
await backupProvider.sendHandshakeRequest();
|
||||
return backupProvider;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Send handshake request helper.
|
||||
*/
|
||||
async sendHandshakeRequest() {
|
||||
this.logger.trace("NativeMessageHandler - sendHandshakeRequest called.");
|
||||
// Register this event listener before sending handshake
|
||||
window.addEventListener("message", this.windowListener, false); // false is important, because content script message processing should work first
|
||||
const req = {
|
||||
channel: NativeConstants.CHANNEL_ID,
|
||||
extensionId: this.extensionId,
|
||||
responseId: createNewGuid(),
|
||||
body: {
|
||||
method: NativeExtensionMethod.HandshakeRequest,
|
||||
},
|
||||
};
|
||||
this.handshakeEvent.add({
|
||||
extensionId: this.extensionId,
|
||||
extensionHandshakeTimeoutMs: this.handshakeTimeoutMs,
|
||||
});
|
||||
this.messageChannel.port1.onmessage = (event) => {
|
||||
this.onChannelMessage(event);
|
||||
};
|
||||
window.postMessage(req, window.origin, [this.messageChannel.port2]);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.handshakeResolvers.set(req.responseId, { resolve, reject });
|
||||
this.timeoutId = window.setTimeout(() => {
|
||||
/*
|
||||
* Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.
|
||||
* This typically suggests an event handler stopped propagation of the Handshake request but did not respond to it on the MessageChannel port
|
||||
*/
|
||||
window.removeEventListener("message", this.windowListener, false);
|
||||
this.messageChannel.port1.close();
|
||||
this.messageChannel.port2.close();
|
||||
this.handshakeEvent.end({
|
||||
extensionHandshakeTimedOut: true,
|
||||
success: false,
|
||||
});
|
||||
reject(createBrowserAuthError(nativeHandshakeTimeout));
|
||||
this.handshakeResolvers.delete(req.responseId);
|
||||
}, this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.
|
||||
* @param event
|
||||
*/
|
||||
onWindowMessage(event) {
|
||||
this.logger.trace("NativeMessageHandler - onWindowMessage called");
|
||||
// We only accept messages from ourselves
|
||||
if (event.source !== window) {
|
||||
return;
|
||||
}
|
||||
const request = event.data;
|
||||
if (!request.channel ||
|
||||
request.channel !== NativeConstants.CHANNEL_ID) {
|
||||
return;
|
||||
}
|
||||
if (request.extensionId && request.extensionId !== this.extensionId) {
|
||||
return;
|
||||
}
|
||||
if (request.body.method === NativeExtensionMethod.HandshakeRequest) {
|
||||
const handshakeResolver = this.handshakeResolvers.get(request.responseId);
|
||||
/*
|
||||
* Filter out responses with no matched resolvers sooner to keep channel ports open while waiting for
|
||||
* the proper response.
|
||||
*/
|
||||
if (!handshakeResolver) {
|
||||
this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${request.responseId}`);
|
||||
return;
|
||||
}
|
||||
// If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed
|
||||
this.logger.verbose(request.extensionId
|
||||
? `Extension with id: ${request.extensionId} not installed`
|
||||
: "No extension installed");
|
||||
clearTimeout(this.timeoutId);
|
||||
this.messageChannel.port1.close();
|
||||
this.messageChannel.port2.close();
|
||||
window.removeEventListener("message", this.windowListener, false);
|
||||
this.handshakeEvent.end({
|
||||
success: false,
|
||||
extensionInstalled: false,
|
||||
});
|
||||
handshakeResolver.reject(createBrowserAuthError(nativeExtensionNotInstalled));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Invoked when a message is received from the extension on the MessageChannel port
|
||||
* @param event
|
||||
*/
|
||||
onChannelMessage(event) {
|
||||
this.logger.trace("NativeMessageHandler - onChannelMessage called.");
|
||||
const request = event.data;
|
||||
const resolver = this.resolvers.get(request.responseId);
|
||||
const handshakeResolver = this.handshakeResolvers.get(request.responseId);
|
||||
try {
|
||||
const method = request.body.method;
|
||||
if (method === NativeExtensionMethod.Response) {
|
||||
if (!resolver) {
|
||||
return;
|
||||
}
|
||||
const response = request.body.response;
|
||||
this.logger.trace("NativeMessageHandler - Received response from browser extension");
|
||||
this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(response)}`);
|
||||
if (response.status !== "Success") {
|
||||
resolver.reject(createNativeAuthError(response.code, response.description, response.ext));
|
||||
}
|
||||
else if (response.result) {
|
||||
if (response.result["code"] &&
|
||||
response.result["description"]) {
|
||||
resolver.reject(createNativeAuthError(response.result["code"], response.result["description"], response.result["ext"]));
|
||||
}
|
||||
else {
|
||||
resolver.resolve(response.result);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw createAuthError(AuthErrorCodes.unexpectedError, "Event does not contain result.");
|
||||
}
|
||||
this.resolvers.delete(request.responseId);
|
||||
}
|
||||
else if (method === NativeExtensionMethod.HandshakeResponse) {
|
||||
if (!handshakeResolver) {
|
||||
this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${request.responseId}`);
|
||||
return;
|
||||
}
|
||||
clearTimeout(this.timeoutId); // Clear setTimeout
|
||||
window.removeEventListener("message", this.windowListener, false); // Remove 'No extension' listener
|
||||
this.extensionId = request.extensionId;
|
||||
this.extensionVersion = request.body.version;
|
||||
this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`);
|
||||
this.handshakeEvent.end({
|
||||
extensionInstalled: true,
|
||||
success: true,
|
||||
});
|
||||
handshakeResolver.resolve();
|
||||
this.handshakeResolvers.delete(request.responseId);
|
||||
}
|
||||
// Do nothing if method is not Response or HandshakeResponse
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.error("Error parsing response from WAM Extension");
|
||||
this.logger.errorPii(`Error parsing response from WAM Extension: ${err}`);
|
||||
this.logger.errorPii(`Unable to parse ${event}`);
|
||||
if (resolver) {
|
||||
resolver.reject(err);
|
||||
}
|
||||
else if (handshakeResolver) {
|
||||
handshakeResolver.reject(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the Id for the browser extension this handler is communicating with
|
||||
* @returns
|
||||
*/
|
||||
getExtensionId() {
|
||||
return this.extensionId;
|
||||
}
|
||||
/**
|
||||
* Returns the version for the browser extension this handler is communicating with
|
||||
* @returns
|
||||
*/
|
||||
getExtensionVersion() {
|
||||
return this.extensionVersion;
|
||||
}
|
||||
/**
|
||||
* Returns boolean indicating whether or not the request should attempt to use native broker
|
||||
* @param logger
|
||||
* @param config
|
||||
* @param nativeExtensionProvider
|
||||
* @param authenticationScheme
|
||||
*/
|
||||
static isPlatformBrokerAvailable(config, logger, nativeExtensionProvider, authenticationScheme) {
|
||||
logger.trace("isPlatformBrokerAvailable called");
|
||||
if (!config.system.allowPlatformBroker) {
|
||||
logger.trace("isPlatformBrokerAvailable: allowPlatformBroker is not enabled, returning false");
|
||||
// Developer disabled WAM
|
||||
return false;
|
||||
}
|
||||
if (!nativeExtensionProvider) {
|
||||
logger.trace("isPlatformBrokerAvailable: Platform extension provider is not initialized, returning false");
|
||||
// Extension is not available
|
||||
return false;
|
||||
}
|
||||
if (authenticationScheme) {
|
||||
switch (authenticationScheme) {
|
||||
case AuthenticationScheme.BEARER:
|
||||
case AuthenticationScheme.POP:
|
||||
logger.trace("isPlatformBrokerAvailable: authenticationScheme is supported, returning true");
|
||||
return true;
|
||||
default:
|
||||
logger.trace("isPlatformBrokerAvailable: authenticationScheme is not supported, returning false");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export { NativeMessageHandler };
|
||||
//# sourceMappingURL=NativeMessageHandler.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
47
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeRequest.d.ts
generated
vendored
Normal file
47
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeRequest.d.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
import { NativeExtensionMethod } from "../../utils/BrowserConstants.js";
|
||||
import { StoreInCache, StringDict } from "@azure/msal-common/browser";
|
||||
/**
|
||||
* Token request which native broker will use to acquire tokens
|
||||
*/
|
||||
export type NativeTokenRequest = {
|
||||
accountId: string;
|
||||
clientId: string;
|
||||
authority: string;
|
||||
redirectUri: string;
|
||||
scope: string;
|
||||
correlationId: string;
|
||||
windowTitleSubstring: string;
|
||||
prompt?: string;
|
||||
nonce?: string;
|
||||
claims?: string;
|
||||
state?: string;
|
||||
reqCnf?: string;
|
||||
keyId?: string;
|
||||
tokenType?: string;
|
||||
shrClaims?: string;
|
||||
shrNonce?: string;
|
||||
resourceRequestMethod?: string;
|
||||
resourceRequestUri?: string;
|
||||
extendedExpiryToken?: boolean;
|
||||
extraParameters?: StringDict;
|
||||
storeInCache?: StoreInCache;
|
||||
signPopToken?: boolean;
|
||||
embeddedClientId?: string;
|
||||
};
|
||||
/**
|
||||
* Request which will be forwarded to native broker by the browser extension
|
||||
*/
|
||||
export type NativeExtensionRequestBody = {
|
||||
method: NativeExtensionMethod;
|
||||
request?: NativeTokenRequest;
|
||||
};
|
||||
/**
|
||||
* Browser extension request
|
||||
*/
|
||||
export type NativeExtensionRequest = {
|
||||
channel: string;
|
||||
responseId: string;
|
||||
extensionId?: string;
|
||||
body: NativeExtensionRequestBody;
|
||||
};
|
||||
//# sourceMappingURL=NativeRequest.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeRequest.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeRequest.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NativeRequest.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/NativeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACrC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,0BAA0B,CAAC;CACpC,CAAC"}
|
||||
49
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeResponse.d.ts
generated
vendored
Normal file
49
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeResponse.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Account properties returned by Native Platform e.g. WAM
|
||||
*/
|
||||
export type NativeAccountInfo = {
|
||||
id: string;
|
||||
properties: object;
|
||||
userName: string;
|
||||
};
|
||||
/**
|
||||
* Token response returned by Native Platform
|
||||
*/
|
||||
export type NativeResponse = {
|
||||
access_token: string;
|
||||
account: NativeAccountInfo;
|
||||
client_info: string;
|
||||
expires_in: number;
|
||||
id_token: string;
|
||||
properties: NativeResponseProperties;
|
||||
scope: string;
|
||||
state: string;
|
||||
shr?: string;
|
||||
extendedLifetimeToken?: boolean;
|
||||
};
|
||||
/**
|
||||
* Properties returned under "properties" of the NativeResponse
|
||||
*/
|
||||
export type NativeResponseProperties = {
|
||||
MATS?: string;
|
||||
};
|
||||
/**
|
||||
* The native token broker can optionally include additional information about operations it performs. If that data is returned, MSAL.js will include the following properties in the telemetry it collects.
|
||||
*/
|
||||
export type MATS = {
|
||||
is_cached?: number;
|
||||
broker_version?: string;
|
||||
account_join_on_start?: string;
|
||||
account_join_on_end?: string;
|
||||
device_join?: string;
|
||||
prompt_behavior?: string;
|
||||
api_error_code?: number;
|
||||
ui_visible?: boolean;
|
||||
silent_code?: number;
|
||||
silent_bi_sub_code?: number;
|
||||
silent_message?: string;
|
||||
silent_status?: number;
|
||||
http_status?: number;
|
||||
http_event_count?: number;
|
||||
};
|
||||
//# sourceMappingURL=NativeResponse.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeResponse.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeResponse.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NativeResponse.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/NativeResponse.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,wBAAwB,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC"}
|
||||
8
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.d.ts
generated
vendored
Normal file
8
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export declare const USER_INTERACTION_REQUIRED = "USER_INTERACTION_REQUIRED";
|
||||
export declare const USER_CANCEL = "USER_CANCEL";
|
||||
export declare const NO_NETWORK = "NO_NETWORK";
|
||||
export declare const TRANSIENT_ERROR = "TRANSIENT_ERROR";
|
||||
export declare const PERSISTENT_ERROR = "PERSISTENT_ERROR";
|
||||
export declare const DISABLED = "DISABLED";
|
||||
export declare const ACCOUNT_UNAVAILABLE = "ACCOUNT_UNAVAILABLE";
|
||||
//# sourceMappingURL=NativeStatusCodes.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NativeStatusCodes.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/NativeStatusCodes.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AACrE,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,mBAAmB,wBAAwB,CAAC"}
|
||||
16
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.mjs
generated
vendored
Normal file
16
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.mjs
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
// Status Codes that can be thrown by WAM
|
||||
const USER_INTERACTION_REQUIRED = "USER_INTERACTION_REQUIRED";
|
||||
const USER_CANCEL = "USER_CANCEL";
|
||||
const NO_NETWORK = "NO_NETWORK";
|
||||
const PERSISTENT_ERROR = "PERSISTENT_ERROR";
|
||||
const DISABLED = "DISABLED";
|
||||
const ACCOUNT_UNAVAILABLE = "ACCOUNT_UNAVAILABLE";
|
||||
|
||||
export { ACCOUNT_UNAVAILABLE, DISABLED, NO_NETWORK, PERSISTENT_ERROR, USER_CANCEL, USER_INTERACTION_REQUIRED };
|
||||
//# sourceMappingURL=NativeStatusCodes.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeStatusCodes.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NativeStatusCodes.mjs","sources":["../../../src/broker/nativeBroker/NativeStatusCodes.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEH;AACO,MAAM,yBAAyB,GAAG,4BAA4B;AAC9D,MAAM,WAAW,GAAG,cAAc;AAClC,MAAM,UAAU,GAAG,aAAa;AAEhC,MAAM,gBAAgB,GAAG,mBAAmB;AAC5C,MAAM,QAAQ,GAAG,WAAW;AAC5B,MAAM,mBAAmB,GAAG;;;;"}
|
||||
49
node_modules/@azure/msal-browser/dist/cache/AccountManager.d.ts
generated
vendored
Normal file
49
node_modules/@azure/msal-browser/dist/cache/AccountManager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { AccountInfo, AccountFilter, Logger } from "@azure/msal-common/browser";
|
||||
import { BrowserCacheManager } from "./BrowserCacheManager.js";
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
export declare function getAllAccounts(logger: Logger, browserStorage: BrowserCacheManager, isInBrowser: boolean, accountFilter?: AccountFilter): AccountInfo[];
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
export declare function getAccount(accountFilter: AccountFilter, logger: Logger, browserStorage: BrowserCacheManager): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
export declare function getAccountByUsername(username: string, logger: Logger, browserStorage: BrowserCacheManager): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
export declare function getAccountByHomeId(homeAccountId: string, logger: Logger, browserStorage: BrowserCacheManager): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
export declare function getAccountByLocalId(localAccountId: string, logger: Logger, browserStorage: BrowserCacheManager): AccountInfo | null;
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
export declare function setActiveAccount(account: AccountInfo | null, browserStorage: BrowserCacheManager): void;
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
export declare function getActiveAccount(browserStorage: BrowserCacheManager): AccountInfo | null;
|
||||
//# sourceMappingURL=AccountManager.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/AccountManager.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/AccountManager.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AccountManager.d.ts","sourceRoot":"","sources":["../../src/cache/AccountManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,cAAc,CAC1B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,EACnC,WAAW,EAAE,OAAO,EACpB,aAAa,CAAC,EAAE,aAAa,GAC9B,WAAW,EAAE,CAGf;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACtB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,GACpC,WAAW,GAAG,IAAI,CAmBpB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,GACpC,WAAW,GAAG,IAAI,CAwBpB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,GACpC,WAAW,GAAG,IAAI,CAwBpB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,GACpC,WAAW,GAAG,IAAI,CAwBpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,cAAc,EAAE,mBAAmB,GACpC,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,cAAc,EAAE,mBAAmB,GACpC,WAAW,GAAG,IAAI,CAEpB"}
|
||||
131
node_modules/@azure/msal-browser/dist/cache/AccountManager.mjs
generated
vendored
Normal file
131
node_modules/@azure/msal-browser/dist/cache/AccountManager.mjs
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
function getAllAccounts(logger, browserStorage, isInBrowser, accountFilter) {
|
||||
logger.verbose("getAllAccounts called");
|
||||
return isInBrowser ? browserStorage.getAllAccounts(accountFilter) : [];
|
||||
}
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
function getAccount(accountFilter, logger, browserStorage) {
|
||||
logger.trace("getAccount called");
|
||||
if (Object.keys(accountFilter).length === 0) {
|
||||
logger.warning("getAccount: No accountFilter provided");
|
||||
return null;
|
||||
}
|
||||
const account = browserStorage.getAccountInfoFilteredBy(accountFilter);
|
||||
if (account) {
|
||||
logger.verbose("getAccount: Account matching provided filter found, returning");
|
||||
return account;
|
||||
}
|
||||
else {
|
||||
logger.verbose("getAccount: No matching account found, returning null");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
function getAccountByUsername(username, logger, browserStorage) {
|
||||
logger.trace("getAccountByUsername called");
|
||||
if (!username) {
|
||||
logger.warning("getAccountByUsername: No username provided");
|
||||
return null;
|
||||
}
|
||||
const account = browserStorage.getAccountInfoFilteredBy({
|
||||
username,
|
||||
});
|
||||
if (account) {
|
||||
logger.verbose("getAccountByUsername: Account matching username found, returning");
|
||||
logger.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${username}`);
|
||||
return account;
|
||||
}
|
||||
else {
|
||||
logger.verbose("getAccountByUsername: No matching account found, returning null");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
function getAccountByHomeId(homeAccountId, logger, browserStorage) {
|
||||
logger.trace("getAccountByHomeId called");
|
||||
if (!homeAccountId) {
|
||||
logger.warning("getAccountByHomeId: No homeAccountId provided");
|
||||
return null;
|
||||
}
|
||||
const account = browserStorage.getAccountInfoFilteredBy({
|
||||
homeAccountId,
|
||||
});
|
||||
if (account) {
|
||||
logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning");
|
||||
logger.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${homeAccountId}`);
|
||||
return account;
|
||||
}
|
||||
else {
|
||||
logger.verbose("getAccountByHomeId: No matching account found, returning null");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
function getAccountByLocalId(localAccountId, logger, browserStorage) {
|
||||
logger.trace("getAccountByLocalId called");
|
||||
if (!localAccountId) {
|
||||
logger.warning("getAccountByLocalId: No localAccountId provided");
|
||||
return null;
|
||||
}
|
||||
const account = browserStorage.getAccountInfoFilteredBy({
|
||||
localAccountId,
|
||||
});
|
||||
if (account) {
|
||||
logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning");
|
||||
logger.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${localAccountId}`);
|
||||
return account;
|
||||
}
|
||||
else {
|
||||
logger.verbose("getAccountByLocalId: No matching account found, returning null");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
function setActiveAccount(account, browserStorage) {
|
||||
browserStorage.setActiveAccount(account);
|
||||
}
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
function getActiveAccount(browserStorage) {
|
||||
return browserStorage.getActiveAccount();
|
||||
}
|
||||
|
||||
export { getAccount, getAccountByHomeId, getAccountByLocalId, getAccountByUsername, getActiveAccount, getAllAccounts, setActiveAccount };
|
||||
//# sourceMappingURL=AccountManager.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/AccountManager.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/AccountManager.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AccountManager.mjs","sources":["../../src/cache/AccountManager.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAKH;;;;AAIG;AACG,SAAU,cAAc,CAC1B,MAAc,EACd,cAAmC,EACnC,WAAoB,EACpB,aAA6B,EAAA;AAE7B,IAAA,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACxC,IAAA,OAAO,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;AAC3E,CAAC;AAED;;;;AAIG;SACa,UAAU,CACtB,aAA4B,EAC5B,MAAc,EACd,cAAmC,EAAA;AAEnC,IAAA,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAClC,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,QAAA,MAAM,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;AACxD,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;IAED,MAAM,OAAO,GACT,cAAc,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;AAE3D,IAAA,IAAI,OAAO,EAAE;AACT,QAAA,MAAM,CAA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/@azure/msal-browser/dist/cache/AsyncMemoryStorage.d.ts
generated
vendored
Normal file
51
node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import { Logger } from "@azure/msal-common/browser";
|
||||
import { IAsyncStorage } from "./IAsyncStorage.js";
|
||||
/**
|
||||
* This class allows MSAL to store artifacts asynchronously using the DatabaseStorage IndexedDB wrapper,
|
||||
* backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.
|
||||
*/
|
||||
export declare class AsyncMemoryStorage<T> implements IAsyncStorage<T> {
|
||||
private inMemoryCache;
|
||||
private indexedDBCache;
|
||||
private logger;
|
||||
constructor(logger: Logger);
|
||||
private handleDatabaseAccessError;
|
||||
/**
|
||||
* Get the item matching the given key. Tries in-memory cache first, then in the asynchronous
|
||||
* storage object if item isn't found in-memory.
|
||||
* @param key
|
||||
*/
|
||||
getItem(key: string): Promise<T | null>;
|
||||
/**
|
||||
* Sets the item in the in-memory cache and then tries to set it in the asynchronous
|
||||
* storage object with the given key.
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
setItem(key: string, value: T): Promise<void>;
|
||||
/**
|
||||
* Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.
|
||||
* @param key
|
||||
*/
|
||||
removeItem(key: string): Promise<void>;
|
||||
/**
|
||||
* Get all the keys from the in-memory cache as an iterable array of strings. If no keys are found, query the keys in the
|
||||
* asynchronous storage object.
|
||||
*/
|
||||
getKeys(): Promise<string[]>;
|
||||
/**
|
||||
* Returns true or false if the given key is present in the cache.
|
||||
* @param key
|
||||
*/
|
||||
containsKey(key: string): Promise<boolean>;
|
||||
/**
|
||||
* Clears in-memory Map
|
||||
*/
|
||||
clearInMemory(): void;
|
||||
/**
|
||||
* Tries to delete the IndexedDB database
|
||||
* @returns
|
||||
*/
|
||||
clearPersistent(): Promise<boolean>;
|
||||
}
|
||||
//# sourceMappingURL=AsyncMemoryStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AsyncMemoryStorage.d.ts","sourceRoot":"","sources":["../../src/cache/AsyncMemoryStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAMpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;GAGG;AACH,qBAAa,kBAAkB,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,MAAM;IAM1B,OAAO,CAAC,yBAAyB;IAYjC;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAe7C;;;;;OAKG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD;;;OAGG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS5C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAelC;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAehD;;OAEG;IACH,aAAa,IAAI,IAAI;IAOrB;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;CAc5C"}
|
||||
141
node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.mjs
generated
vendored
Normal file
141
node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.mjs
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { BrowserAuthError } from '../error/BrowserAuthError.mjs';
|
||||
import { DatabaseStorage } from './DatabaseStorage.mjs';
|
||||
import { MemoryStorage } from './MemoryStorage.mjs';
|
||||
import { databaseUnavailable } from '../error/BrowserAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* This class allows MSAL to store artifacts asynchronously using the DatabaseStorage IndexedDB wrapper,
|
||||
* backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.
|
||||
*/
|
||||
class AsyncMemoryStorage {
|
||||
constructor(logger) {
|
||||
this.inMemoryCache = new MemoryStorage();
|
||||
this.indexedDBCache = new DatabaseStorage();
|
||||
this.logger = logger;
|
||||
}
|
||||
handleDatabaseAccessError(error) {
|
||||
if (error instanceof BrowserAuthError &&
|
||||
error.errorCode === databaseUnavailable) {
|
||||
this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");
|
||||
}
|
||||
else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get the item matching the given key. Tries in-memory cache first, then in the asynchronous
|
||||
* storage object if item isn't found in-memory.
|
||||
* @param key
|
||||
*/
|
||||
async getItem(key) {
|
||||
const item = this.inMemoryCache.getItem(key);
|
||||
if (!item) {
|
||||
try {
|
||||
this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage.");
|
||||
return await this.indexedDBCache.getItem(key);
|
||||
}
|
||||
catch (e) {
|
||||
this.handleDatabaseAccessError(e);
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
/**
|
||||
* Sets the item in the in-memory cache and then tries to set it in the asynchronous
|
||||
* storage object with the given key.
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
async setItem(key, value) {
|
||||
this.inMemoryCache.setItem(key, value);
|
||||
try {
|
||||
await this.indexedDBCache.setItem(key, value);
|
||||
}
|
||||
catch (e) {
|
||||
this.handleDatabaseAccessError(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.
|
||||
* @param key
|
||||
*/
|
||||
async removeItem(key) {
|
||||
this.inMemoryCache.removeItem(key);
|
||||
try {
|
||||
await this.indexedDBCache.removeItem(key);
|
||||
}
|
||||
catch (e) {
|
||||
this.handleDatabaseAccessError(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get all the keys from the in-memory cache as an iterable array of strings. If no keys are found, query the keys in the
|
||||
* asynchronous storage object.
|
||||
*/
|
||||
async getKeys() {
|
||||
const cacheKeys = this.inMemoryCache.getKeys();
|
||||
if (cacheKeys.length === 0) {
|
||||
try {
|
||||
this.logger.verbose("In-memory cache is empty, now querying persistent storage.");
|
||||
return await this.indexedDBCache.getKeys();
|
||||
}
|
||||
catch (e) {
|
||||
this.handleDatabaseAccessError(e);
|
||||
}
|
||||
}
|
||||
return cacheKeys;
|
||||
}
|
||||
/**
|
||||
* Returns true or false if the given key is present in the cache.
|
||||
* @param key
|
||||
*/
|
||||
async containsKey(key) {
|
||||
const containsKey = this.inMemoryCache.containsKey(key);
|
||||
if (!containsKey) {
|
||||
try {
|
||||
this.logger.verbose("Key not found in in-memory cache, now querying persistent storage.");
|
||||
return await this.indexedDBCache.containsKey(key);
|
||||
}
|
||||
catch (e) {
|
||||
this.handleDatabaseAccessError(e);
|
||||
}
|
||||
}
|
||||
return containsKey;
|
||||
}
|
||||
/**
|
||||
* Clears in-memory Map
|
||||
*/
|
||||
clearInMemory() {
|
||||
// InMemory cache is a Map instance, clear is straightforward
|
||||
this.logger.verbose(`Deleting in-memory keystore`);
|
||||
this.inMemoryCache.clear();
|
||||
this.logger.verbose(`In-memory keystore deleted`);
|
||||
}
|
||||
/**
|
||||
* Tries to delete the IndexedDB database
|
||||
* @returns
|
||||
*/
|
||||
async clearPersistent() {
|
||||
try {
|
||||
this.logger.verbose("Deleting persistent keystore");
|
||||
const dbDeleted = await this.indexedDBCache.deleteDatabase();
|
||||
if (dbDeleted) {
|
||||
this.logger.verbose("Persistent keystore deleted");
|
||||
}
|
||||
return dbDeleted;
|
||||
}
|
||||
catch (e) {
|
||||
this.handleDatabaseAccessError(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { AsyncMemoryStorage };
|
||||
//# sourceMappingURL=AsyncMemoryStorage.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AsyncMemoryStorage.mjs","sources":["../../src/cache/AsyncMemoryStorage.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.databaseUnavailable"],"mappings":";;;;;;;AAAA;;;AAGG;AAWH;;;AAGG;MACU,kBAAkB,CAAA;AAK3B,IAAA,WAAA,CAAY,MAAc,EAAA;AACtB,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAK,CAAC;AAC5C,QAAA,IAAI,CAAC,cAAc,GAAG,IAAI,eAAe,EAAK,CAAC;AAC/C,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;AAEO,IAAA,yBAAyB,CAAC,KAAc,EAAA;QAC5C,IACI,KAAK,YAAY,gBAAgB;AACjC,YAAA,KAAK,CAAC,SAAS,KAAKA,mBAAyC,EAC/D;AACE,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,6IAA6I,CAChJ,CAAC;AACL,SAAA;AAAM,aAAA;AACH,YAAA,MAAM,KAAK,CAAC;AACf,SAAA;KACJ;AACD;;;;AAIG;IACH,MAAM,OAAO,CAAC,GAAW,EAAA;QACrB,MAAM,IAAI,GAAG,IAAI,CA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I,CAAC,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAC;AACtD,aAAA;AAED,YAAA,OAAO,SAAS,CAAC;AACpB,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAClC,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;KACJ;AACJ;;;;"}
|
||||
312
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.d.ts
generated
vendored
Normal file
312
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.d.ts
generated
vendored
Normal file
@@ -0,0 +1,312 @@
|
||||
import { CommonAuthorizationCodeRequest, ICrypto, AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, CacheManager, ServerTelemetryEntity, ThrottlingEntity, Logger, AuthorityMetadataEntity, AccountInfo, TokenKeys, CredentialType, CacheRecord, IPerformanceClient, StaticAuthorityOptions, StoreInCache } from "@azure/msal-common/browser";
|
||||
import { CacheOptions } from "../config/Configuration.js";
|
||||
import { InteractionType } from "../utils/BrowserConstants.js";
|
||||
import { MemoryStorage } from "./MemoryStorage.js";
|
||||
import { IWindowStorage } from "./IWindowStorage.js";
|
||||
import { NativeTokenRequest } from "../broker/nativeBroker/NativeRequest.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { CookieStorage } from "./CookieStorage.js";
|
||||
import { EventHandler } from "../event/EventHandler.js";
|
||||
/**
|
||||
* This class implements the cache storage interface for MSAL through browser local or session storage.
|
||||
* Cookies are only used if storeAuthStateInCookie is true, and are only used for
|
||||
* parameters such as state and nonce, generally.
|
||||
*/
|
||||
export declare class BrowserCacheManager extends CacheManager {
|
||||
protected cacheConfig: Required<CacheOptions>;
|
||||
protected browserStorage: IWindowStorage<string>;
|
||||
protected internalStorage: MemoryStorage<string>;
|
||||
protected temporaryCacheStorage: IWindowStorage<string>;
|
||||
protected cookieStorage: CookieStorage;
|
||||
protected logger: Logger;
|
||||
protected performanceClient: IPerformanceClient;
|
||||
private eventHandler;
|
||||
constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger, performanceClient: IPerformanceClient, eventHandler: EventHandler, staticAuthorityOptions?: StaticAuthorityOptions);
|
||||
initialize(correlationId: string): Promise<void>;
|
||||
/**
|
||||
* Parses passed value as JSON object, JSON.parse() will throw an error.
|
||||
* @param input
|
||||
*/
|
||||
protected validateAndParseJson(jsonValue: string): object | null;
|
||||
/**
|
||||
* Reads account from cache, deserializes it into an account entity and returns it.
|
||||
* If account is not found from the key, returns null and removes key from map.
|
||||
* @param accountKey
|
||||
* @returns
|
||||
*/
|
||||
getAccount(accountKey: string): AccountEntity | null;
|
||||
/**
|
||||
* set account entity in the platform cache
|
||||
* @param account
|
||||
*/
|
||||
setAccount(account: AccountEntity, correlationId: string): Promise<void>;
|
||||
/**
|
||||
* Returns the array of account keys currently cached
|
||||
* @returns
|
||||
*/
|
||||
getAccountKeys(): Array<string>;
|
||||
/**
|
||||
* Add a new account to the key map
|
||||
* @param key
|
||||
*/
|
||||
addAccountKeyToMap(key: string): boolean;
|
||||
/**
|
||||
* Remove an account from the key map
|
||||
* @param key
|
||||
*/
|
||||
removeAccountKeyFromMap(key: string): void;
|
||||
/**
|
||||
* Extends inherited removeAccount function to include removal of the account key from the map
|
||||
* @param key
|
||||
*/
|
||||
removeAccount(key: string): Promise<void>;
|
||||
/**
|
||||
* Removes credentials associated with the provided account
|
||||
* @param account
|
||||
*/
|
||||
removeAccountContext(account: AccountEntity): Promise<void>;
|
||||
/**
|
||||
* Removes given idToken from the cache and from the key map
|
||||
* @param key
|
||||
*/
|
||||
removeIdToken(key: string): void;
|
||||
/**
|
||||
* Removes given accessToken from the cache and from the key map
|
||||
* @param key
|
||||
*/
|
||||
removeAccessToken(key: string): Promise<void>;
|
||||
/**
|
||||
* Removes given refreshToken from the cache and from the key map
|
||||
* @param key
|
||||
*/
|
||||
removeRefreshToken(key: string): void;
|
||||
/**
|
||||
* Gets the keys for the cached tokens associated with this clientId
|
||||
* @returns
|
||||
*/
|
||||
getTokenKeys(): TokenKeys;
|
||||
/**
|
||||
* Adds the given key to the token key map
|
||||
* @param key
|
||||
* @param type
|
||||
*/
|
||||
addTokenKey(key: string, type: CredentialType): void;
|
||||
/**
|
||||
* Removes the given key from the token key map
|
||||
* @param key
|
||||
* @param type
|
||||
*/
|
||||
removeTokenKey(key: string, type: CredentialType): void;
|
||||
/**
|
||||
* generates idToken entity from a string
|
||||
* @param idTokenKey
|
||||
*/
|
||||
getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
|
||||
/**
|
||||
* set IdToken credential to the platform cache
|
||||
* @param idToken
|
||||
*/
|
||||
setIdTokenCredential(idToken: IdTokenEntity, correlationId: string): Promise<void>;
|
||||
/**
|
||||
* generates accessToken entity from a string
|
||||
* @param key
|
||||
*/
|
||||
getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
|
||||
/**
|
||||
* set accessToken credential to the platform cache
|
||||
* @param accessToken
|
||||
*/
|
||||
setAccessTokenCredential(accessToken: AccessTokenEntity, correlationId: string): Promise<void>;
|
||||
/**
|
||||
* generates refreshToken entity from a string
|
||||
* @param refreshTokenKey
|
||||
*/
|
||||
getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
|
||||
/**
|
||||
* set refreshToken credential to the platform cache
|
||||
* @param refreshToken
|
||||
*/
|
||||
setRefreshTokenCredential(refreshToken: RefreshTokenEntity, correlationId: string): Promise<void>;
|
||||
/**
|
||||
* fetch appMetadata entity from the platform cache
|
||||
* @param appMetadataKey
|
||||
*/
|
||||
getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
|
||||
/**
|
||||
* set appMetadata entity to the platform cache
|
||||
* @param appMetadata
|
||||
*/
|
||||
setAppMetadata(appMetadata: AppMetadataEntity): void;
|
||||
/**
|
||||
* fetch server telemetry entity from the platform cache
|
||||
* @param serverTelemetryKey
|
||||
*/
|
||||
getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;
|
||||
/**
|
||||
* set server telemetry entity to the platform cache
|
||||
* @param serverTelemetryKey
|
||||
* @param serverTelemetry
|
||||
*/
|
||||
setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getAuthorityMetadataKeys(): Array<string>;
|
||||
/**
|
||||
* Sets wrapper metadata in memory
|
||||
* @param wrapperSKU
|
||||
* @param wrapperVersion
|
||||
*/
|
||||
setWrapperMetadata(wrapperSKU: string, wrapperVersion: string): void;
|
||||
/**
|
||||
* Returns wrapper metadata from in-memory storage
|
||||
*/
|
||||
getWrapperMetadata(): [string, string];
|
||||
/**
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
setAuthorityMetadata(key: string, entity: AuthorityMetadataEntity): void;
|
||||
/**
|
||||
* Gets the active account
|
||||
*/
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
/**
|
||||
* Sets the active account's localAccountId in cache
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
/**
|
||||
* fetch throttling entity from the platform cache
|
||||
* @param throttlingCacheKey
|
||||
*/
|
||||
getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;
|
||||
/**
|
||||
* set throttling entity to the platform cache
|
||||
* @param throttlingCacheKey
|
||||
* @param throttlingCache
|
||||
*/
|
||||
setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;
|
||||
/**
|
||||
* Gets cache item with given key.
|
||||
* Will retrieve from cookies if storeAuthStateInCookie is set to true.
|
||||
* @param key
|
||||
*/
|
||||
getTemporaryCache(cacheKey: string, generateKey?: boolean): string | null;
|
||||
/**
|
||||
* Sets the cache item with the key and value given.
|
||||
* Stores in cookie if storeAuthStateInCookie is set to true.
|
||||
* This can cause cookie overflow if used incorrectly.
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
setTemporaryCache(cacheKey: string, value: string, generateKey?: boolean): void;
|
||||
/**
|
||||
* Removes the cache item with the given key.
|
||||
* @param key
|
||||
*/
|
||||
removeItem(key: string): void;
|
||||
/**
|
||||
* Removes the temporary cache item with the given key.
|
||||
* Will also clear the cookie item if storeAuthStateInCookie is set to true.
|
||||
* @param key
|
||||
*/
|
||||
removeTemporaryItem(key: string): void;
|
||||
/**
|
||||
* Gets all keys in window.
|
||||
*/
|
||||
getKeys(): string[];
|
||||
/**
|
||||
* Clears all cache entries created by MSAL.
|
||||
*/
|
||||
clear(): Promise<void>;
|
||||
/**
|
||||
* Clears all access tokes that have claims prior to saving the current one
|
||||
* @param performanceClient {IPerformanceClient}
|
||||
* @param correlationId {string} correlation id
|
||||
* @returns
|
||||
*/
|
||||
clearTokensAndKeysWithClaims(performanceClient: IPerformanceClient, correlationId: string): Promise<void>;
|
||||
/**
|
||||
* Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
|
||||
* @param key
|
||||
* @param addInstanceId
|
||||
*/
|
||||
generateCacheKey(key: string): string;
|
||||
/**
|
||||
* Create authorityKey to cache authority
|
||||
* @param state
|
||||
*/
|
||||
generateAuthorityKey(stateString: string): string;
|
||||
/**
|
||||
* Create Nonce key to cache nonce
|
||||
* @param state
|
||||
*/
|
||||
generateNonceKey(stateString: string): string;
|
||||
/**
|
||||
* Creates full cache key for the request state
|
||||
* @param stateString State string for the request
|
||||
*/
|
||||
generateStateKey(stateString: string): string;
|
||||
/**
|
||||
* Gets the cached authority based on the cached state. Returns empty if no cached state found.
|
||||
*/
|
||||
getCachedAuthority(cachedState: string): string | null;
|
||||
/**
|
||||
* Updates account, authority, and state in cache
|
||||
* @param serverAuthenticationRequest
|
||||
* @param account
|
||||
*/
|
||||
updateCacheEntries(state: string, nonce: string, authorityInstance: string, loginHint: string, account: AccountInfo | null): void;
|
||||
/**
|
||||
* Reset all temporary cache items
|
||||
* @param state
|
||||
*/
|
||||
resetRequestCache(state: string): void;
|
||||
/**
|
||||
* Removes temporary cache for the provided state
|
||||
* @param stateString
|
||||
*/
|
||||
cleanRequestByState(stateString: string): void;
|
||||
/**
|
||||
* Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state
|
||||
* Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.
|
||||
* @param interactionType
|
||||
*/
|
||||
cleanRequestByInteractionType(interactionType: InteractionType): void;
|
||||
cacheCodeRequest(authCodeRequest: CommonAuthorizationCodeRequest): void;
|
||||
/**
|
||||
* Gets the token exchange parameters from the cache. Throws an error if nothing is found.
|
||||
*/
|
||||
getCachedRequest(state: string): CommonAuthorizationCodeRequest;
|
||||
/**
|
||||
* Gets cached native request for redirect flows
|
||||
*/
|
||||
getCachedNativeRequest(): NativeTokenRequest | null;
|
||||
isInteractionInProgress(matchClientId?: boolean): boolean;
|
||||
getInteractionInProgress(): string | null;
|
||||
setInteractionInProgress(inProgress: boolean): void;
|
||||
/**
|
||||
* Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache
|
||||
* @param result
|
||||
* @param request
|
||||
*/
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
/**
|
||||
* saves a cache record
|
||||
* @param cacheRecord {CacheRecord}
|
||||
* @param storeInCache {?StoreInCache}
|
||||
* @param correlationId {?string} correlation id
|
||||
*/
|
||||
saveCacheRecord(cacheRecord: CacheRecord, correlationId: string, storeInCache?: StoreInCache): Promise<void>;
|
||||
}
|
||||
export declare const DEFAULT_BROWSER_CACHE_MANAGER: (clientId: string, logger: Logger, performanceClient: IPerformanceClient, eventHandler: EventHandler) => BrowserCacheManager;
|
||||
//# sourceMappingURL=BrowserCacheManager.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
991
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs
generated
vendored
Normal file
991
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs
generated
vendored
Normal file
@@ -0,0 +1,991 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { CacheManager, AccountEntity, invokeAsync, PerformanceEvents, CredentialType, createClientAuthError, ClientAuthErrorCodes, CacheHelpers, Constants, PersistentCacheKeys, StringUtils, ProtocolUtils, CacheError, DEFAULT_CRYPTO_IMPLEMENTATION, CcsCredentialType } from '@azure/msal-common/browser';
|
||||
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
||||
import { BrowserCacheLocation, StaticCacheKeys, InMemoryCacheKeys, TemporaryCacheKeys } from '../utils/BrowserConstants.mjs';
|
||||
import { LocalStorage } from './LocalStorage.mjs';
|
||||
import { SessionStorage } from './SessionStorage.mjs';
|
||||
import { MemoryStorage } from './MemoryStorage.mjs';
|
||||
import { extractBrowserRequestState } from '../utils/BrowserProtocolUtils.mjs';
|
||||
import { base64Decode } from '../encode/Base64Decode.mjs';
|
||||
import { base64Encode } from '../encode/Base64Encode.mjs';
|
||||
import { CookieStorage } from './CookieStorage.mjs';
|
||||
import { getAccountKeys, getTokenKeys } from './CacheHelpers.mjs';
|
||||
import { EventType } from '../event/EventType.mjs';
|
||||
import { noTokenRequestCacheError, unableToParseTokenRequestCacheError, noCachedAuthorityError, interactionInProgress } from '../error/BrowserAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* This class implements the cache storage interface for MSAL through browser local or session storage.
|
||||
* Cookies are only used if storeAuthStateInCookie is true, and are only used for
|
||||
* parameters such as state and nonce, generally.
|
||||
*/
|
||||
class BrowserCacheManager extends CacheManager {
|
||||
constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, eventHandler, staticAuthorityOptions) {
|
||||
super(clientId, cryptoImpl, logger, staticAuthorityOptions);
|
||||
this.cacheConfig = cacheConfig;
|
||||
this.logger = logger;
|
||||
this.internalStorage = new MemoryStorage();
|
||||
this.browserStorage = getStorageImplementation(clientId, cacheConfig.cacheLocation, logger, performanceClient);
|
||||
this.temporaryCacheStorage = getStorageImplementation(clientId, cacheConfig.temporaryCacheLocation, logger, performanceClient);
|
||||
this.cookieStorage = new CookieStorage();
|
||||
this.performanceClient = performanceClient;
|
||||
this.eventHandler = eventHandler;
|
||||
}
|
||||
async initialize(correlationId) {
|
||||
await this.browserStorage.initialize(correlationId);
|
||||
}
|
||||
/**
|
||||
* Parses passed value as JSON object, JSON.parse() will throw an error.
|
||||
* @param input
|
||||
*/
|
||||
validateAndParseJson(jsonValue) {
|
||||
try {
|
||||
const parsedJson = JSON.parse(jsonValue);
|
||||
/**
|
||||
* There are edge cases in which JSON.parse will successfully parse a non-valid JSON object
|
||||
* (e.g. JSON.parse will parse an escaped string into an unescaped string), so adding a type check
|
||||
* of the parsed value is necessary in order to be certain that the string represents a valid JSON object.
|
||||
*
|
||||
*/
|
||||
return parsedJson && typeof parsedJson === "object"
|
||||
? parsedJson
|
||||
: null;
|
||||
}
|
||||
catch (error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Reads account from cache, deserializes it into an account entity and returns it.
|
||||
* If account is not found from the key, returns null and removes key from map.
|
||||
* @param accountKey
|
||||
* @returns
|
||||
*/
|
||||
getAccount(accountKey) {
|
||||
this.logger.trace("BrowserCacheManager.getAccount called");
|
||||
const serializedAccount = this.browserStorage.getUserData(accountKey);
|
||||
if (!serializedAccount) {
|
||||
this.removeAccountKeyFromMap(accountKey);
|
||||
return null;
|
||||
}
|
||||
const parsedAccount = this.validateAndParseJson(serializedAccount);
|
||||
if (!parsedAccount || !AccountEntity.isAccountEntity(parsedAccount)) {
|
||||
this.removeAccountKeyFromMap(accountKey);
|
||||
return null;
|
||||
}
|
||||
return CacheManager.toObject(new AccountEntity(), parsedAccount);
|
||||
}
|
||||
/**
|
||||
* set account entity in the platform cache
|
||||
* @param account
|
||||
*/
|
||||
async setAccount(account, correlationId) {
|
||||
this.logger.trace("BrowserCacheManager.setAccount called");
|
||||
const key = account.generateAccountKey();
|
||||
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(key, JSON.stringify(account), correlationId);
|
||||
const wasAdded = this.addAccountKeyToMap(key);
|
||||
/**
|
||||
* @deprecated - Remove this in next major version in favor of more consistent LOGIN event
|
||||
*/
|
||||
if (this.cacheConfig.cacheLocation ===
|
||||
BrowserCacheLocation.LocalStorage &&
|
||||
wasAdded) {
|
||||
this.eventHandler.emitEvent(EventType.ACCOUNT_ADDED, undefined, account.getAccountInfo());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the array of account keys currently cached
|
||||
* @returns
|
||||
*/
|
||||
getAccountKeys() {
|
||||
return getAccountKeys(this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Add a new account to the key map
|
||||
* @param key
|
||||
*/
|
||||
addAccountKeyToMap(key) {
|
||||
this.logger.trace("BrowserCacheManager.addAccountKeyToMap called");
|
||||
this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${key}`);
|
||||
const accountKeys = this.getAccountKeys();
|
||||
if (accountKeys.indexOf(key) === -1) {
|
||||
// Only add key if it does not already exist in the map
|
||||
accountKeys.push(key);
|
||||
this.browserStorage.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
|
||||
this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added");
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Remove an account from the key map
|
||||
* @param key
|
||||
*/
|
||||
removeAccountKeyFromMap(key) {
|
||||
this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called");
|
||||
this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${key}`);
|
||||
const accountKeys = this.getAccountKeys();
|
||||
const removalIndex = accountKeys.indexOf(key);
|
||||
if (removalIndex > -1) {
|
||||
accountKeys.splice(removalIndex, 1);
|
||||
this.browserStorage.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
|
||||
this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed");
|
||||
}
|
||||
else {
|
||||
this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Extends inherited removeAccount function to include removal of the account key from the map
|
||||
* @param key
|
||||
*/
|
||||
async removeAccount(key) {
|
||||
void super.removeAccount(key);
|
||||
this.removeAccountKeyFromMap(key);
|
||||
}
|
||||
/**
|
||||
* Removes credentials associated with the provided account
|
||||
* @param account
|
||||
*/
|
||||
async removeAccountContext(account) {
|
||||
await super.removeAccountContext(account);
|
||||
/**
|
||||
* @deprecated - Remove this in next major version in favor of more consistent LOGOUT event
|
||||
*/
|
||||
if (this.cacheConfig.cacheLocation === BrowserCacheLocation.LocalStorage) {
|
||||
this.eventHandler.emitEvent(EventType.ACCOUNT_REMOVED, undefined, account.getAccountInfo());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Removes given idToken from the cache and from the key map
|
||||
* @param key
|
||||
*/
|
||||
removeIdToken(key) {
|
||||
super.removeIdToken(key);
|
||||
this.removeTokenKey(key, CredentialType.ID_TOKEN);
|
||||
}
|
||||
/**
|
||||
* Removes given accessToken from the cache and from the key map
|
||||
* @param key
|
||||
*/
|
||||
async removeAccessToken(key) {
|
||||
void super.removeAccessToken(key);
|
||||
this.removeTokenKey(key, CredentialType.ACCESS_TOKEN);
|
||||
}
|
||||
/**
|
||||
* Removes given refreshToken from the cache and from the key map
|
||||
* @param key
|
||||
*/
|
||||
removeRefreshToken(key) {
|
||||
super.removeRefreshToken(key);
|
||||
this.removeTokenKey(key, CredentialType.REFRESH_TOKEN);
|
||||
}
|
||||
/**
|
||||
* Gets the keys for the cached tokens associated with this clientId
|
||||
* @returns
|
||||
*/
|
||||
getTokenKeys() {
|
||||
return getTokenKeys(this.clientId, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Adds the given key to the token key map
|
||||
* @param key
|
||||
* @param type
|
||||
*/
|
||||
addTokenKey(key, type) {
|
||||
this.logger.trace("BrowserCacheManager addTokenKey called");
|
||||
const tokenKeys = this.getTokenKeys();
|
||||
switch (type) {
|
||||
case CredentialType.ID_TOKEN:
|
||||
if (tokenKeys.idToken.indexOf(key) === -1) {
|
||||
this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map");
|
||||
tokenKeys.idToken.push(key);
|
||||
}
|
||||
break;
|
||||
case CredentialType.ACCESS_TOKEN:
|
||||
if (tokenKeys.accessToken.indexOf(key) === -1) {
|
||||
this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map");
|
||||
tokenKeys.accessToken.push(key);
|
||||
}
|
||||
break;
|
||||
case CredentialType.REFRESH_TOKEN:
|
||||
if (tokenKeys.refreshToken.indexOf(key) === -1) {
|
||||
this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map");
|
||||
tokenKeys.refreshToken.push(key);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${type}`);
|
||||
throw createClientAuthError(ClientAuthErrorCodes.unexpectedCredentialType);
|
||||
}
|
||||
this.browserStorage.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));
|
||||
}
|
||||
/**
|
||||
* Removes the given key from the token key map
|
||||
* @param key
|
||||
* @param type
|
||||
*/
|
||||
removeTokenKey(key, type) {
|
||||
this.logger.trace("BrowserCacheManager removeTokenKey called");
|
||||
const tokenKeys = this.getTokenKeys();
|
||||
switch (type) {
|
||||
case CredentialType.ID_TOKEN:
|
||||
this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${key} from map`);
|
||||
const idRemoval = tokenKeys.idToken.indexOf(key);
|
||||
if (idRemoval > -1) {
|
||||
this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map");
|
||||
tokenKeys.idToken.splice(idRemoval, 1);
|
||||
}
|
||||
else {
|
||||
this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");
|
||||
}
|
||||
break;
|
||||
case CredentialType.ACCESS_TOKEN:
|
||||
this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${key} from map`);
|
||||
const accessRemoval = tokenKeys.accessToken.indexOf(key);
|
||||
if (accessRemoval > -1) {
|
||||
this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map");
|
||||
tokenKeys.accessToken.splice(accessRemoval, 1);
|
||||
}
|
||||
else {
|
||||
this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");
|
||||
}
|
||||
break;
|
||||
case CredentialType.REFRESH_TOKEN:
|
||||
this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${key} from map`);
|
||||
const refreshRemoval = tokenKeys.refreshToken.indexOf(key);
|
||||
if (refreshRemoval > -1) {
|
||||
this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map");
|
||||
tokenKeys.refreshToken.splice(refreshRemoval, 1);
|
||||
}
|
||||
else {
|
||||
this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${type}`);
|
||||
throw createClientAuthError(ClientAuthErrorCodes.unexpectedCredentialType);
|
||||
}
|
||||
this.browserStorage.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));
|
||||
}
|
||||
/**
|
||||
* generates idToken entity from a string
|
||||
* @param idTokenKey
|
||||
*/
|
||||
getIdTokenCredential(idTokenKey) {
|
||||
const value = this.browserStorage.getUserData(idTokenKey);
|
||||
if (!value) {
|
||||
this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit");
|
||||
this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);
|
||||
return null;
|
||||
}
|
||||
const parsedIdToken = this.validateAndParseJson(value);
|
||||
if (!parsedIdToken || !CacheHelpers.isIdTokenEntity(parsedIdToken)) {
|
||||
this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit");
|
||||
this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);
|
||||
return null;
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit");
|
||||
return parsedIdToken;
|
||||
}
|
||||
/**
|
||||
* set IdToken credential to the platform cache
|
||||
* @param idToken
|
||||
*/
|
||||
async setIdTokenCredential(idToken, correlationId) {
|
||||
this.logger.trace("BrowserCacheManager.setIdTokenCredential called");
|
||||
const idTokenKey = CacheHelpers.generateCredentialKey(idToken);
|
||||
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(idTokenKey, JSON.stringify(idToken), correlationId);
|
||||
this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);
|
||||
}
|
||||
/**
|
||||
* generates accessToken entity from a string
|
||||
* @param key
|
||||
*/
|
||||
getAccessTokenCredential(accessTokenKey) {
|
||||
const value = this.browserStorage.getUserData(accessTokenKey);
|
||||
if (!value) {
|
||||
this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit");
|
||||
this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
|
||||
return null;
|
||||
}
|
||||
const parsedAccessToken = this.validateAndParseJson(value);
|
||||
if (!parsedAccessToken ||
|
||||
!CacheHelpers.isAccessTokenEntity(parsedAccessToken)) {
|
||||
this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit");
|
||||
this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
|
||||
return null;
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit");
|
||||
return parsedAccessToken;
|
||||
}
|
||||
/**
|
||||
* set accessToken credential to the platform cache
|
||||
* @param accessToken
|
||||
*/
|
||||
async setAccessTokenCredential(accessToken, correlationId) {
|
||||
this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");
|
||||
const accessTokenKey = CacheHelpers.generateCredentialKey(accessToken);
|
||||
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(accessTokenKey, JSON.stringify(accessToken), correlationId);
|
||||
this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
|
||||
}
|
||||
/**
|
||||
* generates refreshToken entity from a string
|
||||
* @param refreshTokenKey
|
||||
*/
|
||||
getRefreshTokenCredential(refreshTokenKey) {
|
||||
const value = this.browserStorage.getUserData(refreshTokenKey);
|
||||
if (!value) {
|
||||
this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit");
|
||||
this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
|
||||
return null;
|
||||
}
|
||||
const parsedRefreshToken = this.validateAndParseJson(value);
|
||||
if (!parsedRefreshToken ||
|
||||
!CacheHelpers.isRefreshTokenEntity(parsedRefreshToken)) {
|
||||
this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit");
|
||||
this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
|
||||
return null;
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit");
|
||||
return parsedRefreshToken;
|
||||
}
|
||||
/**
|
||||
* set refreshToken credential to the platform cache
|
||||
* @param refreshToken
|
||||
*/
|
||||
async setRefreshTokenCredential(refreshToken, correlationId) {
|
||||
this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");
|
||||
const refreshTokenKey = CacheHelpers.generateCredentialKey(refreshToken);
|
||||
await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(refreshTokenKey, JSON.stringify(refreshToken), correlationId);
|
||||
this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
|
||||
}
|
||||
/**
|
||||
* fetch appMetadata entity from the platform cache
|
||||
* @param appMetadataKey
|
||||
*/
|
||||
getAppMetadata(appMetadataKey) {
|
||||
const value = this.browserStorage.getItem(appMetadataKey);
|
||||
if (!value) {
|
||||
this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit");
|
||||
return null;
|
||||
}
|
||||
const parsedMetadata = this.validateAndParseJson(value);
|
||||
if (!parsedMetadata ||
|
||||
!CacheHelpers.isAppMetadataEntity(appMetadataKey, parsedMetadata)) {
|
||||
this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit");
|
||||
return null;
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit");
|
||||
return parsedMetadata;
|
||||
}
|
||||
/**
|
||||
* set appMetadata entity to the platform cache
|
||||
* @param appMetadata
|
||||
*/
|
||||
setAppMetadata(appMetadata) {
|
||||
this.logger.trace("BrowserCacheManager.setAppMetadata called");
|
||||
const appMetadataKey = CacheHelpers.generateAppMetadataKey(appMetadata);
|
||||
this.browserStorage.setItem(appMetadataKey, JSON.stringify(appMetadata));
|
||||
}
|
||||
/**
|
||||
* fetch server telemetry entity from the platform cache
|
||||
* @param serverTelemetryKey
|
||||
*/
|
||||
getServerTelemetry(serverTelemetryKey) {
|
||||
const value = this.browserStorage.getItem(serverTelemetryKey);
|
||||
if (!value) {
|
||||
this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit");
|
||||
return null;
|
||||
}
|
||||
const parsedEntity = this.validateAndParseJson(value);
|
||||
if (!parsedEntity ||
|
||||
!CacheHelpers.isServerTelemetryEntity(serverTelemetryKey, parsedEntity)) {
|
||||
this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit");
|
||||
return null;
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit");
|
||||
return parsedEntity;
|
||||
}
|
||||
/**
|
||||
* set server telemetry entity to the platform cache
|
||||
* @param serverTelemetryKey
|
||||
* @param serverTelemetry
|
||||
*/
|
||||
setServerTelemetry(serverTelemetryKey, serverTelemetry) {
|
||||
this.logger.trace("BrowserCacheManager.setServerTelemetry called");
|
||||
this.browserStorage.setItem(serverTelemetryKey, JSON.stringify(serverTelemetry));
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getAuthorityMetadata(key) {
|
||||
const value = this.internalStorage.getItem(key);
|
||||
if (!value) {
|
||||
this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit");
|
||||
return null;
|
||||
}
|
||||
const parsedMetadata = this.validateAndParseJson(value);
|
||||
if (parsedMetadata &&
|
||||
CacheHelpers.isAuthorityMetadataEntity(key, parsedMetadata)) {
|
||||
this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit");
|
||||
return parsedMetadata;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
getAuthorityMetadataKeys() {
|
||||
const allKeys = this.internalStorage.getKeys();
|
||||
return allKeys.filter((key) => {
|
||||
return this.isAuthorityMetadata(key);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Sets wrapper metadata in memory
|
||||
* @param wrapperSKU
|
||||
* @param wrapperVersion
|
||||
*/
|
||||
setWrapperMetadata(wrapperSKU, wrapperVersion) {
|
||||
this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_SKU, wrapperSKU);
|
||||
this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_VER, wrapperVersion);
|
||||
}
|
||||
/**
|
||||
* Returns wrapper metadata from in-memory storage
|
||||
*/
|
||||
getWrapperMetadata() {
|
||||
const sku = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_SKU) ||
|
||||
Constants.EMPTY_STRING;
|
||||
const version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) ||
|
||||
Constants.EMPTY_STRING;
|
||||
return [sku, version];
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
setAuthorityMetadata(key, entity) {
|
||||
this.logger.trace("BrowserCacheManager.setAuthorityMetadata called");
|
||||
this.internalStorage.setItem(key, JSON.stringify(entity));
|
||||
}
|
||||
/**
|
||||
* Gets the active account
|
||||
*/
|
||||
getActiveAccount() {
|
||||
const activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
|
||||
const activeAccountValueFilters = this.browserStorage.getItem(activeAccountKeyFilters);
|
||||
if (!activeAccountValueFilters) {
|
||||
this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found");
|
||||
return null;
|
||||
}
|
||||
const activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);
|
||||
if (activeAccountValueObj) {
|
||||
this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found");
|
||||
return this.getAccountInfoFilteredBy({
|
||||
homeAccountId: activeAccountValueObj.homeAccountId,
|
||||
localAccountId: activeAccountValueObj.localAccountId,
|
||||
tenantId: activeAccountValueObj.tenantId,
|
||||
});
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Sets the active account's localAccountId in cache
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account) {
|
||||
const activeAccountKey = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
|
||||
if (account) {
|
||||
this.logger.verbose("setActiveAccount: Active account set");
|
||||
const activeAccountValue = {
|
||||
homeAccountId: account.homeAccountId,
|
||||
localAccountId: account.localAccountId,
|
||||
tenantId: account.tenantId,
|
||||
};
|
||||
this.browserStorage.setItem(activeAccountKey, JSON.stringify(activeAccountValue));
|
||||
}
|
||||
else {
|
||||
this.logger.verbose("setActiveAccount: No account passed, active account not set");
|
||||
this.browserStorage.removeItem(activeAccountKey);
|
||||
}
|
||||
this.eventHandler.emitEvent(EventType.ACTIVE_ACCOUNT_CHANGED);
|
||||
}
|
||||
/**
|
||||
* fetch throttling entity from the platform cache
|
||||
* @param throttlingCacheKey
|
||||
*/
|
||||
getThrottlingCache(throttlingCacheKey) {
|
||||
const value = this.browserStorage.getItem(throttlingCacheKey);
|
||||
if (!value) {
|
||||
this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit");
|
||||
return null;
|
||||
}
|
||||
const parsedThrottlingCache = this.validateAndParseJson(value);
|
||||
if (!parsedThrottlingCache ||
|
||||
!CacheHelpers.isThrottlingEntity(throttlingCacheKey, parsedThrottlingCache)) {
|
||||
this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit");
|
||||
return null;
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit");
|
||||
return parsedThrottlingCache;
|
||||
}
|
||||
/**
|
||||
* set throttling entity to the platform cache
|
||||
* @param throttlingCacheKey
|
||||
* @param throttlingCache
|
||||
*/
|
||||
setThrottlingCache(throttlingCacheKey, throttlingCache) {
|
||||
this.logger.trace("BrowserCacheManager.setThrottlingCache called");
|
||||
this.browserStorage.setItem(throttlingCacheKey, JSON.stringify(throttlingCache));
|
||||
}
|
||||
/**
|
||||
* Gets cache item with given key.
|
||||
* Will retrieve from cookies if storeAuthStateInCookie is set to true.
|
||||
* @param key
|
||||
*/
|
||||
getTemporaryCache(cacheKey, generateKey) {
|
||||
const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
|
||||
if (this.cacheConfig.storeAuthStateInCookie) {
|
||||
const itemCookie = this.cookieStorage.getItem(key);
|
||||
if (itemCookie) {
|
||||
this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies");
|
||||
return itemCookie;
|
||||
}
|
||||
}
|
||||
const value = this.temporaryCacheStorage.getItem(key);
|
||||
if (!value) {
|
||||
// If temp cache item not found in session/memory, check local storage for items set by old versions
|
||||
if (this.cacheConfig.cacheLocation ===
|
||||
BrowserCacheLocation.LocalStorage) {
|
||||
const item = this.browserStorage.getItem(key);
|
||||
if (item) {
|
||||
this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage");
|
||||
return item;
|
||||
}
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage");
|
||||
return null;
|
||||
}
|
||||
this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned");
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* Sets the cache item with the key and value given.
|
||||
* Stores in cookie if storeAuthStateInCookie is set to true.
|
||||
* This can cause cookie overflow if used incorrectly.
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
setTemporaryCache(cacheKey, value, generateKey) {
|
||||
const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
|
||||
this.temporaryCacheStorage.setItem(key, value);
|
||||
if (this.cacheConfig.storeAuthStateInCookie) {
|
||||
this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie");
|
||||
this.cookieStorage.setItem(key, value, undefined, this.cacheConfig.secureCookies);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Removes the cache item with the given key.
|
||||
* @param key
|
||||
*/
|
||||
removeItem(key) {
|
||||
this.browserStorage.removeItem(key);
|
||||
}
|
||||
/**
|
||||
* Removes the temporary cache item with the given key.
|
||||
* Will also clear the cookie item if storeAuthStateInCookie is set to true.
|
||||
* @param key
|
||||
*/
|
||||
removeTemporaryItem(key) {
|
||||
this.temporaryCacheStorage.removeItem(key);
|
||||
if (this.cacheConfig.storeAuthStateInCookie) {
|
||||
this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie");
|
||||
this.cookieStorage.removeItem(key);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Gets all keys in window.
|
||||
*/
|
||||
getKeys() {
|
||||
return this.browserStorage.getKeys();
|
||||
}
|
||||
/**
|
||||
* Clears all cache entries created by MSAL.
|
||||
*/
|
||||
async clear() {
|
||||
// Removes all accounts and their credentials
|
||||
await this.removeAllAccounts();
|
||||
this.removeAppMetadata();
|
||||
// Remove temp storage first to make sure any cookies are cleared
|
||||
this.temporaryCacheStorage.getKeys().forEach((cacheKey) => {
|
||||
if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
|
||||
cacheKey.indexOf(this.clientId) !== -1) {
|
||||
this.removeTemporaryItem(cacheKey);
|
||||
}
|
||||
});
|
||||
// Removes all remaining MSAL cache items
|
||||
this.browserStorage.getKeys().forEach((cacheKey) => {
|
||||
if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
|
||||
cacheKey.indexOf(this.clientId) !== -1) {
|
||||
this.browserStorage.removeItem(cacheKey);
|
||||
}
|
||||
});
|
||||
this.internalStorage.clear();
|
||||
}
|
||||
/**
|
||||
* Clears all access tokes that have claims prior to saving the current one
|
||||
* @param performanceClient {IPerformanceClient}
|
||||
* @param correlationId {string} correlation id
|
||||
* @returns
|
||||
*/
|
||||
async clearTokensAndKeysWithClaims(performanceClient, correlationId) {
|
||||
performanceClient.addQueueMeasurement(PerformanceEvents.ClearTokensAndKeysWithClaims, correlationId);
|
||||
const tokenKeys = this.getTokenKeys();
|
||||
const removedAccessTokens = [];
|
||||
tokenKeys.accessToken.forEach((key) => {
|
||||
// if the access token has claims in its key, remove the token key and the token
|
||||
const credential = this.getAccessTokenCredential(key);
|
||||
if (credential?.requestedClaimsHash &&
|
||||
key.includes(credential.requestedClaimsHash.toLowerCase())) {
|
||||
removedAccessTokens.push(this.removeAccessToken(key));
|
||||
}
|
||||
});
|
||||
await Promise.all(removedAccessTokens);
|
||||
// warn if any access tokens are removed
|
||||
if (removedAccessTokens.length > 0) {
|
||||
this.logger.warning(`${removedAccessTokens.length} access tokens with claims in the cache keys have been removed from the cache.`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
|
||||
* @param key
|
||||
* @param addInstanceId
|
||||
*/
|
||||
generateCacheKey(key) {
|
||||
const generatedKey = this.validateAndParseJson(key);
|
||||
if (!generatedKey) {
|
||||
if (StringUtils.startsWith(key, Constants.CACHE_PREFIX)) {
|
||||
return key;
|
||||
}
|
||||
return `${Constants.CACHE_PREFIX}.${this.clientId}.${key}`;
|
||||
}
|
||||
return JSON.stringify(key);
|
||||
}
|
||||
/**
|
||||
* Create authorityKey to cache authority
|
||||
* @param state
|
||||
*/
|
||||
generateAuthorityKey(stateString) {
|
||||
const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);
|
||||
return this.generateCacheKey(`${TemporaryCacheKeys.AUTHORITY}.${stateId}`);
|
||||
}
|
||||
/**
|
||||
* Create Nonce key to cache nonce
|
||||
* @param state
|
||||
*/
|
||||
generateNonceKey(stateString) {
|
||||
const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);
|
||||
return this.generateCacheKey(`${TemporaryCacheKeys.NONCE_IDTOKEN}.${stateId}`);
|
||||
}
|
||||
/**
|
||||
* Creates full cache key for the request state
|
||||
* @param stateString State string for the request
|
||||
*/
|
||||
generateStateKey(stateString) {
|
||||
// Use the library state id to key temp storage for uniqueness for multiple concurrent requests
|
||||
const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);
|
||||
return this.generateCacheKey(`${TemporaryCacheKeys.REQUEST_STATE}.${stateId}`);
|
||||
}
|
||||
/**
|
||||
* Gets the cached authority based on the cached state. Returns empty if no cached state found.
|
||||
*/
|
||||
getCachedAuthority(cachedState) {
|
||||
const stateCacheKey = this.generateStateKey(cachedState);
|
||||
const state = this.getTemporaryCache(stateCacheKey);
|
||||
if (!state) {
|
||||
return null;
|
||||
}
|
||||
const authorityCacheKey = this.generateAuthorityKey(state);
|
||||
return this.getTemporaryCache(authorityCacheKey);
|
||||
}
|
||||
/**
|
||||
* Updates account, authority, and state in cache
|
||||
* @param serverAuthenticationRequest
|
||||
* @param account
|
||||
*/
|
||||
updateCacheEntries(state, nonce, authorityInstance, loginHint, account) {
|
||||
this.logger.trace("BrowserCacheManager.updateCacheEntries called");
|
||||
// Cache the request state
|
||||
const stateCacheKey = this.generateStateKey(state);
|
||||
this.setTemporaryCache(stateCacheKey, state, false);
|
||||
// Cache the nonce
|
||||
const nonceCacheKey = this.generateNonceKey(state);
|
||||
this.setTemporaryCache(nonceCacheKey, nonce, false);
|
||||
// Cache authorityKey
|
||||
const authorityCacheKey = this.generateAuthorityKey(state);
|
||||
this.setTemporaryCache(authorityCacheKey, authorityInstance, false);
|
||||
if (account) {
|
||||
const ccsCredential = {
|
||||
credential: account.homeAccountId,
|
||||
type: CcsCredentialType.HOME_ACCOUNT_ID,
|
||||
};
|
||||
this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
|
||||
}
|
||||
else if (loginHint) {
|
||||
const ccsCredential = {
|
||||
credential: loginHint,
|
||||
type: CcsCredentialType.UPN,
|
||||
};
|
||||
this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Reset all temporary cache items
|
||||
* @param state
|
||||
*/
|
||||
resetRequestCache(state) {
|
||||
this.logger.trace("BrowserCacheManager.resetRequestCache called");
|
||||
// check state and remove associated cache items
|
||||
if (state) {
|
||||
this.temporaryCacheStorage.getKeys().forEach((key) => {
|
||||
if (key.indexOf(state) !== -1) {
|
||||
this.removeTemporaryItem(key);
|
||||
}
|
||||
});
|
||||
// delete generic interactive request parameters
|
||||
this.removeTemporaryItem(this.generateStateKey(state));
|
||||
this.removeTemporaryItem(this.generateNonceKey(state));
|
||||
this.removeTemporaryItem(this.generateAuthorityKey(state));
|
||||
}
|
||||
this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
|
||||
this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));
|
||||
this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));
|
||||
this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));
|
||||
this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));
|
||||
this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
|
||||
this.setInteractionInProgress(false);
|
||||
}
|
||||
/**
|
||||
* Removes temporary cache for the provided state
|
||||
* @param stateString
|
||||
*/
|
||||
cleanRequestByState(stateString) {
|
||||
this.logger.trace("BrowserCacheManager.cleanRequestByState called");
|
||||
// Interaction is completed - remove interaction status.
|
||||
if (stateString) {
|
||||
const stateKey = this.generateStateKey(stateString);
|
||||
const cachedState = this.temporaryCacheStorage.getItem(stateKey);
|
||||
this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${cachedState}`);
|
||||
this.resetRequestCache(cachedState || Constants.EMPTY_STRING);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state
|
||||
* Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.
|
||||
* @param interactionType
|
||||
*/
|
||||
cleanRequestByInteractionType(interactionType) {
|
||||
this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called");
|
||||
// Loop through all keys to find state key
|
||||
this.temporaryCacheStorage.getKeys().forEach((key) => {
|
||||
// If this key is not the state key, move on
|
||||
if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {
|
||||
return;
|
||||
}
|
||||
// Retrieve state value, return if not a valid value
|
||||
const stateValue = this.temporaryCacheStorage.getItem(key);
|
||||
if (!stateValue) {
|
||||
return;
|
||||
}
|
||||
// Extract state and ensure it matches given InteractionType, then clean request cache
|
||||
const parsedState = extractBrowserRequestState(this.cryptoImpl, stateValue);
|
||||
if (parsedState &&
|
||||
parsedState.interactionType === interactionType) {
|
||||
this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${stateValue}`);
|
||||
this.resetRequestCache(stateValue);
|
||||
}
|
||||
});
|
||||
this.setInteractionInProgress(false);
|
||||
}
|
||||
cacheCodeRequest(authCodeRequest) {
|
||||
this.logger.trace("BrowserCacheManager.cacheCodeRequest called");
|
||||
const encodedValue = base64Encode(JSON.stringify(authCodeRequest));
|
||||
this.setTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);
|
||||
}
|
||||
/**
|
||||
* Gets the token exchange parameters from the cache. Throws an error if nothing is found.
|
||||
*/
|
||||
getCachedRequest(state) {
|
||||
this.logger.trace("BrowserCacheManager.getCachedRequest called");
|
||||
// Get token request from cache and parse as TokenExchangeParameters.
|
||||
const encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);
|
||||
if (!encodedTokenRequest) {
|
||||
throw createBrowserAuthError(noTokenRequestCacheError);
|
||||
}
|
||||
let parsedRequest;
|
||||
try {
|
||||
parsedRequest = JSON.parse(base64Decode(encodedTokenRequest));
|
||||
}
|
||||
catch (e) {
|
||||
this.logger.errorPii(`Attempted to parse: ${encodedTokenRequest}`);
|
||||
this.logger.error(`Parsing cached token request threw with error: ${e}`);
|
||||
throw createBrowserAuthError(unableToParseTokenRequestCacheError);
|
||||
}
|
||||
this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
|
||||
// Get cached authority and use if no authority is cached with request.
|
||||
if (!parsedRequest.authority) {
|
||||
const authorityCacheKey = this.generateAuthorityKey(state);
|
||||
const cachedAuthority = this.getTemporaryCache(authorityCacheKey);
|
||||
if (!cachedAuthority) {
|
||||
throw createBrowserAuthError(noCachedAuthorityError);
|
||||
}
|
||||
parsedRequest.authority = cachedAuthority;
|
||||
}
|
||||
return parsedRequest;
|
||||
}
|
||||
/**
|
||||
* Gets cached native request for redirect flows
|
||||
*/
|
||||
getCachedNativeRequest() {
|
||||
this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");
|
||||
const cachedRequest = this.getTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, true);
|
||||
if (!cachedRequest) {
|
||||
this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found");
|
||||
return null;
|
||||
}
|
||||
const parsedRequest = this.validateAndParseJson(cachedRequest);
|
||||
if (!parsedRequest) {
|
||||
this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request");
|
||||
return null;
|
||||
}
|
||||
return parsedRequest;
|
||||
}
|
||||
isInteractionInProgress(matchClientId) {
|
||||
const clientId = this.getInteractionInProgress();
|
||||
if (matchClientId) {
|
||||
return clientId === this.clientId;
|
||||
}
|
||||
else {
|
||||
return !!clientId;
|
||||
}
|
||||
}
|
||||
getInteractionInProgress() {
|
||||
const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
|
||||
return this.getTemporaryCache(key, false);
|
||||
}
|
||||
setInteractionInProgress(inProgress) {
|
||||
// Ensure we don't overwrite interaction in progress for a different clientId
|
||||
const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
|
||||
if (inProgress) {
|
||||
if (this.getInteractionInProgress()) {
|
||||
throw createBrowserAuthError(interactionInProgress);
|
||||
}
|
||||
else {
|
||||
// No interaction is in progress
|
||||
this.setTemporaryCache(key, this.clientId, false);
|
||||
}
|
||||
}
|
||||
else if (!inProgress &&
|
||||
this.getInteractionInProgress() === this.clientId) {
|
||||
this.removeTemporaryItem(key);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache
|
||||
* @param result
|
||||
* @param request
|
||||
*/
|
||||
async hydrateCache(result, request) {
|
||||
const idTokenEntity = CacheHelpers.createIdTokenEntity(result.account?.homeAccountId, result.account?.environment, result.idToken, this.clientId, result.tenantId);
|
||||
let claimsHash;
|
||||
if (request.claims) {
|
||||
claimsHash = await this.cryptoImpl.hashString(request.claims);
|
||||
}
|
||||
/**
|
||||
* meta data for cache stores time in seconds from epoch
|
||||
* AuthenticationResult returns expiresOn and extExpiresOn in milliseconds (as a Date object which is in ms)
|
||||
* We need to map these for the cache when building tokens from AuthenticationResult
|
||||
*
|
||||
* The next MSAL VFuture should map these both to same value if possible
|
||||
*/
|
||||
const accessTokenEntity = CacheHelpers.createAccessTokenEntity(result.account?.homeAccountId, result.account.environment, result.accessToken, this.clientId, result.tenantId, result.scopes.join(" "), result.expiresOn ? result.expiresOn.getTime() / 1000 : 0, result.extExpiresOn ? result.extExpiresOn.getTime() / 1000 : 0, base64Decode, undefined, // refreshOn
|
||||
result.tokenType, undefined, // userAssertionHash
|
||||
request.sshKid, request.claims, claimsHash);
|
||||
const cacheRecord = {
|
||||
idToken: idTokenEntity,
|
||||
accessToken: accessTokenEntity,
|
||||
};
|
||||
return this.saveCacheRecord(cacheRecord, result.correlationId);
|
||||
}
|
||||
/**
|
||||
* saves a cache record
|
||||
* @param cacheRecord {CacheRecord}
|
||||
* @param storeInCache {?StoreInCache}
|
||||
* @param correlationId {?string} correlation id
|
||||
*/
|
||||
async saveCacheRecord(cacheRecord, correlationId, storeInCache) {
|
||||
try {
|
||||
await super.saveCacheRecord(cacheRecord, correlationId, storeInCache);
|
||||
}
|
||||
catch (e) {
|
||||
if (e instanceof CacheError &&
|
||||
this.performanceClient &&
|
||||
correlationId) {
|
||||
try {
|
||||
const tokenKeys = this.getTokenKeys();
|
||||
this.performanceClient.addFields({
|
||||
cacheRtCount: tokenKeys.refreshToken.length,
|
||||
cacheIdCount: tokenKeys.idToken.length,
|
||||
cacheAtCount: tokenKeys.accessToken.length,
|
||||
}, correlationId);
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
|
||||
* @param cacheLocation
|
||||
*/
|
||||
function getStorageImplementation(clientId, cacheLocation, logger, performanceClient) {
|
||||
try {
|
||||
switch (cacheLocation) {
|
||||
case BrowserCacheLocation.LocalStorage:
|
||||
return new LocalStorage(clientId, logger, performanceClient);
|
||||
case BrowserCacheLocation.SessionStorage:
|
||||
return new SessionStorage();
|
||||
case BrowserCacheLocation.MemoryStorage:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
logger.error(e);
|
||||
}
|
||||
return new MemoryStorage();
|
||||
}
|
||||
const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient, eventHandler) => {
|
||||
const cacheOptions = {
|
||||
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
||||
temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
|
||||
storeAuthStateInCookie: false,
|
||||
secureCookies: false,
|
||||
cacheMigrationEnabled: false,
|
||||
claimsBasedCachingEnabled: false,
|
||||
};
|
||||
return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger, performanceClient, eventHandler);
|
||||
};
|
||||
|
||||
export { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER };
|
||||
//# sourceMappingURL=BrowserCacheManager.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
16
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.d.ts
generated
vendored
Normal file
16
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { TokenKeys } from "@azure/msal-common/browser";
|
||||
import { IWindowStorage } from "./IWindowStorage.js";
|
||||
/**
|
||||
* Returns a list of cache keys for all known accounts
|
||||
* @param storage
|
||||
* @returns
|
||||
*/
|
||||
export declare function getAccountKeys(storage: IWindowStorage<string>): Array<string>;
|
||||
/**
|
||||
* Returns a list of cache keys for all known tokens
|
||||
* @param clientId
|
||||
* @param storage
|
||||
* @returns
|
||||
*/
|
||||
export declare function getTokenKeys(clientId: string, storage: IWindowStorage<string>): TokenKeys;
|
||||
//# sourceMappingURL=CacheHelpers.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CacheHelpers.d.ts","sourceRoot":"","sources":["../../src/cache/CacheHelpers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAO7E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,GAChC,SAAS,CAmBX"}
|
||||
46
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.mjs
generated
vendored
Normal file
46
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.mjs
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { StaticCacheKeys } from '../utils/BrowserConstants.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Returns a list of cache keys for all known accounts
|
||||
* @param storage
|
||||
* @returns
|
||||
*/
|
||||
function getAccountKeys(storage) {
|
||||
const accountKeys = storage.getItem(StaticCacheKeys.ACCOUNT_KEYS);
|
||||
if (accountKeys) {
|
||||
return JSON.parse(accountKeys);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
/**
|
||||
* Returns a list of cache keys for all known tokens
|
||||
* @param clientId
|
||||
* @param storage
|
||||
* @returns
|
||||
*/
|
||||
function getTokenKeys(clientId, storage) {
|
||||
const item = storage.getItem(`${StaticCacheKeys.TOKEN_KEYS}.${clientId}`);
|
||||
if (item) {
|
||||
const tokenKeys = JSON.parse(item);
|
||||
if (tokenKeys &&
|
||||
tokenKeys.hasOwnProperty("idToken") &&
|
||||
tokenKeys.hasOwnProperty("accessToken") &&
|
||||
tokenKeys.hasOwnProperty("refreshToken")) {
|
||||
return tokenKeys;
|
||||
}
|
||||
}
|
||||
return {
|
||||
idToken: [],
|
||||
accessToken: [],
|
||||
refreshToken: [],
|
||||
};
|
||||
}
|
||||
|
||||
export { getAccountKeys, getTokenKeys };
|
||||
//# sourceMappingURL=CacheHelpers.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/CacheHelpers.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CacheHelpers.mjs","sources":["../../src/cache/CacheHelpers.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAMH;;;;AAIG;AACG,SAAU,cAAc,CAAC,OAA+B,EAAA;IAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AAClE,IAAA,IAAI,WAAW,EAAE;AACb,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAClC,KAAA;AAED,IAAA,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;;AAKG;AACa,SAAA,YAAY,CACxB,QAAgB,EAChB,OAA+B,EAAA;AAE/B,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA,EAAG,eAAe,CAAC,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAE,CAAC,CAAC;AAC1E,IAAA,IAAI,IAAI,EAAE;QACN,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACnC,QAAA,IACI,SAAS;AACT,YAAA,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC;AACnC,YAAA,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC;AACvC,YAAA,SAAS,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C;AACE,YAAA,OAAO,SAAsB,CAAC;AACjC,SAAA;AACJ,KAAA;IAED,OAAO;AACH,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,YAAY,EAAE,EAAE;KACnB,CAAC;AACN;;;;"}
|
||||
22
node_modules/@azure/msal-browser/dist/cache/CookieStorage.d.ts
generated
vendored
Normal file
22
node_modules/@azure/msal-browser/dist/cache/CookieStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { IWindowStorage } from "./IWindowStorage.js";
|
||||
export declare const SameSiteOptions: {
|
||||
readonly Lax: "Lax";
|
||||
readonly None: "None";
|
||||
};
|
||||
export type SameSiteOptions = (typeof SameSiteOptions)[keyof typeof SameSiteOptions];
|
||||
export declare class CookieStorage implements IWindowStorage<string> {
|
||||
initialize(): Promise<void>;
|
||||
getItem(key: string): string | null;
|
||||
getUserData(): string | null;
|
||||
setItem(key: string, value: string, cookieLifeDays?: number, secure?: boolean, sameSite?: SameSiteOptions): void;
|
||||
setUserData(): Promise<void>;
|
||||
removeItem(key: string): void;
|
||||
getKeys(): string[];
|
||||
containsKey(key: string): boolean;
|
||||
}
|
||||
/**
|
||||
* Get cookie expiration time
|
||||
* @param cookieLifeDays
|
||||
*/
|
||||
export declare function getCookieExpirationTime(cookieLifeDays: number): string;
|
||||
//# sourceMappingURL=CookieStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/CookieStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/CookieStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CookieStorage.d.ts","sourceRoot":"","sources":["../../src/cache/CookieStorage.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AACX,MAAM,MAAM,eAAe,GACvB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAE3D,qBAAa,aAAc,YAAW,cAAc,CAAC,MAAM,CAAC;IACxD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAenC,WAAW,IAAI,MAAM,GAAG,IAAI;IAI5B,OAAO,CACH,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,cAAc,CAAC,EAAE,MAAM,EACvB,MAAM,GAAE,OAAc,EACtB,QAAQ,GAAE,eAAqC,GAChD,IAAI;IAkBD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAMlC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK7B,OAAO,IAAI,MAAM,EAAE;IAWnB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAGpC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAMtE"}
|
||||
78
node_modules/@azure/msal-browser/dist/cache/CookieStorage.mjs
generated
vendored
Normal file
78
node_modules/@azure/msal-browser/dist/cache/CookieStorage.mjs
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { createClientAuthError, ClientAuthErrorCodes } from '@azure/msal-common/browser';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
// Cookie life calculation (hours * minutes * seconds * ms)
|
||||
const COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
|
||||
const SameSiteOptions = {
|
||||
Lax: "Lax",
|
||||
None: "None",
|
||||
};
|
||||
class CookieStorage {
|
||||
initialize() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
getItem(key) {
|
||||
const name = `${encodeURIComponent(key)}`;
|
||||
const cookieList = document.cookie.split(";");
|
||||
for (let i = 0; i < cookieList.length; i++) {
|
||||
const cookie = cookieList[i];
|
||||
const [key, ...rest] = decodeURIComponent(cookie).trim().split("=");
|
||||
const value = rest.join("=");
|
||||
if (key === name) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
getUserData() {
|
||||
throw createClientAuthError(ClientAuthErrorCodes.methodNotImplemented);
|
||||
}
|
||||
setItem(key, value, cookieLifeDays, secure = true, sameSite = SameSiteOptions.Lax) {
|
||||
let cookieStr = `${encodeURIComponent(key)}=${encodeURIComponent(value)};path=/;SameSite=${sameSite};`;
|
||||
if (cookieLifeDays) {
|
||||
const expireTime = getCookieExpirationTime(cookieLifeDays);
|
||||
cookieStr += `expires=${expireTime};`;
|
||||
}
|
||||
if (secure || sameSite === SameSiteOptions.None) {
|
||||
// SameSite None requires Secure flag
|
||||
cookieStr += "Secure;";
|
||||
}
|
||||
document.cookie = cookieStr;
|
||||
}
|
||||
async setUserData() {
|
||||
return Promise.reject(createClientAuthError(ClientAuthErrorCodes.methodNotImplemented));
|
||||
}
|
||||
removeItem(key) {
|
||||
// Setting expiration to -1 removes it
|
||||
this.setItem(key, "", -1);
|
||||
}
|
||||
getKeys() {
|
||||
const cookieList = document.cookie.split(";");
|
||||
const keys = [];
|
||||
cookieList.forEach((cookie) => {
|
||||
const cookieParts = decodeURIComponent(cookie).trim().split("=");
|
||||
keys.push(cookieParts[0]);
|
||||
});
|
||||
return keys;
|
||||
}
|
||||
containsKey(key) {
|
||||
return this.getKeys().includes(key);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get cookie expiration time
|
||||
* @param cookieLifeDays
|
||||
*/
|
||||
function getCookieExpirationTime(cookieLifeDays) {
|
||||
const today = new Date();
|
||||
const expr = new Date(today.getTime() + cookieLifeDays * COOKIE_LIFE_MULTIPLIER);
|
||||
return expr.toUTCString();
|
||||
}
|
||||
|
||||
export { CookieStorage, SameSiteOptions, getCookieExpirationTime };
|
||||
//# sourceMappingURL=CookieStorage.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/CookieStorage.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/CookieStorage.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CookieStorage.mjs","sources":["../../src/cache/CookieStorage.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAQH;AACA,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtC,MAAA,eAAe,GAAG;AAC3B,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,IAAI,EAAE,M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AE,GAAG,cAAc,GAAG,sBAAsB,CAC5D,CAAC;AACF,IAAA,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC9B;;;;"}
|
||||
57
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.d.ts
generated
vendored
Normal file
57
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import { IAsyncStorage } from "./IAsyncStorage.js";
|
||||
/**
|
||||
* Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
|
||||
*/
|
||||
export declare class DatabaseStorage<T> implements IAsyncStorage<T> {
|
||||
private db;
|
||||
private dbName;
|
||||
private tableName;
|
||||
private version;
|
||||
private dbOpen;
|
||||
constructor();
|
||||
/**
|
||||
* Opens IndexedDB instance.
|
||||
*/
|
||||
open(): Promise<void>;
|
||||
/**
|
||||
* Closes the connection to IndexedDB database when all pending transactions
|
||||
* complete.
|
||||
*/
|
||||
closeConnection(): void;
|
||||
/**
|
||||
* Opens database if it's not already open
|
||||
*/
|
||||
private validateDbIsOpen;
|
||||
/**
|
||||
* Retrieves item from IndexedDB instance.
|
||||
* @param key
|
||||
*/
|
||||
getItem(key: string): Promise<T | null>;
|
||||
/**
|
||||
* Adds item to IndexedDB under given key
|
||||
* @param key
|
||||
* @param payload
|
||||
*/
|
||||
setItem(key: string, payload: T): Promise<void>;
|
||||
/**
|
||||
* Removes item from IndexedDB under given key
|
||||
* @param key
|
||||
*/
|
||||
removeItem(key: string): Promise<void>;
|
||||
/**
|
||||
* Get all the keys from the storage object as an iterable array of strings.
|
||||
*/
|
||||
getKeys(): Promise<string[]>;
|
||||
/**
|
||||
*
|
||||
* Checks whether there is an object under the search key in the object store
|
||||
*/
|
||||
containsKey(key: string): Promise<boolean>;
|
||||
/**
|
||||
* Deletes the MSAL database. The database is deleted rather than cleared to make it possible
|
||||
* for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues
|
||||
* with IndexedDB database versions.
|
||||
*/
|
||||
deleteDatabase(): Promise<boolean>;
|
||||
}
|
||||
//# sourceMappingURL=DatabaseStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"DatabaseStorage.d.ts","sourceRoot":"","sources":["../../src/cache/DatabaseStorage.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcnD;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAU;;IASxB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA0B3B;;;OAGG;IACH,eAAe,IAAI,IAAI;IAQvB;;OAEG;YACW,gBAAgB;IAM9B;;;OAGG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IA+B7C;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCrD;;;OAGG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8B5C;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IA+BlC;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgChD;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAwB3C"}
|
||||
209
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.mjs
generated
vendored
Normal file
209
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.mjs
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
||||
import { DB_NAME, DB_VERSION, DB_TABLE_NAME } from '../utils/BrowserConstants.mjs';
|
||||
import { databaseUnavailable, databaseNotOpen } from '../error/BrowserAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
|
||||
*/
|
||||
class DatabaseStorage {
|
||||
constructor() {
|
||||
this.dbName = DB_NAME;
|
||||
this.version = DB_VERSION;
|
||||
this.tableName = DB_TABLE_NAME;
|
||||
this.dbOpen = false;
|
||||
}
|
||||
/**
|
||||
* Opens IndexedDB instance.
|
||||
*/
|
||||
async open() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const openDB = window.indexedDB.open(this.dbName, this.version);
|
||||
openDB.addEventListener("upgradeneeded", (e) => {
|
||||
const event = e;
|
||||
event.target.result.createObjectStore(this.tableName);
|
||||
});
|
||||
openDB.addEventListener("success", (e) => {
|
||||
const event = e;
|
||||
this.db = event.target.result;
|
||||
this.dbOpen = true;
|
||||
resolve();
|
||||
});
|
||||
openDB.addEventListener("error", () => reject(createBrowserAuthError(databaseUnavailable)));
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Closes the connection to IndexedDB database when all pending transactions
|
||||
* complete.
|
||||
*/
|
||||
closeConnection() {
|
||||
const db = this.db;
|
||||
if (db && this.dbOpen) {
|
||||
db.close();
|
||||
this.dbOpen = false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Opens database if it's not already open
|
||||
*/
|
||||
async validateDbIsOpen() {
|
||||
if (!this.dbOpen) {
|
||||
return this.open();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Retrieves item from IndexedDB instance.
|
||||
* @param key
|
||||
*/
|
||||
async getItem(key) {
|
||||
await this.validateDbIsOpen();
|
||||
return new Promise((resolve, reject) => {
|
||||
// TODO: Add timeouts?
|
||||
if (!this.db) {
|
||||
return reject(createBrowserAuthError(databaseNotOpen));
|
||||
}
|
||||
const transaction = this.db.transaction([this.tableName], "readonly");
|
||||
const objectStore = transaction.objectStore(this.tableName);
|
||||
const dbGet = objectStore.get(key);
|
||||
dbGet.addEventListener("success", (e) => {
|
||||
const event = e;
|
||||
this.closeConnection();
|
||||
resolve(event.target.result);
|
||||
});
|
||||
dbGet.addEventListener("error", (e) => {
|
||||
this.closeConnection();
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Adds item to IndexedDB under given key
|
||||
* @param key
|
||||
* @param payload
|
||||
*/
|
||||
async setItem(key, payload) {
|
||||
await this.validateDbIsOpen();
|
||||
return new Promise((resolve, reject) => {
|
||||
// TODO: Add timeouts?
|
||||
if (!this.db) {
|
||||
return reject(createBrowserAuthError(databaseNotOpen));
|
||||
}
|
||||
const transaction = this.db.transaction([this.tableName], "readwrite");
|
||||
const objectStore = transaction.objectStore(this.tableName);
|
||||
const dbPut = objectStore.put(payload, key);
|
||||
dbPut.addEventListener("success", () => {
|
||||
this.closeConnection();
|
||||
resolve();
|
||||
});
|
||||
dbPut.addEventListener("error", (e) => {
|
||||
this.closeConnection();
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Removes item from IndexedDB under given key
|
||||
* @param key
|
||||
*/
|
||||
async removeItem(key) {
|
||||
await this.validateDbIsOpen();
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.db) {
|
||||
return reject(createBrowserAuthError(databaseNotOpen));
|
||||
}
|
||||
const transaction = this.db.transaction([this.tableName], "readwrite");
|
||||
const objectStore = transaction.objectStore(this.tableName);
|
||||
const dbDelete = objectStore.delete(key);
|
||||
dbDelete.addEventListener("success", () => {
|
||||
this.closeConnection();
|
||||
resolve();
|
||||
});
|
||||
dbDelete.addEventListener("error", (e) => {
|
||||
this.closeConnection();
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get all the keys from the storage object as an iterable array of strings.
|
||||
*/
|
||||
async getKeys() {
|
||||
await this.validateDbIsOpen();
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.db) {
|
||||
return reject(createBrowserAuthError(databaseNotOpen));
|
||||
}
|
||||
const transaction = this.db.transaction([this.tableName], "readonly");
|
||||
const objectStore = transaction.objectStore(this.tableName);
|
||||
const dbGetKeys = objectStore.getAllKeys();
|
||||
dbGetKeys.addEventListener("success", (e) => {
|
||||
const event = e;
|
||||
this.closeConnection();
|
||||
resolve(event.target.result);
|
||||
});
|
||||
dbGetKeys.addEventListener("error", (e) => {
|
||||
this.closeConnection();
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* Checks whether there is an object under the search key in the object store
|
||||
*/
|
||||
async containsKey(key) {
|
||||
await this.validateDbIsOpen();
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.db) {
|
||||
return reject(createBrowserAuthError(databaseNotOpen));
|
||||
}
|
||||
const transaction = this.db.transaction([this.tableName], "readonly");
|
||||
const objectStore = transaction.objectStore(this.tableName);
|
||||
const dbContainsKey = objectStore.count(key);
|
||||
dbContainsKey.addEventListener("success", (e) => {
|
||||
const event = e;
|
||||
this.closeConnection();
|
||||
resolve(event.target.result === 1);
|
||||
});
|
||||
dbContainsKey.addEventListener("error", (e) => {
|
||||
this.closeConnection();
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Deletes the MSAL database. The database is deleted rather than cleared to make it possible
|
||||
* for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues
|
||||
* with IndexedDB database versions.
|
||||
*/
|
||||
async deleteDatabase() {
|
||||
// Check if database being deleted exists
|
||||
if (this.db && this.dbOpen) {
|
||||
this.closeConnection();
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
const deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
|
||||
const id = setTimeout(() => reject(false), 200); // Reject if events aren't raised within 200ms
|
||||
deleteDbRequest.addEventListener("success", () => {
|
||||
clearTimeout(id);
|
||||
return resolve(true);
|
||||
});
|
||||
deleteDbRequest.addEventListener("blocked", () => {
|
||||
clearTimeout(id);
|
||||
return resolve(true);
|
||||
});
|
||||
deleteDbRequest.addEventListener("error", () => {
|
||||
clearTimeout(id);
|
||||
return reject(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { DatabaseStorage };
|
||||
//# sourceMappingURL=DatabaseStorage.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
28
node_modules/@azure/msal-browser/dist/cache/IAsyncStorage.d.ts
generated
vendored
Normal file
28
node_modules/@azure/msal-browser/dist/cache/IAsyncStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
export interface IAsyncStorage<T> {
|
||||
/**
|
||||
* Get the item from the asynchronous storage object matching the given key.
|
||||
* @param key
|
||||
*/
|
||||
getItem(key: string): Promise<T | null>;
|
||||
/**
|
||||
* Sets the item in the asynchronous storage object with the given key.
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
setItem(key: string, value: T): Promise<void>;
|
||||
/**
|
||||
* Removes the item in the asynchronous storage object matching the given key.
|
||||
* @param key
|
||||
*/
|
||||
removeItem(key: string): Promise<void>;
|
||||
/**
|
||||
* Get all the keys from the asynchronous storage object as an iterable array of strings.
|
||||
*/
|
||||
getKeys(): Promise<string[]>;
|
||||
/**
|
||||
* Returns true or false if the given key is present in the cache.
|
||||
* @param key
|
||||
*/
|
||||
containsKey(key: string): Promise<boolean>;
|
||||
}
|
||||
//# sourceMappingURL=IAsyncStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/IAsyncStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/IAsyncStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IAsyncStorage.d.ts","sourceRoot":"","sources":["../../src/cache/IAsyncStorage.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa,CAAC,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAExC;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7B;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC9C"}
|
||||
12
node_modules/@azure/msal-browser/dist/cache/ITokenCache.d.ts
generated
vendored
Normal file
12
node_modules/@azure/msal-browser/dist/cache/ITokenCache.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { ExternalTokenResponse } from "@azure/msal-common/browser";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { LoadTokenOptions } from "./TokenCache.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
export interface ITokenCache {
|
||||
/**
|
||||
* API to side-load tokens to MSAL cache
|
||||
* @returns `AuthenticationResult` for the response that was loaded.
|
||||
*/
|
||||
loadExternalTokens(request: SilentRequest, response: ExternalTokenResponse, options: LoadTokenOptions): Promise<AuthenticationResult>;
|
||||
}
|
||||
//# sourceMappingURL=ITokenCache.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/ITokenCache.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/ITokenCache.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ITokenCache.d.ts","sourceRoot":"","sources":["../../src/cache/ITokenCache.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,MAAM,WAAW,WAAW;IACxB;;;OAGG;IACH,kBAAkB,CACd,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,gBAAgB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACpC"}
|
||||
40
node_modules/@azure/msal-browser/dist/cache/IWindowStorage.d.ts
generated
vendored
Normal file
40
node_modules/@azure/msal-browser/dist/cache/IWindowStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
export interface IWindowStorage<T> {
|
||||
/**
|
||||
* Async initializer
|
||||
*/
|
||||
initialize(correlationId: string): Promise<void>;
|
||||
/**
|
||||
* Get the item from the window storage object matching the given key.
|
||||
* @param key
|
||||
*/
|
||||
getItem(key: string): T | null;
|
||||
/**
|
||||
* Getter for sensitive data that may contain PII.
|
||||
*/
|
||||
getUserData(key: string): T | null;
|
||||
/**
|
||||
* Sets the item in the window storage object with the given key.
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
setItem(key: string, value: T): void;
|
||||
/**
|
||||
* Setter for sensitive data that may contain PII.
|
||||
*/
|
||||
setUserData(key: string, value: T, correlationId: string): Promise<void>;
|
||||
/**
|
||||
* Removes the item in the window storage object matching the given key.
|
||||
* @param key
|
||||
*/
|
||||
removeItem(key: string): void;
|
||||
/**
|
||||
* Get all the keys from the window storage object as an iterable array of strings.
|
||||
*/
|
||||
getKeys(): string[];
|
||||
/**
|
||||
* Returns true or false if the given key is present in the cache.
|
||||
* @param key
|
||||
*/
|
||||
containsKey(key: string): boolean;
|
||||
}
|
||||
//# sourceMappingURL=IWindowStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/IWindowStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/IWindowStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IWindowStorage.d.ts","sourceRoot":"","sources":["../../src/cache/IWindowStorage.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc,CAAC,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC;IAEnC;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAErC;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzE;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,OAAO,IAAI,MAAM,EAAE,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACrC"}
|
||||
49
node_modules/@azure/msal-browser/dist/cache/LocalStorage.d.ts
generated
vendored
Normal file
49
node_modules/@azure/msal-browser/dist/cache/LocalStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
import { IPerformanceClient, Logger } from "@azure/msal-common/browser";
|
||||
import { IWindowStorage } from "./IWindowStorage.js";
|
||||
export declare class LocalStorage implements IWindowStorage<string> {
|
||||
private clientId;
|
||||
private initialized;
|
||||
private memoryStorage;
|
||||
private performanceClient;
|
||||
private logger;
|
||||
private encryptionCookie?;
|
||||
private broadcast;
|
||||
constructor(clientId: string, logger: Logger, performanceClient: IPerformanceClient);
|
||||
initialize(correlationId: string): Promise<void>;
|
||||
getItem(key: string): string | null;
|
||||
getUserData(key: string): string | null;
|
||||
setItem(key: string, value: string): void;
|
||||
setUserData(key: string, value: string, correlationId: string): Promise<void>;
|
||||
removeItem(key: string): void;
|
||||
getKeys(): string[];
|
||||
containsKey(key: string): boolean;
|
||||
/**
|
||||
* Removes all known MSAL keys from the cache
|
||||
*/
|
||||
clear(): void;
|
||||
/**
|
||||
* Helper to decrypt all known MSAL keys in localStorage and save them to inMemory storage
|
||||
* @returns
|
||||
*/
|
||||
private importExistingCache;
|
||||
/**
|
||||
* Helper to decrypt and save cache entries
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
private getItemFromEncryptedCache;
|
||||
/**
|
||||
* Helper to decrypt and save an array of cache keys
|
||||
* @param arr
|
||||
* @returns Array of keys successfully imported
|
||||
*/
|
||||
private importArray;
|
||||
/**
|
||||
* Gets encryption context for a given cache entry. This is clientId for app specific entries, empty string for shared entries
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
private getContext;
|
||||
private updateCache;
|
||||
}
|
||||
//# sourceMappingURL=LocalStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/LocalStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/LocalStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"LocalStorage.d.ts","sourceRoot":"","sources":["../../src/cache/LocalStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAGH,kBAAkB,EAGlB,MAAM,EAET,MAAM,4BAA4B,CAAC;AAmBpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAmBrD,qBAAa,YAAa,YAAW,cAAc,CAAC,MAAM,CAAC;IACvD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,iBAAiB,CAAqB;IAC9C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,SAAS,CAAmB;gBAGhC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,kBAAkB;IAenC,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoFtD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAInC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IASvC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAInC,WAAW,CACb,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IA+BhB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAY7B,OAAO,IAAI,MAAM,EAAE;IAInB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIjC;;OAEG;IACH,KAAK,IAAI,IAAI;IAsBb;;;OAGG;YACW,mBAAmB;IA8BjC;;;;OAIG;YACW,yBAAyB;IAqDvC;;;;OAIG;YACW,WAAW;IA0BzB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,WAAW;CAkCtB"}
|
||||
263
node_modules/@azure/msal-browser/dist/cache/LocalStorage.mjs
generated
vendored
Normal file
263
node_modules/@azure/msal-browser/dist/cache/LocalStorage.mjs
generated
vendored
Normal file
@@ -0,0 +1,263 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { invoke, PerformanceEvents, invokeAsync, Constants } from '@azure/msal-common/browser';
|
||||
import { generateHKDF, createNewGuid, generateBaseKey, encrypt, decrypt } from '../crypto/BrowserCrypto.mjs';
|
||||
import { base64DecToArr } from '../encode/Base64Decode.mjs';
|
||||
import { urlEncodeArr } from '../encode/Base64Encode.mjs';
|
||||
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
||||
import { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';
|
||||
import { SameSiteOptions, CookieStorage } from './CookieStorage.mjs';
|
||||
import { MemoryStorage } from './MemoryStorage.mjs';
|
||||
import { getAccountKeys, getTokenKeys } from './CacheHelpers.mjs';
|
||||
import { StaticCacheKeys } from '../utils/BrowserConstants.mjs';
|
||||
import { storageNotSupported } from '../error/BrowserConfigurationAuthErrorCodes.mjs';
|
||||
import { uninitializedPublicClientApplication } from '../error/BrowserAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
const ENCRYPTION_KEY = "msal.cache.encryption";
|
||||
const BROADCAST_CHANNEL_NAME = "msal.broadcast.cache";
|
||||
class LocalStorage {
|
||||
constructor(clientId, logger, performanceClient) {
|
||||
if (!window.localStorage) {
|
||||
throw createBrowserConfigurationAuthError(storageNotSupported);
|
||||
}
|
||||
this.memoryStorage = new MemoryStorage();
|
||||
this.initialized = false;
|
||||
this.clientId = clientId;
|
||||
this.logger = logger;
|
||||
this.performanceClient = performanceClient;
|
||||
this.broadcast = new BroadcastChannel(BROADCAST_CHANNEL_NAME);
|
||||
}
|
||||
async initialize(correlationId) {
|
||||
this.initialized = true;
|
||||
const cookies = new CookieStorage();
|
||||
const cookieString = cookies.getItem(ENCRYPTION_KEY);
|
||||
let parsedCookie = { key: "", id: "" };
|
||||
if (cookieString) {
|
||||
try {
|
||||
parsedCookie = JSON.parse(cookieString);
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
if (parsedCookie.key && parsedCookie.id) {
|
||||
// Encryption key already exists, import
|
||||
const baseKey = invoke(base64DecToArr, PerformanceEvents.Base64Decode, this.logger, this.performanceClient, correlationId)(parsedCookie.key);
|
||||
this.encryptionCookie = {
|
||||
id: parsedCookie.id,
|
||||
key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),
|
||||
};
|
||||
await invokeAsync(this.importExistingCache.bind(this), PerformanceEvents.ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);
|
||||
}
|
||||
else {
|
||||
// Encryption key doesn't exist or is invalid, generate a new one and clear existing cache
|
||||
this.clear();
|
||||
const id = createNewGuid();
|
||||
const baseKey = await invokeAsync(generateBaseKey, PerformanceEvents.GenerateBaseKey, this.logger, this.performanceClient, correlationId)();
|
||||
const keyStr = invoke(urlEncodeArr, PerformanceEvents.UrlEncodeArr, this.logger, this.performanceClient, correlationId)(new Uint8Array(baseKey));
|
||||
this.encryptionCookie = {
|
||||
id: id,
|
||||
key: await invokeAsync(generateHKDF, PerformanceEvents.GenerateHKDF, this.logger, this.performanceClient, correlationId)(baseKey),
|
||||
};
|
||||
const cookieData = {
|
||||
id: id,
|
||||
key: keyStr,
|
||||
};
|
||||
cookies.setItem(ENCRYPTION_KEY, JSON.stringify(cookieData), 0, // Expiration - 0 means cookie will be cleared at the end of the browser session
|
||||
true, // Secure flag
|
||||
SameSiteOptions.None // SameSite must be None to support iframed apps
|
||||
);
|
||||
}
|
||||
// Register listener for cache updates in other tabs
|
||||
this.broadcast.addEventListener("message", this.updateCache.bind(this));
|
||||
}
|
||||
getItem(key) {
|
||||
return window.localStorage.getItem(key);
|
||||
}
|
||||
getUserData(key) {
|
||||
if (!this.initialized) {
|
||||
throw createBrowserAuthError(uninitializedPublicClientApplication);
|
||||
}
|
||||
return this.memoryStorage.getItem(key);
|
||||
}
|
||||
setItem(key, value) {
|
||||
window.localStorage.setItem(key, value);
|
||||
}
|
||||
async setUserData(key, value, correlationId) {
|
||||
if (!this.initialized || !this.encryptionCookie) {
|
||||
throw createBrowserAuthError(uninitializedPublicClientApplication);
|
||||
}
|
||||
const { data, nonce } = await invokeAsync(encrypt, PerformanceEvents.Encrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, value, this.getContext(key));
|
||||
const encryptedData = {
|
||||
id: this.encryptionCookie.id,
|
||||
nonce: nonce,
|
||||
data: data,
|
||||
};
|
||||
this.memoryStorage.setItem(key, value);
|
||||
this.setItem(key, JSON.stringify(encryptedData));
|
||||
// Notify other frames to update their in-memory cache
|
||||
this.broadcast.postMessage({
|
||||
key: key,
|
||||
value: value,
|
||||
context: this.getContext(key),
|
||||
});
|
||||
}
|
||||
removeItem(key) {
|
||||
if (this.memoryStorage.containsKey(key)) {
|
||||
this.memoryStorage.removeItem(key);
|
||||
this.broadcast.postMessage({
|
||||
key: key,
|
||||
value: null,
|
||||
context: this.getContext(key),
|
||||
});
|
||||
}
|
||||
window.localStorage.removeItem(key);
|
||||
}
|
||||
getKeys() {
|
||||
return Object.keys(window.localStorage);
|
||||
}
|
||||
containsKey(key) {
|
||||
return window.localStorage.hasOwnProperty(key);
|
||||
}
|
||||
/**
|
||||
* Removes all known MSAL keys from the cache
|
||||
*/
|
||||
clear() {
|
||||
// Removes all remaining MSAL cache items
|
||||
this.memoryStorage.clear();
|
||||
const accountKeys = getAccountKeys(this);
|
||||
accountKeys.forEach((key) => this.removeItem(key));
|
||||
const tokenKeys = getTokenKeys(this.clientId, this);
|
||||
tokenKeys.idToken.forEach((key) => this.removeItem(key));
|
||||
tokenKeys.accessToken.forEach((key) => this.removeItem(key));
|
||||
tokenKeys.refreshToken.forEach((key) => this.removeItem(key));
|
||||
// Clean up anything left
|
||||
this.getKeys().forEach((cacheKey) => {
|
||||
if (cacheKey.startsWith(Constants.CACHE_PREFIX) ||
|
||||
cacheKey.indexOf(this.clientId) !== -1) {
|
||||
this.removeItem(cacheKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Helper to decrypt all known MSAL keys in localStorage and save them to inMemory storage
|
||||
* @returns
|
||||
*/
|
||||
async importExistingCache(correlationId) {
|
||||
if (!this.encryptionCookie) {
|
||||
return;
|
||||
}
|
||||
let accountKeys = getAccountKeys(this);
|
||||
accountKeys = await this.importArray(accountKeys, correlationId);
|
||||
// Write valid account keys back to map
|
||||
this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
|
||||
const tokenKeys = getTokenKeys(this.clientId, this);
|
||||
tokenKeys.idToken = await this.importArray(tokenKeys.idToken, correlationId);
|
||||
tokenKeys.accessToken = await this.importArray(tokenKeys.accessToken, correlationId);
|
||||
tokenKeys.refreshToken = await this.importArray(tokenKeys.refreshToken, correlationId);
|
||||
// Write valid token keys back to map
|
||||
this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));
|
||||
}
|
||||
/**
|
||||
* Helper to decrypt and save cache entries
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
async getItemFromEncryptedCache(key, correlationId) {
|
||||
if (!this.encryptionCookie) {
|
||||
return null;
|
||||
}
|
||||
const rawCache = this.getItem(key);
|
||||
if (!rawCache) {
|
||||
return null;
|
||||
}
|
||||
let encObj;
|
||||
try {
|
||||
encObj = JSON.parse(rawCache);
|
||||
}
|
||||
catch (e) {
|
||||
// Not a valid encrypted object, remove
|
||||
return null;
|
||||
}
|
||||
if (!encObj.id || !encObj.nonce || !encObj.data) {
|
||||
// Data is not encrypted, likely from old version of MSAL. It must be removed because we don't know how old it is.
|
||||
this.performanceClient.incrementFields({ unencryptedCacheCount: 1 }, correlationId);
|
||||
return null;
|
||||
}
|
||||
if (encObj.id !== this.encryptionCookie.id) {
|
||||
// Data was encrypted with a different key. It must be removed because it is from a previous session.
|
||||
this.performanceClient.incrementFields({ encryptedCacheExpiredCount: 1 }, correlationId);
|
||||
return null;
|
||||
}
|
||||
return invokeAsync(decrypt, PerformanceEvents.Decrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, encObj.nonce, this.getContext(key), encObj.data);
|
||||
}
|
||||
/**
|
||||
* Helper to decrypt and save an array of cache keys
|
||||
* @param arr
|
||||
* @returns Array of keys successfully imported
|
||||
*/
|
||||
async importArray(arr, correlationId) {
|
||||
const importedArr = [];
|
||||
const promiseArr = [];
|
||||
arr.forEach((key) => {
|
||||
const promise = this.getItemFromEncryptedCache(key, correlationId).then((value) => {
|
||||
if (value) {
|
||||
this.memoryStorage.setItem(key, value);
|
||||
importedArr.push(key);
|
||||
}
|
||||
else {
|
||||
// If value is empty, unencrypted or expired remove
|
||||
this.removeItem(key);
|
||||
}
|
||||
});
|
||||
promiseArr.push(promise);
|
||||
});
|
||||
await Promise.all(promiseArr);
|
||||
return importedArr;
|
||||
}
|
||||
/**
|
||||
* Gets encryption context for a given cache entry. This is clientId for app specific entries, empty string for shared entries
|
||||
* @param key
|
||||
* @returns
|
||||
*/
|
||||
getContext(key) {
|
||||
let context = "";
|
||||
if (key.includes(this.clientId)) {
|
||||
context = this.clientId; // Used to bind encryption key to this appId
|
||||
}
|
||||
return context;
|
||||
}
|
||||
updateCache(event) {
|
||||
this.logger.trace("Updating internal cache from broadcast event");
|
||||
const perfMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.LocalStorageUpdated);
|
||||
perfMeasurement.add({ isBackground: true });
|
||||
const { key, value, context } = event.data;
|
||||
if (!key) {
|
||||
this.logger.error("Broadcast event missing key");
|
||||
perfMeasurement.end({ success: false, errorCode: "noKey" });
|
||||
return;
|
||||
}
|
||||
if (context && context !== this.clientId) {
|
||||
this.logger.trace(`Ignoring broadcast event from clientId: ${context}`);
|
||||
perfMeasurement.end({
|
||||
success: false,
|
||||
errorCode: "contextMismatch",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!value) {
|
||||
this.memoryStorage.removeItem(key);
|
||||
this.logger.verbose("Removed item from internal cache");
|
||||
}
|
||||
else {
|
||||
this.memoryStorage.setItem(key, value);
|
||||
this.logger.verbose("Updated item in internal cache");
|
||||
}
|
||||
perfMeasurement.end({ success: true });
|
||||
}
|
||||
}
|
||||
|
||||
export { LocalStorage };
|
||||
//# sourceMappingURL=LocalStorage.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/LocalStorage.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/LocalStorage.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.d.ts
generated
vendored
Normal file
15
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { IWindowStorage } from "./IWindowStorage.js";
|
||||
export declare class MemoryStorage<T> implements IWindowStorage<T> {
|
||||
private cache;
|
||||
constructor();
|
||||
initialize(): Promise<void>;
|
||||
getItem(key: string): T | null;
|
||||
getUserData(key: string): T | null;
|
||||
setItem(key: string, value: T): void;
|
||||
setUserData(key: string, value: T): Promise<void>;
|
||||
removeItem(key: string): void;
|
||||
getKeys(): string[];
|
||||
containsKey(key: string): boolean;
|
||||
clear(): void;
|
||||
}
|
||||
//# sourceMappingURL=MemoryStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MemoryStorage.d.ts","sourceRoot":"","sources":["../../src/cache/MemoryStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,cAAc,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,KAAK,CAAiB;;IAMxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI;IAI9B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI;IAIlC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAI9B,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,OAAO,IAAI,MAAM,EAAE;IAQnB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIjC,KAAK,IAAI,IAAI;CAGhB"}
|
||||
45
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.mjs
generated
vendored
Normal file
45
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.mjs
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
class MemoryStorage {
|
||||
constructor() {
|
||||
this.cache = new Map();
|
||||
}
|
||||
async initialize() {
|
||||
// Memory storage does not require initialization
|
||||
}
|
||||
getItem(key) {
|
||||
return this.cache.get(key) || null;
|
||||
}
|
||||
getUserData(key) {
|
||||
return this.getItem(key);
|
||||
}
|
||||
setItem(key, value) {
|
||||
this.cache.set(key, value);
|
||||
}
|
||||
async setUserData(key, value) {
|
||||
this.setItem(key, value);
|
||||
}
|
||||
removeItem(key) {
|
||||
this.cache.delete(key);
|
||||
}
|
||||
getKeys() {
|
||||
const cacheKeys = [];
|
||||
this.cache.forEach((value, key) => {
|
||||
cacheKeys.push(key);
|
||||
});
|
||||
return cacheKeys;
|
||||
}
|
||||
containsKey(key) {
|
||||
return this.cache.has(key);
|
||||
}
|
||||
clear() {
|
||||
this.cache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
export { MemoryStorage };
|
||||
//# sourceMappingURL=MemoryStorage.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/MemoryStorage.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"MemoryStorage.mjs","sources":["../../src/cache/MemoryStorage.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;MAIU,aAAa,CAAA;AAGtB,IAAA,WAAA,GAAA;AACI,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAa,CAAC;KACrC;AAED,IAAA,MAAM,UAAU,GAAA;;KAEf;AAED,IAAA,OAAO,CAAC,GAAW,EAAA;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;KACtC;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KAC5B;IAED,OAAO,CAAC,GAAW,EAAE,KAAQ,EAAA;QACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC9B;AAED,IAAA,MAAM,WAAW,CAAC,GAAW,EAAE,KAAQ,EAAA;AACnC,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC5B;AAED,IAAA,UAAU,CAAC,GAAW,EAAA;AAClB,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC1B;IAED,OAAO,GAAA;QACH,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAQ,EAAE,GAAW,KAAI;AACzC,YAAA,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,SAAC,CAAC,CAAC;AACH,QAAA,OAAO,SAAS,CAAC;KACpB;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC9B;IAED,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;KACtB;AACJ;;;;"}
|
||||
13
node_modules/@azure/msal-browser/dist/cache/SessionStorage.d.ts
generated
vendored
Normal file
13
node_modules/@azure/msal-browser/dist/cache/SessionStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { IWindowStorage } from "./IWindowStorage.js";
|
||||
export declare class SessionStorage implements IWindowStorage<string> {
|
||||
constructor();
|
||||
initialize(): Promise<void>;
|
||||
getItem(key: string): string | null;
|
||||
getUserData(key: string): string | null;
|
||||
setItem(key: string, value: string): void;
|
||||
setUserData(key: string, value: string): Promise<void>;
|
||||
removeItem(key: string): void;
|
||||
getKeys(): string[];
|
||||
containsKey(key: string): boolean;
|
||||
}
|
||||
//# sourceMappingURL=SessionStorage.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/SessionStorage.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/SessionStorage.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SessionStorage.d.ts","sourceRoot":"","sources":["../../src/cache/SessionStorage.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,qBAAa,cAAe,YAAW,cAAc,CAAC,MAAM,CAAC;;IASnD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAInC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIvC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAInC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,OAAO,IAAI,MAAM,EAAE;IAInB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAGpC"}
|
||||
43
node_modules/@azure/msal-browser/dist/cache/SessionStorage.mjs
generated
vendored
Normal file
43
node_modules/@azure/msal-browser/dist/cache/SessionStorage.mjs
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { createBrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.mjs';
|
||||
import { storageNotSupported } from '../error/BrowserConfigurationAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
class SessionStorage {
|
||||
constructor() {
|
||||
if (!window.sessionStorage) {
|
||||
throw createBrowserConfigurationAuthError(storageNotSupported);
|
||||
}
|
||||
}
|
||||
async initialize() {
|
||||
// Session storage does not require initialization
|
||||
}
|
||||
getItem(key) {
|
||||
return window.sessionStorage.getItem(key);
|
||||
}
|
||||
getUserData(key) {
|
||||
return this.getItem(key);
|
||||
}
|
||||
setItem(key, value) {
|
||||
window.sessionStorage.setItem(key, value);
|
||||
}
|
||||
async setUserData(key, value) {
|
||||
this.setItem(key, value);
|
||||
}
|
||||
removeItem(key) {
|
||||
window.sessionStorage.removeItem(key);
|
||||
}
|
||||
getKeys() {
|
||||
return Object.keys(window.sessionStorage);
|
||||
}
|
||||
containsKey(key) {
|
||||
return window.sessionStorage.hasOwnProperty(key);
|
||||
}
|
||||
}
|
||||
|
||||
export { SessionStorage };
|
||||
//# sourceMappingURL=SessionStorage.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/SessionStorage.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/SessionStorage.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SessionStorage.mjs","sources":["../../src/cache/SessionStorage.ts"],"sourcesContent":[null],"names":["BrowserConfigurationAuthErrorCodes.storageNotSupported"],"mappings":";;;;;AAAA;;;AAGG;MAQU,cAAc,CAAA;AACvB,IAAA,WAAA,GAAA;AACI,QAAA,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;AACxB,YAAA,MAAM,mCAAmC,CACrCA,mBAAsD,CACzD,CAAC;AACL,SAAA;KACJ;AAED,IAAA,MAAM,UAAU,GAAA;;KAEf;AAED,IAAA,OAAO,CAAC,GAAW,EAAA;QACf,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KAC7C;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KAC5B;IAED,OAAO,CAAC,GAAW,EAAE,KAAa,EAAA;QAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC7C;AAED,IAAA,MAAM,WAAW,CAAC,GAAW,EAAE,KAAa,EAAA;AACxC,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC5B;AAED,IAAA,UAAU,CAAC,GAAW,EAAA;AAClB,QAAA,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;KACzC;IAED,OAAO,GAAA;QACH,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;KAC7C;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;QACnB,OAAO,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;KACpD;AACJ;;;;"}
|
||||
78
node_modules/@azure/msal-browser/dist/cache/TokenCache.d.ts
generated
vendored
Normal file
78
node_modules/@azure/msal-browser/dist/cache/TokenCache.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import { ICrypto, Logger, ExternalTokenResponse } from "@azure/msal-common/browser";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { BrowserCacheManager } from "./BrowserCacheManager.js";
|
||||
import { ITokenCache } from "./ITokenCache.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
export type LoadTokenOptions = {
|
||||
clientInfo?: string;
|
||||
expiresOn?: number;
|
||||
extendedExpiresOn?: number;
|
||||
};
|
||||
/**
|
||||
* Token cache manager
|
||||
*/
|
||||
export declare class TokenCache implements ITokenCache {
|
||||
isBrowserEnvironment: boolean;
|
||||
protected config: BrowserConfiguration;
|
||||
private storage;
|
||||
private logger;
|
||||
private cryptoObj;
|
||||
constructor(configuration: BrowserConfiguration, storage: BrowserCacheManager, logger: Logger, cryptoObj: ICrypto);
|
||||
/**
|
||||
* API to load tokens to msal-browser cache.
|
||||
* @param request
|
||||
* @param response
|
||||
* @param options
|
||||
* @returns `AuthenticationResult` for the response that was loaded.
|
||||
*/
|
||||
loadExternalTokens(request: SilentRequest, response: ExternalTokenResponse, options: LoadTokenOptions): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Helper function to load account to msal-browser cache
|
||||
* @param idToken
|
||||
* @param environment
|
||||
* @param clientInfo
|
||||
* @param authorityType
|
||||
* @param requestHomeAccountId
|
||||
* @returns `AccountEntity`
|
||||
*/
|
||||
private loadAccount;
|
||||
/**
|
||||
* Helper function to load id tokens to msal-browser cache
|
||||
* @param idToken
|
||||
* @param homeAccountId
|
||||
* @param environment
|
||||
* @param tenantId
|
||||
* @returns `IdTokenEntity`
|
||||
*/
|
||||
private loadIdToken;
|
||||
/**
|
||||
* Helper function to load access tokens to msal-browser cache
|
||||
* @param request
|
||||
* @param response
|
||||
* @param homeAccountId
|
||||
* @param environment
|
||||
* @param tenantId
|
||||
* @returns `AccessTokenEntity`
|
||||
*/
|
||||
private loadAccessToken;
|
||||
/**
|
||||
* Helper function to load refresh tokens to msal-browser cache
|
||||
* @param request
|
||||
* @param response
|
||||
* @param homeAccountId
|
||||
* @param environment
|
||||
* @returns `RefreshTokenEntity`
|
||||
*/
|
||||
private loadRefreshToken;
|
||||
/**
|
||||
* Helper function to generate an `AuthenticationResult` for the result.
|
||||
* @param request
|
||||
* @param idTokenObj
|
||||
* @param cacheRecord
|
||||
* @param authority
|
||||
* @returns `AuthenticationResult`
|
||||
*/
|
||||
private generateAuthenticationResult;
|
||||
}
|
||||
//# sourceMappingURL=TokenCache.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/TokenCache.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/TokenCache.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"TokenCache.d.ts","sourceRoot":"","sources":["../../src/cache/TokenCache.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,OAAO,EAEP,MAAM,EAIN,qBAAqB,EAQxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAI3E,MAAM,MAAM,gBAAgB,GAAG;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,qBAAa,UAAW,YAAW,WAAW;IAEnC,oBAAoB,EAAE,OAAO,CAAC;IAErC,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAEvC,OAAO,CAAC,OAAO,CAAsB;IAErC,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO,CAAC,SAAS,CAAU;gBAGvB,aAAa,EAAE,oBAAoB,EACnC,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,OAAO;IAWtB;;;;;;OAMG;IACG,kBAAkB,CACpB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,gBAAgB,GAC1B,OAAO,CAAC,oBAAoB,CAAC;IAkFhC;;;;;;;;OAQG;YACW,WAAW;IAoDzB;;;;;;;OAOG;YACW,WAAW;IAyBzB;;;;;;;;OAQG;YACW,eAAe;IA8D7B;;;;;;;OAOG;YACW,gBAAgB;IA+B9B;;;;;;;OAOG;IACH,OAAO,CAAC,4BAA4B;CAgDvC"}
|
||||
207
node_modules/@azure/msal-browser/dist/cache/TokenCache.mjs
generated
vendored
Normal file
207
node_modules/@azure/msal-browser/dist/cache/TokenCache.mjs
generated
vendored
Normal file
@@ -0,0 +1,207 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { AuthToken, Authority, AccountEntity, buildAccountToCache, CacheHelpers, ScopeSet } from '@azure/msal-common/browser';
|
||||
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
||||
import { base64Decode } from '../encode/Base64Decode.mjs';
|
||||
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
|
||||
import { nonBrowserEnvironment, unableToLoadToken } from '../error/BrowserAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Token cache manager
|
||||
*/
|
||||
class TokenCache {
|
||||
constructor(configuration, storage, logger, cryptoObj) {
|
||||
this.isBrowserEnvironment = typeof window !== "undefined";
|
||||
this.config = configuration;
|
||||
this.storage = storage;
|
||||
this.logger = logger;
|
||||
this.cryptoObj = cryptoObj;
|
||||
}
|
||||
// Move getAllAccounts here and cache utility APIs
|
||||
/**
|
||||
* API to load tokens to msal-browser cache.
|
||||
* @param request
|
||||
* @param response
|
||||
* @param options
|
||||
* @returns `AuthenticationResult` for the response that was loaded.
|
||||
*/
|
||||
async loadExternalTokens(request, response, options) {
|
||||
if (!this.isBrowserEnvironment) {
|
||||
throw createBrowserAuthError(nonBrowserEnvironment);
|
||||
}
|
||||
const correlationId = request.correlationId || createNewGuid();
|
||||
const idTokenClaims = response.id_token
|
||||
? AuthToken.extractTokenClaims(response.id_token, base64Decode)
|
||||
: undefined;
|
||||
const authorityOptions = {
|
||||
protocolMode: this.config.auth.protocolMode,
|
||||
knownAuthorities: this.config.auth.knownAuthorities,
|
||||
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
||||
authorityMetadata: this.config.auth.authorityMetadata,
|
||||
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
||||
};
|
||||
const authority = request.authority
|
||||
? new Authority(Authority.generateAuthority(request.authority, request.azureCloudOptions), this.config.system.networkClient, this.storage, authorityOptions, this.logger, request.correlationId || createNewGuid())
|
||||
: undefined;
|
||||
const cacheRecordAccount = await this.loadAccount(request, options.clientInfo || response.client_info || "", correlationId, idTokenClaims, authority);
|
||||
const idToken = await this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, correlationId);
|
||||
const accessToken = await this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options, correlationId);
|
||||
const refreshToken = await this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, correlationId);
|
||||
return this.generateAuthenticationResult(request, {
|
||||
account: cacheRecordAccount,
|
||||
idToken,
|
||||
accessToken,
|
||||
refreshToken,
|
||||
}, idTokenClaims, authority);
|
||||
}
|
||||
/**
|
||||
* Helper function to load account to msal-browser cache
|
||||
* @param idToken
|
||||
* @param environment
|
||||
* @param clientInfo
|
||||
* @param authorityType
|
||||
* @param requestHomeAccountId
|
||||
* @returns `AccountEntity`
|
||||
*/
|
||||
async loadAccount(request, clientInfo, correlationId, idTokenClaims, authority) {
|
||||
this.logger.verbose("TokenCache - loading account");
|
||||
if (request.account) {
|
||||
const accountEntity = AccountEntity.createFromAccountInfo(request.account);
|
||||
await this.storage.setAccount(accountEntity, correlationId);
|
||||
return accountEntity;
|
||||
}
|
||||
else if (!authority || (!clientInfo && !idTokenClaims)) {
|
||||
this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead.");
|
||||
throw createBrowserAuthError(unableToLoadToken);
|
||||
}
|
||||
const homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);
|
||||
const claimsTenantId = idTokenClaims?.tid;
|
||||
const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload
|
||||
undefined, // nativeAccountId
|
||||
this.logger);
|
||||
await this.storage.setAccount(cachedAccount, correlationId);
|
||||
return cachedAccount;
|
||||
}
|
||||
/**
|
||||
* Helper function to load id tokens to msal-browser cache
|
||||
* @param idToken
|
||||
* @param homeAccountId
|
||||
* @param environment
|
||||
* @param tenantId
|
||||
* @returns `IdTokenEntity`
|
||||
*/
|
||||
async loadIdToken(response, homeAccountId, environment, tenantId, correlationId) {
|
||||
if (!response.id_token) {
|
||||
this.logger.verbose("TokenCache - no id token found in response");
|
||||
return null;
|
||||
}
|
||||
this.logger.verbose("TokenCache - loading id token");
|
||||
const idTokenEntity = CacheHelpers.createIdTokenEntity(homeAccountId, environment, response.id_token, this.config.auth.clientId, tenantId);
|
||||
await this.storage.setIdTokenCredential(idTokenEntity, correlationId);
|
||||
return idTokenEntity;
|
||||
}
|
||||
/**
|
||||
* Helper function to load access tokens to msal-browser cache
|
||||
* @param request
|
||||
* @param response
|
||||
* @param homeAccountId
|
||||
* @param environment
|
||||
* @param tenantId
|
||||
* @returns `AccessTokenEntity`
|
||||
*/
|
||||
async loadAccessToken(request, response, homeAccountId, environment, tenantId, options, correlationId) {
|
||||
if (!response.access_token) {
|
||||
this.logger.verbose("TokenCache - no access token found in response");
|
||||
return null;
|
||||
}
|
||||
else if (!response.expires_in) {
|
||||
this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache.");
|
||||
return null;
|
||||
}
|
||||
else if (!response.scope &&
|
||||
(!request.scopes || !request.scopes.length)) {
|
||||
this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache.");
|
||||
return null;
|
||||
}
|
||||
this.logger.verbose("TokenCache - loading access token");
|
||||
const scopes = response.scope
|
||||
? ScopeSet.fromString(response.scope)
|
||||
: new ScopeSet(request.scopes);
|
||||
const expiresOn = options.expiresOn ||
|
||||
response.expires_in + new Date().getTime() / 1000;
|
||||
const extendedExpiresOn = options.extendedExpiresOn ||
|
||||
(response.ext_expires_in || response.expires_in) +
|
||||
new Date().getTime() / 1000;
|
||||
const accessTokenEntity = CacheHelpers.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes.printScopes(), expiresOn, extendedExpiresOn, base64Decode);
|
||||
await this.storage.setAccessTokenCredential(accessTokenEntity, correlationId);
|
||||
return accessTokenEntity;
|
||||
}
|
||||
/**
|
||||
* Helper function to load refresh tokens to msal-browser cache
|
||||
* @param request
|
||||
* @param response
|
||||
* @param homeAccountId
|
||||
* @param environment
|
||||
* @returns `RefreshTokenEntity`
|
||||
*/
|
||||
async loadRefreshToken(response, homeAccountId, environment, correlationId) {
|
||||
if (!response.refresh_token) {
|
||||
this.logger.verbose("TokenCache - no refresh token found in response");
|
||||
return null;
|
||||
}
|
||||
this.logger.verbose("TokenCache - loading refresh token");
|
||||
const refreshTokenEntity = CacheHelpers.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId, response.foci, undefined, // userAssertionHash
|
||||
response.refresh_token_expires_in);
|
||||
await this.storage.setRefreshTokenCredential(refreshTokenEntity, correlationId);
|
||||
return refreshTokenEntity;
|
||||
}
|
||||
/**
|
||||
* Helper function to generate an `AuthenticationResult` for the result.
|
||||
* @param request
|
||||
* @param idTokenObj
|
||||
* @param cacheRecord
|
||||
* @param authority
|
||||
* @returns `AuthenticationResult`
|
||||
*/
|
||||
generateAuthenticationResult(request, cacheRecord, idTokenClaims, authority) {
|
||||
let accessToken = "";
|
||||
let responseScopes = [];
|
||||
let expiresOn = null;
|
||||
let extExpiresOn;
|
||||
if (cacheRecord?.accessToken) {
|
||||
accessToken = cacheRecord.accessToken.secret;
|
||||
responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
|
||||
expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
|
||||
extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
|
||||
}
|
||||
const accountEntity = cacheRecord.account;
|
||||
return {
|
||||
authority: authority ? authority.canonicalAuthority : "",
|
||||
uniqueId: cacheRecord.account.localAccountId,
|
||||
tenantId: cacheRecord.account.realm,
|
||||
scopes: responseScopes,
|
||||
account: accountEntity.getAccountInfo(),
|
||||
idToken: cacheRecord.idToken?.secret || "",
|
||||
idTokenClaims: idTokenClaims || {},
|
||||
accessToken: accessToken,
|
||||
fromCache: true,
|
||||
expiresOn: expiresOn,
|
||||
correlationId: request.correlationId || "",
|
||||
requestId: "",
|
||||
extExpiresOn: extExpiresOn,
|
||||
familyId: cacheRecord.refreshToken?.familyId || "",
|
||||
tokenType: cacheRecord?.accessToken?.tokenType || "",
|
||||
state: request.state || "",
|
||||
cloudGraphHostName: accountEntity.cloudGraphHostName || "",
|
||||
msGraphHost: accountEntity.msGraphHost || "",
|
||||
fromNativeBroker: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export { TokenCache };
|
||||
//# sourceMappingURL=TokenCache.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/cache/TokenCache.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/cache/TokenCache.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
219
node_modules/@azure/msal-browser/dist/config/Configuration.d.ts
generated
vendored
Normal file
219
node_modules/@azure/msal-browser/dist/config/Configuration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,219 @@
|
||||
import { SystemOptions, LoggerOptions, INetworkModule, ProtocolMode, OIDCOptions, AzureCloudOptions, ApplicationTelemetry, IPerformanceClient } from "@azure/msal-common/browser";
|
||||
import { BrowserCacheLocation } from "../utils/BrowserConstants.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
export declare const DEFAULT_POPUP_TIMEOUT_MS = 60000;
|
||||
export declare const DEFAULT_IFRAME_TIMEOUT_MS = 10000;
|
||||
export declare const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;
|
||||
export declare const DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;
|
||||
/**
|
||||
* Use this to configure the auth options in the Configuration object
|
||||
*/
|
||||
export type BrowserAuthOptions = {
|
||||
/**
|
||||
* Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform
|
||||
*/
|
||||
clientId: string;
|
||||
/**
|
||||
* You can configure a specific authority, defaults to " " or "https://login.microsoftonline.com/common"
|
||||
*/
|
||||
authority?: string;
|
||||
/**
|
||||
* An array of URIs that are known to be valid. Used in B2C scenarios.
|
||||
*/
|
||||
knownAuthorities?: Array<string>;
|
||||
/**
|
||||
* A string containing the cloud discovery response. Used in AAD scenarios.
|
||||
*/
|
||||
cloudDiscoveryMetadata?: string;
|
||||
/**
|
||||
* A string containing the .well-known/openid-configuration endpoint response
|
||||
*/
|
||||
authorityMetadata?: string;
|
||||
/**
|
||||
* The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
|
||||
*/
|
||||
redirectUri?: string;
|
||||
/**
|
||||
* The redirect URI where the window navigates after a successful logout.
|
||||
*/
|
||||
postLogoutRedirectUri?: string | null;
|
||||
/**
|
||||
* Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.
|
||||
*/
|
||||
navigateToLoginRequestUrl?: boolean;
|
||||
/**
|
||||
* Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.
|
||||
*/
|
||||
clientCapabilities?: Array<string>;
|
||||
/**
|
||||
* Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
|
||||
*/
|
||||
protocolMode?: ProtocolMode;
|
||||
/**
|
||||
* Enum that configures options for the OIDC protocol mode.
|
||||
*/
|
||||
OIDCOptions?: OIDCOptions;
|
||||
/**
|
||||
* Enum that represents the Azure Cloud to use.
|
||||
*/
|
||||
azureCloudOptions?: AzureCloudOptions;
|
||||
/**
|
||||
* Flag of whether to use the local metadata cache
|
||||
*/
|
||||
skipAuthorityMetadataCache?: boolean;
|
||||
/**
|
||||
* App supports nested app auth or not; defaults to
|
||||
*
|
||||
* @deprecated This flag is deprecated and will be removed in the next major version. createNestablePublicClientApplication should be used instead.
|
||||
*/
|
||||
supportsNestedAppAuth?: boolean;
|
||||
/**
|
||||
* Callback that will be passed the url that MSAL will navigate to in redirect flows. Returning false in the callback will stop navigation.
|
||||
*/
|
||||
onRedirectNavigate?: (url: string) => boolean | void;
|
||||
/**
|
||||
* Flag of whether the STS will send back additional parameters to specify where the tokens should be retrieved from.
|
||||
*/
|
||||
instanceAware?: boolean;
|
||||
};
|
||||
/** @internal */
|
||||
export type InternalAuthOptions = Omit<Required<BrowserAuthOptions>, "onRedirectNavigate"> & {
|
||||
OIDCOptions: Required<OIDCOptions>;
|
||||
onRedirectNavigate?: (url: string) => boolean | void;
|
||||
};
|
||||
/**
|
||||
* Use this to configure the below cache configuration options:
|
||||
*/
|
||||
export type CacheOptions = {
|
||||
/**
|
||||
* Used to specify the cacheLocation user wants to set. Valid values are "localStorage", "sessionStorage" and "memoryStorage".
|
||||
*/
|
||||
cacheLocation?: BrowserCacheLocation | string;
|
||||
/**
|
||||
* Used to specify the temporaryCacheLocation user wants to set. Valid values are "localStorage", "sessionStorage" and "memoryStorage".
|
||||
*/
|
||||
temporaryCacheLocation?: BrowserCacheLocation | string;
|
||||
/**
|
||||
* If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.
|
||||
*/
|
||||
storeAuthStateInCookie?: boolean;
|
||||
/**
|
||||
* If set, MSAL sets the "Secure" flag on cookies so they can only be sent over HTTPS. By default this flag is set to true.
|
||||
* @deprecated This option will be removed in a future major version and all cookies set will include the Secure attribute.
|
||||
*/
|
||||
secureCookies?: boolean;
|
||||
/**
|
||||
* If set, MSAL will attempt to migrate cache entries from older versions on initialization. By default this flag is set to true if cacheLocation is localStorage, otherwise false.
|
||||
*/
|
||||
cacheMigrationEnabled?: boolean;
|
||||
/**
|
||||
* Flag that determines whether access tokens are stored based on requested claims
|
||||
*/
|
||||
claimsBasedCachingEnabled?: boolean;
|
||||
};
|
||||
export type BrowserSystemOptions = SystemOptions & {
|
||||
/**
|
||||
* Used to initialize the Logger object (See ClientConfiguration.ts)
|
||||
*/
|
||||
loggerOptions?: LoggerOptions;
|
||||
/**
|
||||
* Network interface implementation
|
||||
*/
|
||||
networkClient?: INetworkModule;
|
||||
/**
|
||||
* Override the methods used to navigate to other webpages. Particularly useful if you are using a client-side router
|
||||
*/
|
||||
navigationClient?: INavigationClient;
|
||||
/**
|
||||
* Sets the timeout for waiting for a response hash in a popup. Will take precedence over loadFrameTimeout if both are set.
|
||||
*/
|
||||
windowHashTimeout?: number;
|
||||
/**
|
||||
* Sets the timeout for waiting for a response hash in an iframe. Will take precedence over loadFrameTimeout if both are set.
|
||||
*/
|
||||
iframeHashTimeout?: number;
|
||||
/**
|
||||
* Sets the timeout for waiting for a response hash in an iframe or popup
|
||||
*/
|
||||
loadFrameTimeout?: number;
|
||||
/**
|
||||
* Maximum time the library should wait for a frame to load
|
||||
* @deprecated This was previously needed for older browsers which are no longer supported by MSAL.js. This option will be removed in the next major version
|
||||
*/
|
||||
navigateFrameWait?: number;
|
||||
/**
|
||||
* Time to wait for redirection to occur before resolving promise
|
||||
*/
|
||||
redirectNavigationTimeout?: number;
|
||||
/**
|
||||
* Sets whether popups are opened asynchronously. By default, this flag is set to false. When set to false, blank popups are opened before anything else happens. When set to true, popups are opened when making the network request.
|
||||
*/
|
||||
asyncPopups?: boolean;
|
||||
/**
|
||||
* Flag to enable redirect opertaions when the app is rendered in an iframe (to support scenarios such as embedded B2C login).
|
||||
*/
|
||||
allowRedirectInIframe?: boolean;
|
||||
/**
|
||||
* Flag to enable native broker support (e.g. acquiring tokens from WAM on Windows, MacBroker on Mac)
|
||||
*/
|
||||
allowPlatformBroker?: boolean;
|
||||
/**
|
||||
* Sets the timeout for waiting for the native broker handshake to resolve
|
||||
*/
|
||||
nativeBrokerHandshakeTimeout?: number;
|
||||
/**
|
||||
* Sets the interval length in milliseconds for polling the location attribute in popup windows (default is 30ms)
|
||||
*/
|
||||
pollIntervalMilliseconds?: number;
|
||||
};
|
||||
/**
|
||||
* Telemetry Options
|
||||
*/
|
||||
export type BrowserTelemetryOptions = {
|
||||
/**
|
||||
* Telemetry information sent on request
|
||||
* - appName: Unique string name of an application
|
||||
* - appVersion: Version of the application using MSAL
|
||||
*/
|
||||
application?: ApplicationTelemetry;
|
||||
client?: IPerformanceClient;
|
||||
};
|
||||
/**
|
||||
* This object allows you to configure important elements of MSAL functionality and is passed into the constructor of PublicClientApplication
|
||||
*/
|
||||
export type Configuration = {
|
||||
/**
|
||||
* This is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform
|
||||
*/
|
||||
auth: BrowserAuthOptions;
|
||||
/**
|
||||
* This is where you configure cache location and whether to store cache in cookies
|
||||
*/
|
||||
cache?: CacheOptions;
|
||||
/**
|
||||
* This is where you can configure the network client, logger, token renewal offset
|
||||
*/
|
||||
system?: BrowserSystemOptions;
|
||||
/**
|
||||
* This is where you can configure telemetry data and options
|
||||
*/
|
||||
telemetry?: BrowserTelemetryOptions;
|
||||
};
|
||||
/** @internal */
|
||||
export type BrowserConfiguration = {
|
||||
auth: InternalAuthOptions;
|
||||
cache: Required<CacheOptions>;
|
||||
system: Required<BrowserSystemOptions>;
|
||||
telemetry: Required<BrowserTelemetryOptions>;
|
||||
};
|
||||
/**
|
||||
* MSAL function that sets the default options when not explicitly configured from app developer
|
||||
*
|
||||
* @param auth
|
||||
* @param cache
|
||||
* @param system
|
||||
*
|
||||
* @returns Configuration object
|
||||
*/
|
||||
export declare function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry, }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration;
|
||||
//# sourceMappingURL=Configuration.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/config/Configuration.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/config/Configuration.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/config/Configuration.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,aAAa,EACb,cAAc,EAGd,YAAY,EACZ,WAAW,EAKX,iBAAiB,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C;IAChC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAEnC,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,GAAG;IAC/B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC9B,MAAM,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACvC,SAAS,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;CAChD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,EACI,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,kBAAkB,GAChC,EAAE,aAAa,EAChB,oBAAoB,EAAE,OAAO,GAC9B,oBAAoB,CAwItB"}
|
||||
140
node_modules/@azure/msal-browser/dist/config/Configuration.mjs
generated
vendored
Normal file
140
node_modules/@azure/msal-browser/dist/config/Configuration.mjs
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { Constants, ProtocolMode, ServerResponseType, AzureCloudInstance, StubPerformanceClient, Logger, createClientConfigurationError, ClientConfigurationErrorCodes, LogLevel, DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule } from '@azure/msal-common/browser';
|
||||
import { BrowserCacheLocation, BrowserConstants } from '../utils/BrowserConstants.mjs';
|
||||
import { NavigationClient } from '../navigation/NavigationClient.mjs';
|
||||
import { FetchClient } from '../network/FetchClient.mjs';
|
||||
import { getCurrentUri } from '../utils/BrowserUtils.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
// Default timeout for popup windows and iframes in milliseconds
|
||||
const DEFAULT_POPUP_TIMEOUT_MS = 60000;
|
||||
const DEFAULT_IFRAME_TIMEOUT_MS = 10000;
|
||||
const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;
|
||||
const DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;
|
||||
/**
|
||||
* MSAL function that sets the default options when not explicitly configured from app developer
|
||||
*
|
||||
* @param auth
|
||||
* @param cache
|
||||
* @param system
|
||||
*
|
||||
* @returns Configuration object
|
||||
*/
|
||||
function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry, }, isBrowserEnvironment) {
|
||||
// Default auth options for browser
|
||||
const DEFAULT_AUTH_OPTIONS = {
|
||||
clientId: Constants.EMPTY_STRING,
|
||||
authority: `${Constants.DEFAULT_AUTHORITY}`,
|
||||
knownAuthorities: [],
|
||||
cloudDiscoveryMetadata: Constants.EMPTY_STRING,
|
||||
authorityMetadata: Constants.EMPTY_STRING,
|
||||
redirectUri: typeof window !== "undefined" ? getCurrentUri() : "",
|
||||
postLogoutRedirectUri: Constants.EMPTY_STRING,
|
||||
navigateToLoginRequestUrl: true,
|
||||
clientCapabilities: [],
|
||||
protocolMode: ProtocolMode.AAD,
|
||||
OIDCOptions: {
|
||||
serverResponseType: ServerResponseType.FRAGMENT,
|
||||
defaultScopes: [
|
||||
Constants.OPENID_SCOPE,
|
||||
Constants.PROFILE_SCOPE,
|
||||
Constants.OFFLINE_ACCESS_SCOPE,
|
||||
],
|
||||
},
|
||||
azureCloudOptions: {
|
||||
azureCloudInstance: AzureCloudInstance.None,
|
||||
tenant: Constants.EMPTY_STRING,
|
||||
},
|
||||
skipAuthorityMetadataCache: false,
|
||||
supportsNestedAppAuth: false,
|
||||
instanceAware: false,
|
||||
};
|
||||
// Default cache options for browser
|
||||
const DEFAULT_CACHE_OPTIONS = {
|
||||
cacheLocation: BrowserCacheLocation.SessionStorage,
|
||||
temporaryCacheLocation: BrowserCacheLocation.SessionStorage,
|
||||
storeAuthStateInCookie: false,
|
||||
secureCookies: false,
|
||||
// Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage
|
||||
cacheMigrationEnabled: userInputCache &&
|
||||
userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage
|
||||
? true
|
||||
: false,
|
||||
claimsBasedCachingEnabled: false,
|
||||
};
|
||||
// Default logger options for browser
|
||||
const DEFAULT_LOGGER_OPTIONS = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
loggerCallback: () => {
|
||||
// allow users to not set logger call back
|
||||
},
|
||||
logLevel: LogLevel.Info,
|
||||
piiLoggingEnabled: false,
|
||||
};
|
||||
// Default system options for browser
|
||||
const DEFAULT_BROWSER_SYSTEM_OPTIONS = {
|
||||
...DEFAULT_SYSTEM_OPTIONS,
|
||||
loggerOptions: DEFAULT_LOGGER_OPTIONS,
|
||||
networkClient: isBrowserEnvironment
|
||||
? new FetchClient()
|
||||
: StubbedNetworkModule,
|
||||
navigationClient: new NavigationClient(),
|
||||
loadFrameTimeout: 0,
|
||||
// If loadFrameTimeout is provided, use that as default.
|
||||
windowHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_POPUP_TIMEOUT_MS,
|
||||
iframeHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_IFRAME_TIMEOUT_MS,
|
||||
navigateFrameWait: 0,
|
||||
redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,
|
||||
asyncPopups: false,
|
||||
allowRedirectInIframe: false,
|
||||
allowPlatformBroker: false,
|
||||
nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||
|
||||
DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
|
||||
pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,
|
||||
};
|
||||
const providedSystemOptions = {
|
||||
...DEFAULT_BROWSER_SYSTEM_OPTIONS,
|
||||
...userInputSystem,
|
||||
loggerOptions: userInputSystem?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
|
||||
};
|
||||
const DEFAULT_TELEMETRY_OPTIONS = {
|
||||
application: {
|
||||
appName: Constants.EMPTY_STRING,
|
||||
appVersion: Constants.EMPTY_STRING,
|
||||
},
|
||||
client: new StubPerformanceClient(),
|
||||
};
|
||||
// Throw an error if user has set OIDCOptions without being in OIDC protocol mode
|
||||
if (userInputAuth?.protocolMode !== ProtocolMode.OIDC &&
|
||||
userInputAuth?.OIDCOptions) {
|
||||
const logger = new Logger(providedSystemOptions.loggerOptions);
|
||||
logger.warning(JSON.stringify(createClientConfigurationError(ClientConfigurationErrorCodes.cannotSetOIDCOptions)));
|
||||
}
|
||||
// Throw an error if user has set allowPlatformBroker to true without being in AAD protocol mode
|
||||
if (userInputAuth?.protocolMode &&
|
||||
userInputAuth.protocolMode !== ProtocolMode.AAD &&
|
||||
providedSystemOptions?.allowPlatformBroker) {
|
||||
throw createClientConfigurationError(ClientConfigurationErrorCodes.cannotAllowPlatformBroker);
|
||||
}
|
||||
const overlayedConfig = {
|
||||
auth: {
|
||||
...DEFAULT_AUTH_OPTIONS,
|
||||
...userInputAuth,
|
||||
OIDCOptions: {
|
||||
...DEFAULT_AUTH_OPTIONS.OIDCOptions,
|
||||
...userInputAuth?.OIDCOptions,
|
||||
},
|
||||
},
|
||||
cache: { ...DEFAULT_CACHE_OPTIONS, ...userInputCache },
|
||||
system: providedSystemOptions,
|
||||
telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry },
|
||||
};
|
||||
return overlayedConfig;
|
||||
}
|
||||
|
||||
export { DEFAULT_IFRAME_TIMEOUT_MS, DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, DEFAULT_POPUP_TIMEOUT_MS, DEFAULT_REDIRECT_TIMEOUT_MS, buildConfiguration };
|
||||
//# sourceMappingURL=Configuration.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/config/Configuration.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/config/Configuration.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Configuration.mjs","sources":["../../src/config/Configuration.ts"],"sourcesContent":[null],"names":["BrowserUtils.getCurrentUri"],"mappings":";;;;;;;;AAAA;;;AAGG;AA+BH;AACO,MAAM,wBAAwB,GAAG,MAAM;AACvC,MAAM,yBAAyB,GAAG,MAAM;AACxC,MAAM,2BAA2B,GAAG,MAAM;AAC1C,MAAM,0CAA0C,GAAG,KAAK;AAsN/D;;;;;;;;AAQG;AACG,SAAU,kBAAkB,CAC9B,EACI,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,eAAe,EACvB,SAAS,EAAE,kBAAkB,GACjB,EAChB,oBAA6B,EAAA;;AAG7B,IAAA,MAAM,oBAAoB,GAAwB;QAC9C,QAAQ,EAAE,SAAS,CAAC,YAAY;AAChC,QAAA,SAAS,EAAE,CAAA,EAAG,SAAS,CAAC,iBAAiB,CAAE,CAAA;AAC3C,QAAA,gBAAgB,EAAE,EAAE;QACpB,sBAAsB,EAAE,SAAS,CAAC,YAAY;QAC9C,iBAAiB,EAAE,SAAS,CAAC,YAAY;AACzC,QAAA,WAAW,EACP,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A,aAAa,CAAC,YAAY,KAAK,YAAY,CAAC,GAAG;QAC/C,qBAAqB,EAAE,mBAAmB,EAC5C;AACE,QAAA,MAAM,8BAA8B,CAChC,6BAA6B,CAAC,yBAAyB,CAC1D,CAAC;AACL,KAAA;AAED,IAAA,MAAM,eAAe,GAAyB;AAC1C,QAAA,IAAI,EAAE;AACF,YAAA,GAAG,oBAAoB;AACvB,YAAA,GAAG,aAAa;AAChB,YAAA,WAAW,EAAE;gBACT,GAAG,oBAAoB,CAAC,WAAW;gBACnC,GAAG,aAAa,EAAE,WAAW;AAChC,aAAA;AACJ,SAAA;AACD,QAAA,KAAK,EAAE,EAAE,GAAG,qBAAqB,EAAE,GAAG,cAAc,EAAE;AACtD,QAAA,MAAM,EAAE,qBAAqB;AAC7B,QAAA,SAAS,EAAE,EAAE,GAAG,yBAAyB,EAAE,GAAG,kBAAkB,EAAE;KACrE,CAAC;AAEF,IAAA,OAAO,eAAe,CAAC;AAC3B;;;;"}
|
||||
6
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts
generated
vendored
Normal file
6
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { IController } from "./IController.js";
|
||||
import { Configuration } from "../config/Configuration.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
export declare function createV3Controller(config: Configuration, request?: InitializeApplicationRequest): Promise<IController>;
|
||||
export declare function createController(config: Configuration): Promise<IController | null>;
|
||||
//# sourceMappingURL=ControllerFactory.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ControllerFactory.d.ts","sourceRoot":"","sources":["../../src/controllers/ControllerFactory.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAE1F,wBAAsB,kBAAkB,CACpC,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,4BAA4B,GACvC,OAAO,CAAC,WAAW,CAAC,CAKtB;AAED,wBAAsB,gBAAgB,CAClC,MAAM,EAAE,aAAa,GACtB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAgB7B"}
|
||||
35
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs
generated
vendored
Normal file
35
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { NestedAppOperatingContext } from '../operatingcontext/NestedAppOperatingContext.mjs';
|
||||
import { StandardOperatingContext } from '../operatingcontext/StandardOperatingContext.mjs';
|
||||
import { StandardController } from './StandardController.mjs';
|
||||
import { NestedAppAuthController } from './NestedAppAuthController.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
async function createV3Controller(config, request) {
|
||||
const standard = new StandardOperatingContext(config);
|
||||
await standard.initialize();
|
||||
return StandardController.createController(standard, request);
|
||||
}
|
||||
async function createController(config) {
|
||||
const standard = new StandardOperatingContext(config);
|
||||
const nestedApp = new NestedAppOperatingContext(config);
|
||||
const operatingContexts = [standard.initialize(), nestedApp.initialize()];
|
||||
await Promise.all(operatingContexts);
|
||||
if (nestedApp.isAvailable() && config.auth.supportsNestedAppAuth) {
|
||||
return NestedAppAuthController.createController(nestedApp);
|
||||
}
|
||||
else if (standard.isAvailable()) {
|
||||
return StandardController.createController(standard);
|
||||
}
|
||||
else {
|
||||
// Since neither of the actual operating contexts are available keep the UnknownOperatingContextController
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { createController, createV3Controller };
|
||||
//# sourceMappingURL=ControllerFactory.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/ControllerFactory.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ControllerFactory.mjs","sources":["../../src/controllers/ControllerFactory.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAUI,eAAe,kBAAkB,CACpC,MAAqB,EACrB,OAAsC,EAAA;AAEtC,IAAA,MAAM,QAAQ,GAAG,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;AAEtD,IAAA,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC5B,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC;AAEM,eAAe,gBAAgB,CAClC,MAAqB,EAAA;AAErB,IAAA,MAAM,QAAQ,GAAG,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;AACtD,IAAA,MAAM,SAAS,GAAG,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAC;AAExD,IAAA,MAAM,iBAAiB,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;AAE1E,IAAA,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAErC,IAAI,SAAS,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;AAC9D,QAAA,OAAO,uBAAuB,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAC9D,KAAA;AAAM,SAAA,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE;AAC/B,QAAA,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACxD,KAAA;AAAM,SAAA;;AAEH,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AACL;;;;"}
|
||||
59
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts
generated
vendored
Normal file
59
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { AccountInfo, Logger, PerformanceCallbackFunction, IPerformanceClient, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { ApiId, WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
export interface IController {
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenNative(request: PopupRequest | SilentRequest | SsoSilentRequest, apiId: ApiId, accountId?: string): Promise<AuthenticationResult>;
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
removeEventCallback(callbackId: string): void;
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
enableAccountStorageEvents(): void;
|
||||
disableAccountStorageEvents(): void;
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
getAccountByLocalId(localId: string): AccountInfo | null;
|
||||
getAccountByUsername(userName: string): AccountInfo | null;
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;
|
||||
loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;
|
||||
loginRedirect(request?: RedirectRequest): Promise<void>;
|
||||
logout(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
||||
getTokenCache(): ITokenCache;
|
||||
getLogger(): Logger;
|
||||
setLogger(logger: Logger): void;
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
/** @internal */
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
/** @internal */
|
||||
isBrowserEnv(): boolean;
|
||||
/** @internal */
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
}
|
||||
//# sourceMappingURL=IController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/IController.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IController.d.ts","sourceRoot":"","sources":["../../src/controllers/IController.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,WAAW,EACX,MAAM,EACN,2BAA2B,EAC3B,kBAAkB,EAClB,aAAa,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,WAAW;IAExB,UAAU,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,OAA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OAAO,CAAC;IAExB,gBAAgB;IAChB,oBAAoB,IAAI,kBAAkB,CAAC;CAC9C"}
|
||||
203
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts
generated
vendored
Normal file
203
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
import { CommonAuthorizationUrlRequest, CommonSilentFlowRequest, PerformanceCallbackFunction, AccountInfo, Logger, ICrypto, IPerformanceClient, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { ApiId, WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { IController } from "./IController.js";
|
||||
import { NestedAppOperatingContext } from "../operatingcontext/NestedAppOperatingContext.js";
|
||||
import { IBridgeProxy } from "../naa/IBridgeProxy.js";
|
||||
import { NestedAppAuthAdapter } from "../naa/mapping/NestedAppAuthAdapter.js";
|
||||
import { EventHandler } from "../event/EventHandler.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { AccountContext } from "../naa/BridgeAccountContext.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
export declare class NestedAppAuthController implements IController {
|
||||
protected readonly operatingContext: NestedAppOperatingContext;
|
||||
protected readonly bridgeProxy: IBridgeProxy;
|
||||
protected readonly browserCrypto: ICrypto;
|
||||
protected readonly config: BrowserConfiguration;
|
||||
protected readonly browserStorage: BrowserCacheManager;
|
||||
protected logger: Logger;
|
||||
protected readonly performanceClient: IPerformanceClient;
|
||||
protected readonly eventHandler: EventHandler;
|
||||
protected readonly nestedAppAuthAdapter: NestedAppAuthAdapter;
|
||||
protected currentAccountContext: AccountContext | null;
|
||||
constructor(operatingContext: NestedAppOperatingContext);
|
||||
/**
|
||||
* Factory function to create a new instance of NestedAppAuthController
|
||||
* @param operatingContext
|
||||
* @returns Promise<IController>
|
||||
*/
|
||||
static createController(operatingContext: NestedAppOperatingContext): Promise<IController>;
|
||||
/**
|
||||
* Specific implementation of initialize function for NestedAppAuthController
|
||||
* @returns
|
||||
*/
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
/**
|
||||
* Validate the incoming request and add correlationId if not present
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private ensureValidRequest;
|
||||
/**
|
||||
* Internal implementation of acquireTokenInteractive flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenInteractive;
|
||||
/**
|
||||
* Internal implementation of acquireTokenSilent flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenSilentInternal;
|
||||
/**
|
||||
* acquires tokens from cache
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenFromCache;
|
||||
/**
|
||||
*
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenFromCacheInternal;
|
||||
/**
|
||||
* acquireTokenPopup flow implementation
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* acquireTokenRedirect flow is not supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* acquireTokenSilent flow implementation
|
||||
* @param silentRequest
|
||||
* @returns
|
||||
*/
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Hybrid flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* acquireTokenNative flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
* @param apiId
|
||||
* @param accountId
|
||||
*/
|
||||
acquireTokenNative(request: SilentRequest | Partial<Omit<CommonAuthorizationUrlRequest, "requestedClaimsHash" | "responseMode" | "codeChallenge" | "codeChallengeMethod" | "platformBroker">> | PopupRequest, apiId: ApiId, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
accountId?: string | undefined): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* acquireTokenByRefreshToken flow is not currently supported in nested app auth
|
||||
* @param commonRequest
|
||||
* @param silentRequest
|
||||
*/
|
||||
acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
* @param eventTypes
|
||||
*/
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId: string): void;
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
enableAccountStorageEvents(): void;
|
||||
disableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByUsername(username: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByLocalId(localAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
handleRedirectPromise(hash?: string | undefined): Promise<AuthenticationResult | null>;
|
||||
loginPopup(request?: PopupRequest | undefined): Promise<AuthenticationResult>;
|
||||
loginRedirect(request?: RedirectRequest | undefined): Promise<void>;
|
||||
logout(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest | undefined): Promise<void>;
|
||||
ssoSilent(request: Partial<Omit<CommonAuthorizationUrlRequest, "requestedClaimsHash" | "responseMode" | "codeChallenge" | "codeChallengeMethod" | "platformBroker">>): Promise<AuthenticationResult>;
|
||||
getTokenCache(): ITokenCache;
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger(): Logger;
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger: Logger): void;
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
isBrowserEnv(): boolean;
|
||||
getBrowserCrypto(): ICrypto;
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
getRedirectResponse(): Map<string, Promise<AuthenticationResult | null>>;
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=NestedAppAuthController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"NestedAppAuthController.d.ts","sourceRoot":"","sources":["../../src/controllers/NestedAppAuthController.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,MAAM,EACN,OAAO,EACP,kBAAkB,EAQlB,aAAa,EAEhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CA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KlE,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,YAAY,CACd,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;CAcnB"}
|
||||
516
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs
generated
vendored
Normal file
516
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs
generated
vendored
Normal file
@@ -0,0 +1,516 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { DEFAULT_CRYPTO_IMPLEMENTATION, buildStaticAuthorityOptions, PerformanceEvents, TimeUtils, AuthError, OIDC_DEFAULT_SCOPES, AccountEntity } from '@azure/msal-common/browser';
|
||||
import { InteractionType, CacheLookupPolicy, DEFAULT_REQUEST } from '../utils/BrowserConstants.mjs';
|
||||
import { CryptoOps } from '../crypto/CryptoOps.mjs';
|
||||
import { NestedAppAuthAdapter } from '../naa/mapping/NestedAppAuthAdapter.mjs';
|
||||
import { NestedAppAuthError } from '../error/NestedAppAuthError.mjs';
|
||||
import { EventHandler } from '../event/EventHandler.mjs';
|
||||
import { EventType } from '../event/EventType.mjs';
|
||||
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.mjs';
|
||||
import { getAccount, getAllAccounts, getAccountByUsername, getAccountByHomeId, getAccountByLocalId, setActiveAccount, getActiveAccount } from '../cache/AccountManager.mjs';
|
||||
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
class NestedAppAuthController {
|
||||
constructor(operatingContext) {
|
||||
this.operatingContext = operatingContext;
|
||||
const proxy = this.operatingContext.getBridgeProxy();
|
||||
if (proxy !== undefined) {
|
||||
this.bridgeProxy = proxy;
|
||||
}
|
||||
else {
|
||||
throw new Error("unexpected: bridgeProxy is undefined");
|
||||
}
|
||||
// Set the configuration.
|
||||
this.config = operatingContext.getConfig();
|
||||
// Initialize logger
|
||||
this.logger = this.operatingContext.getLogger();
|
||||
// Initialize performance client
|
||||
this.performanceClient = this.config.telemetry.client;
|
||||
// Initialize the crypto class.
|
||||
this.browserCrypto = operatingContext.isBrowserEnvironment()
|
||||
? new CryptoOps(this.logger, this.performanceClient, true)
|
||||
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
||||
this.eventHandler = new EventHandler(this.logger);
|
||||
// Initialize the browser storage class.
|
||||
this.browserStorage = this.operatingContext.isBrowserEnvironment()
|
||||
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth))
|
||||
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
||||
this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
|
||||
// Set the active account if available
|
||||
const accountContext = this.bridgeProxy.getAccountContext();
|
||||
this.currentAccountContext = accountContext ? accountContext : null;
|
||||
}
|
||||
/**
|
||||
* Factory function to create a new instance of NestedAppAuthController
|
||||
* @param operatingContext
|
||||
* @returns Promise<IController>
|
||||
*/
|
||||
static async createController(operatingContext) {
|
||||
const controller = new NestedAppAuthController(operatingContext);
|
||||
return Promise.resolve(controller);
|
||||
}
|
||||
/**
|
||||
* Specific implementation of initialize function for NestedAppAuthController
|
||||
* @returns
|
||||
*/
|
||||
async initialize(request) {
|
||||
const initCorrelationId = request?.correlationId || createNewGuid();
|
||||
await this.browserStorage.initialize(initCorrelationId);
|
||||
return Promise.resolve();
|
||||
}
|
||||
/**
|
||||
* Validate the incoming request and add correlationId if not present
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
ensureValidRequest(request) {
|
||||
if (request?.correlationId) {
|
||||
return request;
|
||||
}
|
||||
return {
|
||||
...request,
|
||||
correlationId: this.browserCrypto.createNewGuid(),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Internal implementation of acquireTokenInteractive flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenInteractive(request) {
|
||||
const validRequest = this.ensureValidRequest(request);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, validRequest);
|
||||
const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, validRequest.correlationId);
|
||||
atPopupMeasurement?.add({ nestedAppAuthRequest: true });
|
||||
try {
|
||||
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
|
||||
const reqTimestamp = TimeUtils.nowSeconds();
|
||||
const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
|
||||
const result = {
|
||||
...this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp),
|
||||
};
|
||||
// cache the tokens in the response
|
||||
await this.hydrateCache(result, request);
|
||||
// cache the account context in memory after successful token fetch
|
||||
this.currentAccountContext = {
|
||||
homeAccountId: result.account.homeAccountId,
|
||||
environment: result.account.environment,
|
||||
tenantId: result.account.tenantId,
|
||||
};
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);
|
||||
atPopupMeasurement.add({
|
||||
accessTokenSize: result.accessToken.length,
|
||||
idTokenSize: result.idToken.length,
|
||||
});
|
||||
atPopupMeasurement.end({
|
||||
success: true,
|
||||
requestId: result.requestId,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
catch (e) {
|
||||
const error = e instanceof AuthError
|
||||
? e
|
||||
: this.nestedAppAuthAdapter.fromBridgeError(e);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);
|
||||
atPopupMeasurement.end({
|
||||
success: false,
|
||||
}, e);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Internal implementation of acquireTokenSilent flow
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenSilentInternal(request) {
|
||||
const validRequest = this.ensureValidRequest(request);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, validRequest);
|
||||
// Look for tokens in the cache first
|
||||
const result = await this.acquireTokenFromCache(validRequest);
|
||||
if (result) {
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, result);
|
||||
return result;
|
||||
}
|
||||
// proceed with acquiring tokens via the host
|
||||
const ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, validRequest.correlationId);
|
||||
ssoSilentMeasurement?.increment({
|
||||
visibilityChangeCount: 0,
|
||||
});
|
||||
ssoSilentMeasurement?.add({
|
||||
nestedAppAuthRequest: true,
|
||||
});
|
||||
try {
|
||||
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
|
||||
const reqTimestamp = TimeUtils.nowSeconds();
|
||||
const response = await this.bridgeProxy.getTokenSilent(naaRequest);
|
||||
const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
|
||||
// cache the tokens in the response
|
||||
await this.hydrateCache(result, request);
|
||||
// cache the account context in memory after successful token fetch
|
||||
this.currentAccountContext = {
|
||||
homeAccountId: result.account.homeAccountId,
|
||||
environment: result.account.environment,
|
||||
tenantId: result.account.tenantId,
|
||||
};
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, result);
|
||||
ssoSilentMeasurement?.add({
|
||||
accessTokenSize: result.accessToken.length,
|
||||
idTokenSize: result.idToken.length,
|
||||
});
|
||||
ssoSilentMeasurement?.end({
|
||||
success: true,
|
||||
requestId: result.requestId,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
catch (e) {
|
||||
const error = e instanceof AuthError
|
||||
? e
|
||||
: this.nestedAppAuthAdapter.fromBridgeError(e);
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, e);
|
||||
ssoSilentMeasurement?.end({
|
||||
success: false,
|
||||
}, e);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* acquires tokens from cache
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenFromCache(request) {
|
||||
const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, request.correlationId);
|
||||
atsMeasurement?.add({
|
||||
nestedAppAuthRequest: true,
|
||||
});
|
||||
// if the request has claims, we cannot look up in the cache
|
||||
if (request.claims) {
|
||||
this.logger.verbose("Claims are present in the request, skipping cache lookup");
|
||||
return null;
|
||||
}
|
||||
// if the request has forceRefresh, we cannot look up in the cache
|
||||
if (request.forceRefresh) {
|
||||
this.logger.verbose("forceRefresh is set to true, skipping cache lookup");
|
||||
return null;
|
||||
}
|
||||
// respect cache lookup policy
|
||||
let result = null;
|
||||
if (!request.cacheLookupPolicy) {
|
||||
request.cacheLookupPolicy = CacheLookupPolicy.Default;
|
||||
}
|
||||
switch (request.cacheLookupPolicy) {
|
||||
case CacheLookupPolicy.Default:
|
||||
case CacheLookupPolicy.AccessToken:
|
||||
case CacheLookupPolicy.AccessTokenAndRefreshToken:
|
||||
result = await this.acquireTokenFromCacheInternal(request);
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
if (result) {
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, result);
|
||||
atsMeasurement?.add({
|
||||
accessTokenSize: result?.accessToken.length,
|
||||
idTokenSize: result?.idToken.length,
|
||||
});
|
||||
atsMeasurement?.end({
|
||||
success: true,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
this.logger.error("Cached tokens are not found for the account, proceeding with silent token request.");
|
||||
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null);
|
||||
atsMeasurement?.end({
|
||||
success: false,
|
||||
});
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenFromCacheInternal(request) {
|
||||
// always prioritize the account context from the bridge
|
||||
const accountContext = this.bridgeProxy.getAccountContext() || this.currentAccountContext;
|
||||
let currentAccount = null;
|
||||
if (accountContext) {
|
||||
currentAccount = getAccount(accountContext, this.logger, this.browserStorage);
|
||||
}
|
||||
// fall back to brokering if no cached account is found
|
||||
if (!currentAccount) {
|
||||
this.logger.verbose("No active account found, falling back to the host");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
this.logger.verbose("active account found, attempting to acquire token silently");
|
||||
const authRequest = {
|
||||
...request,
|
||||
correlationId: request.correlationId || this.browserCrypto.createNewGuid(),
|
||||
authority: request.authority || currentAccount.environment,
|
||||
scopes: request.scopes?.length
|
||||
? request.scopes
|
||||
: [...OIDC_DEFAULT_SCOPES],
|
||||
};
|
||||
// fetch access token and check for expiry
|
||||
const tokenKeys = this.browserStorage.getTokenKeys();
|
||||
const cachedAccessToken = this.browserStorage.getAccessToken(currentAccount, authRequest, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);
|
||||
// If there is no access token, log it and return null
|
||||
if (!cachedAccessToken) {
|
||||
this.logger.verbose("No cached access token found");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
else if (TimeUtils.wasClockTurnedBack(cachedAccessToken.cachedAt) ||
|
||||
TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.system.tokenRenewalOffsetSeconds)) {
|
||||
this.logger.verbose("Cached access token has expired");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
const cachedIdToken = this.browserStorage.getIdToken(currentAccount, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);
|
||||
if (!cachedIdToken) {
|
||||
this.logger.verbose("No cached id token found");
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
return this.nestedAppAuthAdapter.toAuthenticationResultFromCache(currentAccount, cachedIdToken, cachedAccessToken, authRequest, authRequest.correlationId);
|
||||
}
|
||||
/**
|
||||
* acquireTokenPopup flow implementation
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenPopup(request) {
|
||||
return this.acquireTokenInteractive(request);
|
||||
}
|
||||
/**
|
||||
* acquireTokenRedirect flow is not supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenRedirect(request) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* acquireTokenSilent flow implementation
|
||||
* @param silentRequest
|
||||
* @returns
|
||||
*/
|
||||
async acquireTokenSilent(silentRequest) {
|
||||
return this.acquireTokenSilentInternal(silentRequest);
|
||||
}
|
||||
/**
|
||||
* Hybrid flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenByCode(request // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* acquireTokenNative flow is not currently supported in nested app auth
|
||||
* @param request
|
||||
* @param apiId
|
||||
* @param accountId
|
||||
*/
|
||||
acquireTokenNative(request, apiId, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
accountId // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* acquireTokenByRefreshToken flow is not currently supported in nested app auth
|
||||
* @param commonRequest
|
||||
* @param silentRequest
|
||||
*/
|
||||
acquireTokenByRefreshToken(commonRequest, // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
silentRequest // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
* @param eventTypes
|
||||
*/
|
||||
addEventCallback(callback, eventTypes) {
|
||||
return this.eventHandler.addEventCallback(callback, eventTypes);
|
||||
}
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId) {
|
||||
this.eventHandler.removeEventCallback(callbackId);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
addPerformanceCallback(callback) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
removePerformanceCallback(callbackId) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
enableAccountStorageEvents() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
disableAccountStorageEvents() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// #region Account APIs
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter) {
|
||||
return getAllAccounts(this.logger, this.browserStorage, this.isBrowserEnv(), accountFilter);
|
||||
}
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter) {
|
||||
return getAccount(accountFilter, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByUsername(username) {
|
||||
return getAccountByUsername(username, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId) {
|
||||
return getAccountByHomeId(homeAccountId, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByLocalId(localAccountId) {
|
||||
return getAccountByLocalId(localAccountId, this.logger, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account) {
|
||||
/*
|
||||
* StandardController uses this to allow the developer to set the active account
|
||||
* in the nested app auth scenario the active account is controlled by the app hosting the nested app
|
||||
*/
|
||||
return setActiveAccount(account, this.browserStorage);
|
||||
}
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount() {
|
||||
return getActiveAccount(this.browserStorage);
|
||||
}
|
||||
// #endregion
|
||||
handleRedirectPromise(hash // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
loginPopup(request // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
return this.acquireTokenInteractive(request || DEFAULT_REQUEST);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
loginRedirect(request) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logout(logoutRequest) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
logoutRedirect(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
logoutPopup(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars
|
||||
) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
ssoSilent(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
return this.acquireTokenSilentInternal(request);
|
||||
}
|
||||
getTokenCache() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger() {
|
||||
return this.logger;
|
||||
}
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
initializeWrapperLibrary(sku, version) {
|
||||
/*
|
||||
* Standard controller uses this to set the sku and version of the wrapper library in the storage
|
||||
* we do nothing here
|
||||
*/
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setNavigationClient(navigationClient) {
|
||||
this.logger.warning("setNavigationClient is not supported in nested app auth");
|
||||
}
|
||||
getConfiguration() {
|
||||
return this.config;
|
||||
}
|
||||
isBrowserEnv() {
|
||||
return this.operatingContext.isBrowserEnvironment();
|
||||
}
|
||||
getBrowserCrypto() {
|
||||
return this.browserCrypto;
|
||||
}
|
||||
getPerformanceClient() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
getRedirectResponse() {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async clearCache(logoutRequest) {
|
||||
throw NestedAppAuthError.createUnsupportedError();
|
||||
}
|
||||
async hydrateCache(result, request) {
|
||||
this.logger.verbose("hydrateCache called");
|
||||
const accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
|
||||
await this.browserStorage.setAccount(accountEntity, result.correlationId);
|
||||
return this.browserStorage.hydrateCache(result, request);
|
||||
}
|
||||
}
|
||||
|
||||
export { NestedAppAuthController };
|
||||
//# sourceMappingURL=NestedAppAuthController.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/NestedAppAuthController.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
405
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts
generated
vendored
Normal file
405
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,405 @@
|
||||
import { AccountInfo, INetworkModule, Logger, CommonSilentFlowRequest, ICrypto, PerformanceCallbackFunction, IPerformanceClient, BaseAuthRequest, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { ApiId, WrapperSKU, CacheLookupPolicy } from "../utils/BrowserConstants.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { EventHandler } from "../event/EventHandler.js";
|
||||
import { PopupClient } from "../interaction_client/PopupClient.js";
|
||||
import { RedirectClient } from "../interaction_client/RedirectClient.js";
|
||||
import { SilentIframeClient } from "../interaction_client/SilentIframeClient.js";
|
||||
import { SilentRefreshClient } from "../interaction_client/SilentRefreshClient.js";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { NativeMessageHandler } from "../broker/nativeBroker/NativeMessageHandler.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SilentCacheClient } from "../interaction_client/SilentCacheClient.js";
|
||||
import { SilentAuthCodeClient } from "../interaction_client/SilentAuthCodeClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { StandardOperatingContext } from "../operatingcontext/StandardOperatingContext.js";
|
||||
import { BaseOperatingContext } from "../operatingcontext/BaseOperatingContext.js";
|
||||
import { IController } from "./IController.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { InitializeApplicationRequest } from "../request/InitializeApplicationRequest.js";
|
||||
export declare class StandardController implements IController {
|
||||
protected readonly operatingContext: StandardOperatingContext;
|
||||
protected readonly browserCrypto: ICrypto;
|
||||
protected readonly browserStorage: BrowserCacheManager;
|
||||
protected readonly nativeInternalStorage: BrowserCacheManager;
|
||||
protected readonly networkClient: INetworkModule;
|
||||
protected navigationClient: INavigationClient;
|
||||
protected readonly config: BrowserConfiguration;
|
||||
private tokenCache;
|
||||
protected logger: Logger;
|
||||
protected isBrowserEnvironment: boolean;
|
||||
protected readonly eventHandler: EventHandler;
|
||||
protected readonly redirectResponse: Map<string, Promise<AuthenticationResult | null>>;
|
||||
protected nativeExtensionProvider: NativeMessageHandler | undefined;
|
||||
private hybridAuthCodeResponses;
|
||||
protected readonly performanceClient: IPerformanceClient;
|
||||
protected initialized: boolean;
|
||||
private activeSilentTokenRequests;
|
||||
private activeIframeRequest;
|
||||
private ssoSilentMeasurement?;
|
||||
private acquireTokenByCodeAsyncMeasurement?;
|
||||
/**
|
||||
* @constructor
|
||||
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
|
||||
*
|
||||
* Important attributes in the Configuration object for auth are:
|
||||
* - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
|
||||
* - authority: the authority URL for your application.
|
||||
* - redirect_uri: the uri of your application registered in the portal.
|
||||
*
|
||||
* In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
|
||||
* It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
|
||||
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
|
||||
* If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
|
||||
* If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
|
||||
* To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
|
||||
*
|
||||
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
|
||||
* Full B2C functionality will be available in this library in future versions.
|
||||
*
|
||||
* @param configuration Object for the MSAL PublicClientApplication instance
|
||||
*/
|
||||
constructor(operatingContext: StandardOperatingContext);
|
||||
static createController(operatingContext: BaseOperatingContext, request?: InitializeApplicationRequest): Promise<IController>;
|
||||
private trackPageVisibility;
|
||||
/**
|
||||
* Initializer function to perform async startup tasks such as connecting to WAM extension
|
||||
* @param request {?InitializeApplicationRequest} correlation id
|
||||
*/
|
||||
initialize(request?: InitializeApplicationRequest): Promise<void>;
|
||||
/**
|
||||
* Event handler function which allows users to fire events after the PublicClientApplication object
|
||||
* has loaded during redirect flows. This should be invoked on all page loads involved in redirect
|
||||
* auth flows.
|
||||
* @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
|
||||
* @returns Token response or null. If the return value is null, then no auth redirect was detected.
|
||||
*/
|
||||
handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;
|
||||
/**
|
||||
* The internal details of handleRedirectPromise. This is separated out to a helper to allow handleRedirectPromise to memoize requests
|
||||
* @param hash
|
||||
* @returns
|
||||
*/
|
||||
private handleRedirectPromiseInternal;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
|
||||
* the page, so any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
private trackPageVisibilityWithMeasurement;
|
||||
/**
|
||||
* This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
|
||||
* - Any browser using a form of Intelligent Tracking Prevention
|
||||
* - If there is not an established session with the service
|
||||
*
|
||||
* In these cases, the request must be done inside a popup or full frame redirect.
|
||||
*
|
||||
* For the cases where interaction is required, you cannot send a request with prompt=none.
|
||||
*
|
||||
* If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
|
||||
* you session on the server still exists.
|
||||
* @param request {@link SsoSilentRequest}
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
|
||||
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
|
||||
* This API is not indended for normal authorization code acquisition and redemption.
|
||||
*
|
||||
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
|
||||
*
|
||||
* @param request {@link AuthorizationCodeRequest}
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Creates a SilentAuthCodeClient to redeem an authorization code.
|
||||
* @param request
|
||||
* @returns Result of the operation to redeem the authorization code
|
||||
*/
|
||||
private acquireTokenByCodeAsync;
|
||||
/**
|
||||
* Attempt to acquire an access token from the cache
|
||||
* @param silentCacheClient SilentCacheClient
|
||||
* @param commonRequest CommonSilentFlowRequest
|
||||
* @param silentRequest SilentRequest
|
||||
* @returns A promise that, when resolved, returns the access token
|
||||
*/
|
||||
protected acquireTokenFromCache(commonRequest: CommonSilentFlowRequest, cacheLookupPolicy: CacheLookupPolicy): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Attempt to acquire an access token via a refresh token
|
||||
* @param commonRequest CommonSilentFlowRequest
|
||||
* @param cacheLookupPolicy CacheLookupPolicy
|
||||
* @returns A promise that, when resolved, returns the access token
|
||||
*/
|
||||
acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, cacheLookupPolicy: CacheLookupPolicy): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Attempt to acquire an access token via an iframe
|
||||
* @param request CommonSilentFlowRequest
|
||||
* @returns A promise that, when resolved, returns the access token
|
||||
*/
|
||||
protected acquireTokenBySilentIframe(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Deprecated logout function. Use logoutRedirect or logoutPopup instead
|
||||
* @param logoutRequest
|
||||
* @deprecated
|
||||
*/
|
||||
logout(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
|
||||
* Default behaviour is to redirect the user to `window.location.href`.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;
|
||||
/**
|
||||
* Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
|
||||
* @param logoutRequest
|
||||
*/
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;
|
||||
/**
|
||||
* Creates a cache interaction client to clear broswer cache.
|
||||
* @param logoutRequest
|
||||
*/
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
/**
|
||||
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
|
||||
* @param accountFilter - (Optional) filter to narrow down the accounts returned
|
||||
* @returns Array of AccountInfo objects in cache
|
||||
*/
|
||||
getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
|
||||
/**
|
||||
* Returns the first account found in the cache that matches the account filter passed in.
|
||||
* @param accountFilter
|
||||
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
|
||||
*/
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching username.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found.
|
||||
* This API is provided for convenience but getAccountById should be used for best reliability
|
||||
* @param username
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByUsername(username: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching homeAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param homeAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Returns the signed in account matching localAccountId.
|
||||
* (the account object is created at the time of successful login)
|
||||
* or null when no matching account is found
|
||||
* @param localAccountId
|
||||
* @returns The account object stored in MSAL
|
||||
*/
|
||||
getAccountByLocalId(localAccountId: string): AccountInfo | null;
|
||||
/**
|
||||
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
|
||||
* @param account
|
||||
*/
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
/**
|
||||
* Gets the currently active account
|
||||
*/
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
/**
|
||||
* Hydrates the cache with the tokens from an AuthenticationResult
|
||||
* @param result
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
/**
|
||||
* Acquire a token from native device (e.g. WAM)
|
||||
* @param request
|
||||
*/
|
||||
acquireTokenNative(request: PopupRequest | SilentRequest | SsoSilentRequest, apiId: ApiId, accountId?: string): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Returns boolean indicating if this request can use the platform broker
|
||||
* @param request
|
||||
*/
|
||||
canUsePlatformBroker(request: RedirectRequest | PopupRequest | SsoSilentRequest, accountId?: string): boolean;
|
||||
/**
|
||||
* Get the native accountId from the account
|
||||
* @param request
|
||||
* @returns
|
||||
*/
|
||||
getNativeAccountId(request: RedirectRequest | PopupRequest | SsoSilentRequest): string;
|
||||
/**
|
||||
* Returns new instance of the Popup Interaction Client
|
||||
* @param correlationId
|
||||
*/
|
||||
createPopupClient(correlationId?: string): PopupClient;
|
||||
/**
|
||||
* Returns new instance of the Redirect Interaction Client
|
||||
* @param correlationId
|
||||
*/
|
||||
protected createRedirectClient(correlationId?: string): RedirectClient;
|
||||
/**
|
||||
* Returns new instance of the Silent Iframe Interaction Client
|
||||
* @param correlationId
|
||||
*/
|
||||
createSilentIframeClient(correlationId?: string): SilentIframeClient;
|
||||
/**
|
||||
* Returns new instance of the Silent Cache Interaction Client
|
||||
*/
|
||||
protected createSilentCacheClient(correlationId?: string): SilentCacheClient;
|
||||
/**
|
||||
* Returns new instance of the Silent Refresh Interaction Client
|
||||
*/
|
||||
protected createSilentRefreshClient(correlationId?: string): SilentRefreshClient;
|
||||
/**
|
||||
* Returns new instance of the Silent AuthCode Interaction Client
|
||||
*/
|
||||
protected createSilentAuthCodeClient(correlationId?: string): SilentAuthCodeClient;
|
||||
/**
|
||||
* Adds event callbacks to array
|
||||
* @param callback
|
||||
*/
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
/**
|
||||
* Removes callback with provided id from callback array
|
||||
* @param callbackId
|
||||
*/
|
||||
removeEventCallback(callbackId: string): void;
|
||||
/**
|
||||
* Registers a callback to receive performance events.
|
||||
*
|
||||
* @param {PerformanceCallbackFunction} callback
|
||||
* @returns {string}
|
||||
*/
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
/**
|
||||
* Removes a callback registered with addPerformanceCallback.
|
||||
*
|
||||
* @param {string} callbackId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
/**
|
||||
* Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
* @deprecated These events will be raised by default and this method will be removed in a future major version.
|
||||
*/
|
||||
enableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
|
||||
* @deprecated These events will be raised by default and this method will be removed in a future major version.
|
||||
*/
|
||||
disableAccountStorageEvents(): void;
|
||||
/**
|
||||
* Gets the token cache for the application.
|
||||
*/
|
||||
getTokenCache(): ITokenCache;
|
||||
/**
|
||||
* Returns the logger instance
|
||||
*/
|
||||
getLogger(): Logger;
|
||||
/**
|
||||
* Replaces the default logger set in configurations with new Logger with new configurations
|
||||
* @param logger Logger instance
|
||||
*/
|
||||
setLogger(logger: Logger): void;
|
||||
/**
|
||||
* Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
|
||||
* @param sku
|
||||
* @param version
|
||||
*/
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
/**
|
||||
* Sets navigation client
|
||||
* @param navigationClient
|
||||
*/
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
/**
|
||||
* Returns the configuration object
|
||||
*/
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
/**
|
||||
* Returns the performance client
|
||||
*/
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
/**
|
||||
* Returns the browser env indicator
|
||||
*/
|
||||
isBrowserEnv(): boolean;
|
||||
/**
|
||||
* Generates a correlation id for a request if none is provided.
|
||||
*
|
||||
* @protected
|
||||
* @param {?Partial<BaseAuthRequest>} [request]
|
||||
* @returns {string}
|
||||
*/
|
||||
protected getRequestCorrelationId(request?: Partial<BaseAuthRequest>): string;
|
||||
/**
|
||||
* Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
|
||||
* any code that follows this function will not execute.
|
||||
*
|
||||
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
|
||||
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
loginRedirect(request?: RedirectRequest): Promise<void>;
|
||||
/**
|
||||
* Use when initiating the login process via opening a popup window in the user's browser
|
||||
*
|
||||
* @param request
|
||||
*
|
||||
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
|
||||
*/
|
||||
loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
|
||||
*
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object
|
||||
*/
|
||||
acquireTokenSilent(request: SilentRequest): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.
|
||||
* @param {@link (SilentRequest:type)}
|
||||
* @param {@link (AccountInfo:type)}
|
||||
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}
|
||||
*/
|
||||
protected acquireTokenSilentAsync(request: SilentRequest & {
|
||||
correlationId: string;
|
||||
}, account: AccountInfo): Promise<AuthenticationResult>;
|
||||
/**
|
||||
* AcquireTokenSilent without the iframe fallback. This is used to enable the correct fallbacks in cases where there's a potential for multiple silent requests to be made in parallel and prevent those requests from making concurrent iframe requests.
|
||||
* @param silentRequest
|
||||
* @param cacheLookupPolicy
|
||||
* @returns
|
||||
*/
|
||||
private acquireTokenSilentNoIframe;
|
||||
}
|
||||
//# sourceMappingURL=StandardController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1377
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs
generated
vendored
Normal file
1377
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/StandardController.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
86
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts
generated
vendored
Normal file
86
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
import { CommonAuthorizationUrlRequest, CommonSilentFlowRequest, PerformanceCallbackFunction, AccountInfo, Logger, ICrypto, IPerformanceClient, AccountFilter } from "@azure/msal-common/browser";
|
||||
import { ITokenCache } from "../cache/ITokenCache.js";
|
||||
import { BrowserConfiguration } from "../config/Configuration.js";
|
||||
import { BrowserCacheManager } from "../cache/BrowserCacheManager.js";
|
||||
import { INavigationClient } from "../navigation/INavigationClient.js";
|
||||
import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest.js";
|
||||
import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest.js";
|
||||
import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
||||
import { PopupRequest } from "../request/PopupRequest.js";
|
||||
import { RedirectRequest } from "../request/RedirectRequest.js";
|
||||
import { SilentRequest } from "../request/SilentRequest.js";
|
||||
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
||||
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
||||
import { ApiId, WrapperSKU } from "../utils/BrowserConstants.js";
|
||||
import { IController } from "./IController.js";
|
||||
import { UnknownOperatingContext } from "../operatingcontext/UnknownOperatingContext.js";
|
||||
import { EventCallbackFunction } from "../event/EventMessage.js";
|
||||
import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
|
||||
import { EventType } from "../event/EventType.js";
|
||||
/**
|
||||
* UnknownOperatingContextController class
|
||||
*
|
||||
* - Until initialize method is called, this controller is the default
|
||||
* - AFter initialize method is called, this controller will be swapped out for the appropriate controller
|
||||
* if the operating context can be determined; otherwise this controller will continued be used
|
||||
*
|
||||
* - Why do we have this? We don't want to dynamically import (download) all of the code in StandardController if we don't need to.
|
||||
*
|
||||
* - Only includes implementation for getAccounts and handleRedirectPromise
|
||||
* - All other methods are will throw initialization error (because either initialize method or the factory method were not used)
|
||||
* - This controller is necessary for React Native wrapper, server side rendering and any other scenario where we don't have a DOM
|
||||
*
|
||||
*/
|
||||
export declare class UnknownOperatingContextController implements IController {
|
||||
protected readonly operatingContext: UnknownOperatingContext;
|
||||
protected logger: Logger;
|
||||
protected readonly browserStorage: BrowserCacheManager;
|
||||
protected readonly config: BrowserConfiguration;
|
||||
protected readonly performanceClient: IPerformanceClient;
|
||||
private readonly eventHandler;
|
||||
protected readonly browserCrypto: ICrypto;
|
||||
protected isBrowserEnvironment: boolean;
|
||||
protected initialized: boolean;
|
||||
constructor(operatingContext: UnknownOperatingContext);
|
||||
getBrowserStorage(): BrowserCacheManager;
|
||||
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
||||
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
||||
getAccountByLocalId(localAccountId: string): AccountInfo | null;
|
||||
getAccountByUsername(username: string): AccountInfo | null;
|
||||
getAllAccounts(): AccountInfo[];
|
||||
initialize(): Promise<void>;
|
||||
acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenRedirect(request: RedirectRequest): Promise<void>;
|
||||
acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
|
||||
acquireTokenNative(request: PopupRequest | SilentRequest | Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>, apiId: ApiId, accountId?: string | undefined): Promise<AuthenticationResult>;
|
||||
acquireTokenByRefreshToken(commonRequest: CommonSilentFlowRequest, silentRequest: SilentRequest): Promise<AuthenticationResult>;
|
||||
addEventCallback(callback: EventCallbackFunction, eventTypes?: Array<EventType>): string | null;
|
||||
removeEventCallback(callbackId: string): void;
|
||||
addPerformanceCallback(callback: PerformanceCallbackFunction): string;
|
||||
removePerformanceCallback(callbackId: string): boolean;
|
||||
enableAccountStorageEvents(): void;
|
||||
disableAccountStorageEvents(): void;
|
||||
handleRedirectPromise(hash?: string | undefined): Promise<AuthenticationResult | null>;
|
||||
loginPopup(request?: PopupRequest | undefined): Promise<AuthenticationResult>;
|
||||
loginRedirect(request?: RedirectRequest | undefined): Promise<void>;
|
||||
logout(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutRedirect(logoutRequest?: EndSessionRequest | undefined): Promise<void>;
|
||||
logoutPopup(logoutRequest?: EndSessionPopupRequest | undefined): Promise<void>;
|
||||
ssoSilent(request: Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "platformBroker">>): Promise<AuthenticationResult>;
|
||||
getTokenCache(): ITokenCache;
|
||||
getLogger(): Logger;
|
||||
setLogger(logger: Logger): void;
|
||||
setActiveAccount(account: AccountInfo | null): void;
|
||||
getActiveAccount(): AccountInfo | null;
|
||||
initializeWrapperLibrary(sku: WrapperSKU, version: string): void;
|
||||
setNavigationClient(navigationClient: INavigationClient): void;
|
||||
getConfiguration(): BrowserConfiguration;
|
||||
isBrowserEnv(): boolean;
|
||||
getBrowserCrypto(): ICrypto;
|
||||
getPerformanceClient(): IPerformanceClient;
|
||||
getRedirectResponse(): Map<string, Promise<AuthenticationResult | null>>;
|
||||
clearCache(logoutRequest?: ClearCacheRequest): Promise<void>;
|
||||
hydrateCache(result: AuthenticationResult, request: SilentRequest | SsoSilentRequest | RedirectRequest | PopupRequest): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=UnknownOperatingContextController.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"UnknownOperatingContextController.d.ts","sourceRoot":"","sources":["../../src/controllers/UnknownOperatingContextController.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,MAAM,EACN,OAAO,EACP,kBAAkB,EAElB,aAAa,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,mBAAmB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAA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OAAO;IAK3B,oBAAoB,IAAI,kBAAkB;IAK1C,mBAAmB,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IAOlE,UAAU,CAAC,aAAa,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D,YAAY,CAEd,MAAM,EAAE,oBAAoB,EAE5B,OAAO,EACD,aAAa,GACb,gBAAgB,GAChB,eAAe,GACf,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC;CAInB"}
|
||||
268
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs
generated
vendored
Normal file
268
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs
generated
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common/browser';
|
||||
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.mjs';
|
||||
import { CryptoOps } from '../crypto/CryptoOps.mjs';
|
||||
import { blockAPICallsBeforeInitialize, blockNonBrowserEnvironment } from '../utils/BrowserUtils.mjs';
|
||||
import { EventHandler } from '../event/EventHandler.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* UnknownOperatingContextController class
|
||||
*
|
||||
* - Until initialize method is called, this controller is the default
|
||||
* - AFter initialize method is called, this controller will be swapped out for the appropriate controller
|
||||
* if the operating context can be determined; otherwise this controller will continued be used
|
||||
*
|
||||
* - Why do we have this? We don't want to dynamically import (download) all of the code in StandardController if we don't need to.
|
||||
*
|
||||
* - Only includes implementation for getAccounts and handleRedirectPromise
|
||||
* - All other methods are will throw initialization error (because either initialize method or the factory method were not used)
|
||||
* - This controller is necessary for React Native wrapper, server side rendering and any other scenario where we don't have a DOM
|
||||
*
|
||||
*/
|
||||
class UnknownOperatingContextController {
|
||||
constructor(operatingContext) {
|
||||
// Flag representing whether or not the initialize API has been called and completed
|
||||
this.initialized = false;
|
||||
this.operatingContext = operatingContext;
|
||||
this.isBrowserEnvironment =
|
||||
this.operatingContext.isBrowserEnvironment();
|
||||
this.config = operatingContext.getConfig();
|
||||
this.logger = operatingContext.getLogger();
|
||||
// Initialize performance client
|
||||
this.performanceClient = this.config.telemetry.client;
|
||||
// Initialize the crypto class.
|
||||
this.browserCrypto = this.isBrowserEnvironment
|
||||
? new CryptoOps(this.logger, this.performanceClient)
|
||||
: DEFAULT_CRYPTO_IMPLEMENTATION;
|
||||
this.eventHandler = new EventHandler(this.logger);
|
||||
// Initialize the browser storage class.
|
||||
this.browserStorage = this.isBrowserEnvironment
|
||||
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, undefined)
|
||||
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
|
||||
}
|
||||
getBrowserStorage() {
|
||||
return this.browserStorage;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccount(accountFilter) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccountByHomeId(homeAccountId) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccountByLocalId(localAccountId) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getAccountByUsername(username) {
|
||||
return null;
|
||||
}
|
||||
getAllAccounts() {
|
||||
return [];
|
||||
}
|
||||
initialize() {
|
||||
this.initialized = true;
|
||||
return Promise.resolve();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenPopup(request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
acquireTokenRedirect(request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return Promise.resolve();
|
||||
}
|
||||
acquireTokenSilent(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
silentRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
acquireTokenByCode(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
acquireTokenNative(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
apiId,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
accountId) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
acquireTokenByRefreshToken(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
commonRequest,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
silentRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
addEventCallback(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
callback,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
eventTypes) {
|
||||
return null;
|
||||
}
|
||||
removeEventCallback(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
callbackId) { }
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
addPerformanceCallback(callback) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return "";
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
removePerformanceCallback(callbackId) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return true;
|
||||
}
|
||||
enableAccountStorageEvents() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
disableAccountStorageEvents() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
handleRedirectPromise(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
hash) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
loginPopup(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
loginRedirect(request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logout(logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
logoutRedirect(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
logoutPopup(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
ssoSilent(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getTokenCache() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getLogger() {
|
||||
return this.logger;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setLogger(logger) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setActiveAccount(account) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
getActiveAccount() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
initializeWrapperLibrary(sku, version) {
|
||||
this.browserStorage.setWrapperMetadata(sku, version);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
setNavigationClient(navigationClient) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
getConfiguration() {
|
||||
return this.config;
|
||||
}
|
||||
isBrowserEnv() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return true;
|
||||
}
|
||||
getBrowserCrypto() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getPerformanceClient() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
getRedirectResponse() {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
return {};
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async clearCache(logoutRequest) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async hydrateCache(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
result,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
request) {
|
||||
blockAPICallsBeforeInitialize(this.initialized);
|
||||
blockNonBrowserEnvironment();
|
||||
}
|
||||
}
|
||||
|
||||
export { UnknownOperatingContextController };
|
||||
//# sourceMappingURL=UnknownOperatingContextController.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/controllers/UnknownOperatingContextController.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
80
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.d.ts
generated
vendored
Normal file
80
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.d.ts
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import { IPerformanceClient } from "@azure/msal-common/browser";
|
||||
/**
|
||||
* Check whether browser crypto is available.
|
||||
*/
|
||||
export declare function validateCryptoAvailable(skipValidateSubtleCrypto: boolean): void;
|
||||
/**
|
||||
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
||||
* @param dataString {string} data string
|
||||
* @param performanceClient {?IPerformanceClient}
|
||||
* @param correlationId {?string} correlation id
|
||||
*/
|
||||
export declare function sha256Digest(dataString: string, performanceClient?: IPerformanceClient, correlationId?: string): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Populates buffer with cryptographically random values.
|
||||
* @param dataBuffer
|
||||
*/
|
||||
export declare function getRandomValues(dataBuffer: Uint8Array): Uint8Array;
|
||||
/**
|
||||
* Creates a UUID v7 from the current timestamp.
|
||||
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
|
||||
* @returns {number}
|
||||
*/
|
||||
export declare function createNewGuid(): string;
|
||||
/**
|
||||
* Generates a keypair based on current keygen algorithm config.
|
||||
* @param extractable
|
||||
* @param usages
|
||||
*/
|
||||
export declare function generateKeyPair(extractable: boolean, usages: Array<KeyUsage>): Promise<CryptoKeyPair>;
|
||||
/**
|
||||
* Export key as Json Web Key (JWK)
|
||||
* @param key
|
||||
*/
|
||||
export declare function exportJwk(key: CryptoKey): Promise<JsonWebKey>;
|
||||
/**
|
||||
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
||||
* @param key
|
||||
* @param extractable
|
||||
* @param usages
|
||||
*/
|
||||
export declare function importJwk(key: JsonWebKey, extractable: boolean, usages: Array<KeyUsage>): Promise<CryptoKey>;
|
||||
/**
|
||||
* Signs given data with given key
|
||||
* @param key
|
||||
* @param data
|
||||
*/
|
||||
export declare function sign(key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Generates symmetric base encryption key. This may be stored as all encryption/decryption keys will be derived from this one.
|
||||
*/
|
||||
export declare function generateBaseKey(): Promise<ArrayBuffer>;
|
||||
/**
|
||||
* Returns the raw key to be passed into the key derivation function
|
||||
* @param baseKey
|
||||
* @returns
|
||||
*/
|
||||
export declare function generateHKDF(baseKey: ArrayBuffer): Promise<CryptoKey>;
|
||||
/**
|
||||
* Encrypt the given data given a base key. Returns encrypted data and a nonce that must be provided during decryption
|
||||
* @param key
|
||||
* @param rawData
|
||||
*/
|
||||
export declare function encrypt(baseKey: CryptoKey, rawData: string, context: string): Promise<{
|
||||
data: string;
|
||||
nonce: string;
|
||||
}>;
|
||||
/**
|
||||
* Decrypt data with the given key and nonce
|
||||
* @param key
|
||||
* @param nonce
|
||||
* @param encryptedData
|
||||
* @returns
|
||||
*/
|
||||
export declare function decrypt(baseKey: CryptoKey, nonce: string, context: string, encryptedData: string): Promise<string>;
|
||||
/**
|
||||
* Returns the SHA-256 hash of an input string
|
||||
* @param plainText
|
||||
*/
|
||||
export declare function hashString(plainText: string): Promise<string>;
|
||||
//# sourceMappingURL=BrowserCrypto.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"BrowserCrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/BrowserCrypto.ts"],"names":[],"mappings":"AASA,OAAO,EACH,kBAAkB,EAErB,MAAM,4BAA4B,CAAC;AA6CpC;;GAEG;AACH,wBAAgB,uBAAuB,CACnC,wBAAwB,EAAE,OAAO,GAClC,IAAI,CAeN;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAC9B,UAAU,EAAE,MAAM,EAClB,iBAAiB,CAAC,EAAE,kBAAkB,EACtC,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,WAAW,CAAC,CAWtB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAElE;AAWD;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAuCtC;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACjC,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,GACxB,OAAO,CAAC,aAAa,CAAC,CAMxB;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAKnE;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC3B,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,GACxB,OAAO,CAAC,SAAS,CAAC,CAQpB;AAED;;;;GAIG;AACH,wBAAsB,IAAI,CACtB,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,GAClB,OAAO,CAAC,WAAW,CAAC,CAMtB;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,CAU5D;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAI3E;AA4BD;;;;GAIG;AACH,wBAAsB,OAAO,CACzB,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAkB1C;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CACzB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,CAajB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAInE"}
|
||||
245
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.mjs
generated
vendored
Normal file
245
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.mjs
generated
vendored
Normal file
@@ -0,0 +1,245 @@
|
||||
/*! @azure/msal-browser v4.2.1 2025-02-11 */
|
||||
'use strict';
|
||||
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
|
||||
import { PerformanceEvents } from '@azure/msal-common/browser';
|
||||
import { KEY_FORMAT_JWK } from '../utils/BrowserConstants.mjs';
|
||||
import { urlEncodeArr } from '../encode/Base64Encode.mjs';
|
||||
import { base64DecToArr } from '../encode/Base64Decode.mjs';
|
||||
import { nonBrowserEnvironment, cryptoNonExistent } from '../error/BrowserAuthErrorCodes.mjs';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* This file defines functions used by the browser library to perform cryptography operations such as
|
||||
* hashing and encoding. It also has helper functions to validate the availability of specific APIs.
|
||||
*/
|
||||
/**
|
||||
* See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams
|
||||
*/
|
||||
// Algorithms
|
||||
const PKCS1_V15_KEYGEN_ALG = "RSASSA-PKCS1-v1_5";
|
||||
const AES_GCM = "AES-GCM";
|
||||
const HKDF = "HKDF";
|
||||
// SHA-256 hashing algorithm
|
||||
const S256_HASH_ALG = "SHA-256";
|
||||
// MOD length for PoP tokens
|
||||
const MODULUS_LENGTH = 2048;
|
||||
// Public Exponent
|
||||
const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
|
||||
// UUID hex digits
|
||||
const UUID_CHARS = "0123456789abcdef";
|
||||
// Array to store UINT32 random value
|
||||
const UINT32_ARR = new Uint32Array(1);
|
||||
// Key Format
|
||||
const RAW = "raw";
|
||||
// Key Usages
|
||||
const ENCRYPT = "encrypt";
|
||||
const DECRYPT = "decrypt";
|
||||
const DERIVE_KEY = "deriveKey";
|
||||
// Suberror
|
||||
const SUBTLE_SUBERROR = "crypto_subtle_undefined";
|
||||
const keygenAlgorithmOptions = {
|
||||
name: PKCS1_V15_KEYGEN_ALG,
|
||||
hash: S256_HASH_ALG,
|
||||
modulusLength: MODULUS_LENGTH,
|
||||
publicExponent: PUBLIC_EXPONENT,
|
||||
};
|
||||
/**
|
||||
* Check whether browser crypto is available.
|
||||
*/
|
||||
function validateCryptoAvailable(skipValidateSubtleCrypto) {
|
||||
if (!window) {
|
||||
throw createBrowserAuthError(nonBrowserEnvironment);
|
||||
}
|
||||
if (!window.crypto) {
|
||||
throw createBrowserAuthError(cryptoNonExistent);
|
||||
}
|
||||
if (!skipValidateSubtleCrypto && !window.crypto.subtle) {
|
||||
throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
|
||||
* @param dataString {string} data string
|
||||
* @param performanceClient {?IPerformanceClient}
|
||||
* @param correlationId {?string} correlation id
|
||||
*/
|
||||
async function sha256Digest(dataString, performanceClient, correlationId) {
|
||||
performanceClient?.addQueueMeasurement(PerformanceEvents.Sha256Digest, correlationId);
|
||||
const encoder = new TextEncoder();
|
||||
const data = encoder.encode(dataString);
|
||||
return window.crypto.subtle.digest(S256_HASH_ALG, data);
|
||||
}
|
||||
/**
|
||||
* Populates buffer with cryptographically random values.
|
||||
* @param dataBuffer
|
||||
*/
|
||||
function getRandomValues(dataBuffer) {
|
||||
return window.crypto.getRandomValues(dataBuffer);
|
||||
}
|
||||
/**
|
||||
* Returns random Uint32 value.
|
||||
* @returns {number}
|
||||
*/
|
||||
function getRandomUint32() {
|
||||
window.crypto.getRandomValues(UINT32_ARR);
|
||||
return UINT32_ARR[0];
|
||||
}
|
||||
/**
|
||||
* Creates a UUID v7 from the current timestamp.
|
||||
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
|
||||
* @returns {number}
|
||||
*/
|
||||
function createNewGuid() {
|
||||
const currentTimestamp = Date.now();
|
||||
const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
|
||||
// Result byte array
|
||||
const bytes = new Uint8Array(16);
|
||||
// A 12-bit `rand_a` field value
|
||||
const randA = Math.trunc(baseRand / 2 ** 30);
|
||||
// The higher 30 bits of 62-bit `rand_b` field value
|
||||
const randBHi = baseRand & (2 ** 30 - 1);
|
||||
// The lower 32 bits of 62-bit `rand_b` field value
|
||||
const randBLo = getRandomUint32();
|
||||
bytes[0] = currentTimestamp / 2 ** 40;
|
||||
bytes[1] = currentTimestamp / 2 ** 32;
|
||||
bytes[2] = currentTimestamp / 2 ** 24;
|
||||
bytes[3] = currentTimestamp / 2 ** 16;
|
||||
bytes[4] = currentTimestamp / 2 ** 8;
|
||||
bytes[5] = currentTimestamp;
|
||||
bytes[6] = 0x70 | (randA >>> 8);
|
||||
bytes[7] = randA;
|
||||
bytes[8] = 0x80 | (randBHi >>> 24);
|
||||
bytes[9] = randBHi >>> 16;
|
||||
bytes[10] = randBHi >>> 8;
|
||||
bytes[11] = randBHi;
|
||||
bytes[12] = randBLo >>> 24;
|
||||
bytes[13] = randBLo >>> 16;
|
||||
bytes[14] = randBLo >>> 8;
|
||||
bytes[15] = randBLo;
|
||||
let text = "";
|
||||
for (let i = 0; i < bytes.length; i++) {
|
||||
text += UUID_CHARS.charAt(bytes[i] >>> 4);
|
||||
text += UUID_CHARS.charAt(bytes[i] & 0xf);
|
||||
if (i === 3 || i === 5 || i === 7 || i === 9) {
|
||||
text += "-";
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
/**
|
||||
* Generates a keypair based on current keygen algorithm config.
|
||||
* @param extractable
|
||||
* @param usages
|
||||
*/
|
||||
async function generateKeyPair(extractable, usages) {
|
||||
return window.crypto.subtle.generateKey(keygenAlgorithmOptions, extractable, usages);
|
||||
}
|
||||
/**
|
||||
* Export key as Json Web Key (JWK)
|
||||
* @param key
|
||||
*/
|
||||
async function exportJwk(key) {
|
||||
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
|
||||
}
|
||||
/**
|
||||
* Imports key as Json Web Key (JWK), can set extractable and usages.
|
||||
* @param key
|
||||
* @param extractable
|
||||
* @param usages
|
||||
*/
|
||||
async function importJwk(key, extractable, usages) {
|
||||
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, keygenAlgorithmOptions, extractable, usages);
|
||||
}
|
||||
/**
|
||||
* Signs given data with given key
|
||||
* @param key
|
||||
* @param data
|
||||
*/
|
||||
async function sign(key, data) {
|
||||
return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);
|
||||
}
|
||||
/**
|
||||
* Generates symmetric base encryption key. This may be stored as all encryption/decryption keys will be derived from this one.
|
||||
*/
|
||||
async function generateBaseKey() {
|
||||
const key = await window.crypto.subtle.generateKey({
|
||||
name: AES_GCM,
|
||||
length: 256,
|
||||
}, true, [ENCRYPT, DECRYPT]);
|
||||
return window.crypto.subtle.exportKey(RAW, key);
|
||||
}
|
||||
/**
|
||||
* Returns the raw key to be passed into the key derivation function
|
||||
* @param baseKey
|
||||
* @returns
|
||||
*/
|
||||
async function generateHKDF(baseKey) {
|
||||
return window.crypto.subtle.importKey(RAW, baseKey, HKDF, false, [
|
||||
DERIVE_KEY,
|
||||
]);
|
||||
}
|
||||
/**
|
||||
* Given a base key and a nonce generates a derived key to be used in encryption and decryption.
|
||||
* Note: every time we encrypt a new key is derived
|
||||
* @param baseKey
|
||||
* @param nonce
|
||||
* @returns
|
||||
*/
|
||||
async function deriveKey(baseKey, nonce, context) {
|
||||
return window.crypto.subtle.deriveKey({
|
||||
name: HKDF,
|
||||
salt: nonce,
|
||||
hash: S256_HASH_ALG,
|
||||
info: new TextEncoder().encode(context),
|
||||
}, baseKey, { name: AES_GCM, length: 256 }, false, [ENCRYPT, DECRYPT]);
|
||||
}
|
||||
/**
|
||||
* Encrypt the given data given a base key. Returns encrypted data and a nonce that must be provided during decryption
|
||||
* @param key
|
||||
* @param rawData
|
||||
*/
|
||||
async function encrypt(baseKey, rawData, context) {
|
||||
const encodedData = new TextEncoder().encode(rawData);
|
||||
// The nonce must never be reused with a given key.
|
||||
const nonce = window.crypto.getRandomValues(new Uint8Array(16));
|
||||
const derivedKey = await deriveKey(baseKey, nonce, context);
|
||||
const encryptedData = await window.crypto.subtle.encrypt({
|
||||
name: AES_GCM,
|
||||
iv: new Uint8Array(12), // New key is derived for every encrypt so we don't need a new nonce
|
||||
}, derivedKey, encodedData);
|
||||
return {
|
||||
data: urlEncodeArr(new Uint8Array(encryptedData)),
|
||||
nonce: urlEncodeArr(nonce),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Decrypt data with the given key and nonce
|
||||
* @param key
|
||||
* @param nonce
|
||||
* @param encryptedData
|
||||
* @returns
|
||||
*/
|
||||
async function decrypt(baseKey, nonce, context, encryptedData) {
|
||||
const encodedData = base64DecToArr(encryptedData);
|
||||
const derivedKey = await deriveKey(baseKey, base64DecToArr(nonce), context);
|
||||
const decryptedData = await window.crypto.subtle.decrypt({
|
||||
name: AES_GCM,
|
||||
iv: new Uint8Array(12), // New key is derived for every encrypt so we don't need a new nonce
|
||||
}, derivedKey, encodedData);
|
||||
return new TextDecoder().decode(decryptedData);
|
||||
}
|
||||
/**
|
||||
* Returns the SHA-256 hash of an input string
|
||||
* @param plainText
|
||||
*/
|
||||
async function hashString(plainText) {
|
||||
const hashBuffer = await sha256Digest(plainText);
|
||||
const hashBytes = new Uint8Array(hashBuffer);
|
||||
return urlEncodeArr(hashBytes);
|
||||
}
|
||||
|
||||
export { createNewGuid, decrypt, encrypt, exportJwk, generateBaseKey, generateHKDF, generateKeyPair, getRandomValues, hashString, importJwk, sha256Digest, sign, validateCryptoAvailable };
|
||||
//# sourceMappingURL=BrowserCrypto.mjs.map
|
||||
1
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.mjs.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
75
node_modules/@azure/msal-browser/dist/crypto/CryptoOps.d.ts
generated
vendored
Normal file
75
node_modules/@azure/msal-browser/dist/crypto/CryptoOps.d.ts
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
import { ICrypto, IPerformanceClient, Logger, ShrOptions, SignedHttpRequest, SignedHttpRequestParameters } from "@azure/msal-common/browser";
|
||||
export type CachedKeyPair = {
|
||||
publicKey: CryptoKey;
|
||||
privateKey: CryptoKey;
|
||||
requestMethod?: string;
|
||||
requestUri?: string;
|
||||
};
|
||||
/**
|
||||
* This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
||||
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
||||
*/
|
||||
export declare class CryptoOps implements ICrypto {
|
||||
private logger;
|
||||
/**
|
||||
* CryptoOps can be used in contexts outside a PCA instance,
|
||||
* meaning there won't be a performance manager available.
|
||||
*/
|
||||
private performanceClient;
|
||||
private static POP_KEY_USAGES;
|
||||
private static EXTRACTABLE;
|
||||
private cache;
|
||||
constructor(logger: Logger, performanceClient?: IPerformanceClient, skipValidateSubtleCrypto?: boolean);
|
||||
/**
|
||||
* Creates a new random GUID - used to populate state and nonce.
|
||||
* @returns string (GUID)
|
||||
*/
|
||||
createNewGuid(): string;
|
||||
/**
|
||||
* Encodes input string to base64.
|
||||
* @param input
|
||||
*/
|
||||
base64Encode(input: string): string;
|
||||
/**
|
||||
* Decodes input string from base64.
|
||||
* @param input
|
||||
*/
|
||||
base64Decode(input: string): string;
|
||||
/**
|
||||
* Encodes input string to base64 URL safe string.
|
||||
* @param input
|
||||
*/
|
||||
base64UrlEncode(input: string): string;
|
||||
/**
|
||||
* Stringifies and base64Url encodes input public key
|
||||
* @param inputKid
|
||||
* @returns Base64Url encoded public key
|
||||
*/
|
||||
encodeKid(inputKid: string): string;
|
||||
/**
|
||||
* Generates a keypair, stores it and returns a thumbprint
|
||||
* @param request
|
||||
*/
|
||||
getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string>;
|
||||
/**
|
||||
* Removes cryptographic keypair from key store matching the keyId passed in
|
||||
* @param kid
|
||||
*/
|
||||
removeTokenBindingKey(kid: string): Promise<boolean>;
|
||||
/**
|
||||
* Removes all cryptographic keys from IndexedDB storage
|
||||
*/
|
||||
clearKeystore(): Promise<boolean>;
|
||||
/**
|
||||
* Signs the given object as a jwt payload with private key retrieved by given kid.
|
||||
* @param payload
|
||||
* @param kid
|
||||
*/
|
||||
signJwt(payload: SignedHttpRequest, kid: string, shrOptions?: ShrOptions, correlationId?: string): Promise<string>;
|
||||
/**
|
||||
* Returns the SHA-256 hash of an input string
|
||||
* @param plainText
|
||||
*/
|
||||
hashString(plainText: string): Promise<string>;
|
||||
}
|
||||
//# sourceMappingURL=CryptoOps.d.ts.map
|
||||
1
node_modules/@azure/msal-browser/dist/crypto/CryptoOps.d.ts.map
generated
vendored
Normal file
1
node_modules/@azure/msal-browser/dist/crypto/CryptoOps.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CryptoOps.d.ts","sourceRoot":"","sources":["../../src/crypto/CryptoOps.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,OAAO,EACP,kBAAkB,EAElB,MAAM,EAEN,UAAU,EACV,iBAAiB,EACjB,2BAA2B,EAC9B,MAAM,4BAA4B,CAAC;AAcpC,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,qBAAa,SAAU,YAAW,OAAO;IACrC,OAAO,CAAC,MAAM,CAAS;IAEvB;;;OAGG;IACH,OAAO,CAAC,iBAAiB,CAAiC;IAE1D,OAAO,CAAC,MAAM,CAAC,cAAc,CAAuC;IACpE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAiB;IAC3C,OAAO,CAAC,KAAK,CAAoC;gBAG7C,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,kBAAkB,EACtC,wBAAwB,CAAC,EAAE,OAAO;IAWtC;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC;;;OAGG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAItC;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAInC;;;OAGG;IACG,sBAAsB,CACxB,OAAO,EAAE,2BAA2B,GACrC,OAAO,CAAC,MAAM,CAAC;IAqDlB;;;OAGG;IACG,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM1D;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IA0BvC;;;;OAIG;IACG,OAAO,CACT,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,UAAU,EACvB,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC;IA0DlB;;;OAGG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGvD"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user