add project files

This commit is contained in:
2026-06-26 14:50:55 +02:00
parent f2d0cd6a14
commit 811dc6b848
55770 changed files with 7418342 additions and 2 deletions
+21
View 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
+182
View File
@@ -0,0 +1,182 @@
# Microsoft Authentication Library for JavaScript (MSAL.js) for Browser-Based Single-Page Applications
[![npm version](https://img.shields.io/npm/v/@azure/msal-browser.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-browser/)
[![npm version](https://img.shields.io/npm/dm/@azure/msal-browser.svg)](https://nodei.co/npm/@azure/msal-browser/)
[![codecov](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js/branch/dev/graph/badge.svg?flag=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
```
## Implicit Flow vs Authorization Code Flow with PKCE
`@azure/msal-browser` implements the [OAuth 2.0 Authorization Code Flow with PKCE](https://tools.ietf.org/html/rfc7636) for browser-based applications. This is a significant improvement over the Implicit Flow that was used in `@azure/msal`, `msal` or `adal-angular`.
### Authorization Code Flow with PKCE
The Authorization Code Flow with Proof Key for Code Exchange (PKCE) is the current industry standard for securing OAuth 2.0 authorization in public clients, including single-page applications (SPAs). Key benefits include:
- **Enhanced Security**: PKCE provides protection against authorization code interception attacks
- **No Tokens in URLs**: Tokens are never exposed in the browser's URL or history
- **Refresh Token Support**: Enables long-lived sessions through refresh tokens
- **OIDC Compliance**: Fully compliant with OpenID Connect standards
### Implicit Flow (Deprecated)
The Implicit Flow was the previous standard for SPAs but has been deprecated due to security concerns:
- **Tokens in URLs**: Access tokens are returned in URL fragments, making them visible in browser history and server logs
- **No Refresh Tokens**: Implicit flow cannot securely deliver refresh tokens to public clients
- **Increased Attack Surface**: Tokens are more susceptible to token leakage attacks
### Migration Considerations
- **`@azure/msal-browser` only supports Authorization Code Flow with PKCE** - Implicit Flow is not supported
- If you're migrating from `@azure/msal`, `msal` or `adal-angular`, see our [migration guide](./docs/v1-migration.md)
- Your Azure AD app registration needs to be configured for the Authorization Code Flow
- Existing applications using Implicit Flow should migrate to Authorization Code Flow for improved security
For more technical details about these flows, refer to the [Microsoft identity platform documentation](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow).
## 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.
@@ -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
@@ -0,0 +1 @@
{"version":3,"file":"IPublicClientAppl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OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,WAAW,CAAC,aAAa,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACpE,aAAa,IAAI,WAAW,CAAC;IAC7B,SAAS,IAAI,MAAM,CAAC;IACpB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;IACpD,gBAAgB,IAAI,WAAW,GAAG,IAAI,CAAC;IACvC,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACjE,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/D,gBAAgB;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"}
@@ -0,0 +1,113 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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
@@ -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,oCAAuE,CAC1E,CACJ,CAAC;KACL;IACD,cAAc,EAAE,MAAK;AACjB,QAAA,OAAO,EAAE,CAAC;KACb;IACD,UAAU,EAAE,MAAK;AACb,QAAA,OAAO,IAAI,CAAC;KACf;IACD,kBAAkB,EAAE,MAAK;AACrB,QAAA,OAAO,IAAI,CAAC;KACf;IACD,oBAAoB,EAAE,MAAK;AACvB,QAAA,OAAO,IAAI,CAAC;KACf;IACD,mBAAmB,EAAE,MAAK;AACtB,QAAA,OAAO,IAAI,CAAC;KACf;IACD,qBAAqB,EAAE,MAAK;QACxB,OAAO,OAA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;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;;;;;"}
@@ -0,0 +1,297 @@
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;
protected isBroker: boolean;
/**
* 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
@@ -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,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;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,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;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"}
@@ -0,0 +1,379 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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.isBroker = false;
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, this.isBroker);
}
/**
* 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
@@ -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;AAIhC;;;;AAIG;AAC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I,uBAAuB,CAC3C,aAAa,EACb,UAAU,CACb,CAAC;AACF,QAAA,MAAM,WAAW,CAAC,UAAU,EAAE,CAAC;AAC/B,QAAA,OAAO,WAAW,CAAC;AACtB,KAAA;AAED,IAAA,OAAO,qCAAqC,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;;;;"}
@@ -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
@@ -0,0 +1 @@
{"version":3,"file":"PublicCl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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"}
@@ -0,0 +1,363 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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
@@ -0,0 +1 @@
{"version":3,"file":"PublicClientNext.mjs","sources":["../../src/app/PublicClientNext.ts"],"sourcesContent":[null],"names":["ControllerFactory.createController"],"mappings":";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;;;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;;;;"}
@@ -0,0 +1,12 @@
import { PlatformAuthRequest } from "./PlatformAuthRequest.js";
import { PlatformAuthResponse } from "./PlatformAuthResponse.js";
/**
* Interface for the Platform Broker Handlers
*/
export interface IPlatformAuthHandler {
getExtensionId(): string | undefined;
getExtensionVersion(): string | undefined;
getExtensionName(): string | undefined;
sendMessage(request: PlatformAuthRequest): Promise<PlatformAuthResponse>;
}
//# sourceMappingURL=IPlatformAuthHandler.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"IPlatformAuthHandler.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/IPlatformAuthHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,cAAc,IAAI,MAAM,GAAG,SAAS,CAAC;IACrC,mBAAmB,IAAI,MAAM,GAAG,SAAS,CAAC;IAC1C,gBAAgB,IAAI,MAAM,GAAG,SAAS,CAAC;IACvC,WAAW,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC5E"}
@@ -0,0 +1,9 @@
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";
export declare const UX_NOT_ALLOWED = "UX_NOT_ALLOWED";
//# sourceMappingURL=NativeStatusCodes.d.ts.map
@@ -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;AACzD,eAAO,MAAM,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,16 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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 DISABLED = "DISABLED";
const ACCOUNT_UNAVAILABLE = "ACCOUNT_UNAVAILABLE";
const UX_NOT_ALLOWED = "UX_NOT_ALLOWED";
export { ACCOUNT_UNAVAILABLE, DISABLED, NO_NETWORK, USER_CANCEL, USER_INTERACTION_REQUIRED, UX_NOT_ALLOWED };
//# sourceMappingURL=NativeStatusCodes.mjs.map
@@ -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;AAGhC,MAAM,QAAQ,GAAG,WAAW;AAC5B,MAAM,mBAAmB,GAAG,sBAAsB;AAClD,MAAM,cAAc,GAAG;;;;"}
@@ -0,0 +1,30 @@
import { Logger, IPerformanceClient } from "@azure/msal-common/browser";
import { PlatformAuthRequest } from "./PlatformAuthRequest.js";
import { PlatformAuthResponse } from "./PlatformAuthResponse.js";
import { IPlatformAuthHandler } from "./IPlatformAuthHandler.js";
export declare class PlatformAuthDOMHandler implements IPlatformAuthHandler {
protected logger: Logger;
protected performanceClient: IPerformanceClient;
protected correlationId: string;
platformAuthType: string;
constructor(logger: Logger, performanceClient: IPerformanceClient, correlationId: string);
static createProvider(logger: Logger, performanceClient: IPerformanceClient, correlationId: string): Promise<PlatformAuthDOMHandler | undefined>;
/**
* Returns the Id for the broker extension this handler is communicating with
* @returns
*/
getExtensionId(): string;
getExtensionVersion(): string | undefined;
getExtensionName(): string | undefined;
/**
* Send token request to platform broker via browser DOM API
* @param request
* @returns
*/
sendMessage(request: PlatformAuthRequest): Promise<PlatformAuthResponse>;
private initializePlatformDOMRequest;
private validatePlatformBrokerResponse;
private convertToPlatformBrokerResponse;
private getDOMExtraParams;
}
//# sourceMappingURL=PlatformAuthDOMHandler.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthDOMHandler.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/PlatformAuthDOMHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,MAAM,EAGN,kBAAkB,EAErB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,mBAAmB,EAEtB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACH,oBAAoB,EAEvB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,qBAAa,sBAAuB,YAAW,oBAAoB;IAC/D,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IAChD,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;gBAGrB,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,kBAAkB,EACrC,aAAa,EAAE,MAAM;WAQZ,cAAc,CACvB,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,kBAAkB,EACrC,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IA0B9C;;;OAGG;IACH,cAAc,IAAI,MAAM;IAIxB,mBAAmB,IAAI,MAAM,GAAG,SAAS;IAIzC,gBAAgB,IAAI,MAAM,GAAG,SAAS;IAItC;;;;OAIG;IACG,WAAW,CACb,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,oBAAoB,CAAC;IAsBhC,OAAO,CAAC,4BAA4B;IA0CpC,OAAO,CAAC,8BAA8B;IAiDtC,OAAO,CAAC,+BAA+B;IAsBvC,OAAO,CAAC,iBAAiB;CAiB5B"}
@@ -0,0 +1,143 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
import { createAuthError, AuthErrorCodes } from '@azure/msal-common/browser';
import { PlatformAuthConstants } from '../../utils/BrowserConstants.mjs';
import { createNativeAuthError } from '../../error/NativeAuthError.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class PlatformAuthDOMHandler {
constructor(logger, performanceClient, correlationId) {
this.logger = logger;
this.performanceClient = performanceClient;
this.correlationId = correlationId;
this.platformAuthType = PlatformAuthConstants.PLATFORM_DOM_PROVIDER;
}
static async createProvider(logger, performanceClient, correlationId) {
logger.trace("PlatformAuthDOMHandler: createProvider called");
// @ts-ignore
if (window.navigator?.platformAuthentication) {
const supportedContracts =
// @ts-ignore
await window.navigator.platformAuthentication.getSupportedContracts(PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID);
if (supportedContracts?.includes(PlatformAuthConstants.PLATFORM_DOM_APIS)) {
logger.trace("Platform auth api available in DOM");
return new PlatformAuthDOMHandler(logger, performanceClient, correlationId);
}
}
return undefined;
}
/**
* Returns the Id for the broker extension this handler is communicating with
* @returns
*/
getExtensionId() {
return PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID;
}
getExtensionVersion() {
return "";
}
getExtensionName() {
return PlatformAuthConstants.DOM_API_NAME;
}
/**
* Send token request to platform broker via browser DOM API
* @param request
* @returns
*/
async sendMessage(request) {
this.logger.trace(this.platformAuthType + " - Sending request to browser DOM API");
try {
const platformDOMRequest = this.initializePlatformDOMRequest(request);
const response =
// @ts-ignore
await window.navigator.platformAuthentication.executeGetToken(platformDOMRequest);
return this.validatePlatformBrokerResponse(response);
}
catch (e) {
this.logger.error(this.platformAuthType + " - executeGetToken DOM API error");
throw e;
}
}
initializePlatformDOMRequest(request) {
this.logger.trace(this.platformAuthType + " - initializeNativeDOMRequest called");
const { accountId, clientId, authority, scope, redirectUri, correlationId, state, storeInCache, embeddedClientId, extraParameters, ...remainingProperties } = request;
const validExtraParameters = this.getDOMExtraParams(remainingProperties);
const platformDOMRequest = {
accountId: accountId,
brokerId: this.getExtensionId(),
authority: authority,
clientId: clientId,
correlationId: correlationId || this.correlationId,
extraParameters: { ...extraParameters, ...validExtraParameters },
isSecurityTokenService: false,
redirectUri: redirectUri,
scope: scope,
state: state,
storeInCache: storeInCache,
embeddedClientId: embeddedClientId,
};
return platformDOMRequest;
}
validatePlatformBrokerResponse(response) {
if (response.hasOwnProperty("isSuccess")) {
if (response.hasOwnProperty("accessToken") &&
response.hasOwnProperty("idToken") &&
response.hasOwnProperty("clientInfo") &&
response.hasOwnProperty("account") &&
response.hasOwnProperty("scopes") &&
response.hasOwnProperty("expiresIn")) {
this.logger.trace(this.platformAuthType +
" - platform broker returned successful and valid response");
return this.convertToPlatformBrokerResponse(response);
}
else if (response.hasOwnProperty("error")) {
const errorResponse = response;
if (errorResponse.isSuccess === false &&
errorResponse.error &&
errorResponse.error.code) {
this.logger.trace(this.platformAuthType +
" - platform broker returned error response");
throw createNativeAuthError(errorResponse.error.code, errorResponse.error.description, {
error: parseInt(errorResponse.error.errorCode),
protocol_error: errorResponse.error.protocolError,
status: errorResponse.error.status,
properties: errorResponse.error.properties,
});
}
}
}
throw createAuthError(AuthErrorCodes.unexpectedError, "Response missing expected properties.");
}
convertToPlatformBrokerResponse(response) {
this.logger.trace(this.platformAuthType + " - convertToNativeResponse called");
const nativeResponse = {
access_token: response.accessToken,
id_token: response.idToken,
client_info: response.clientInfo,
account: response.account,
expires_in: response.expiresIn,
scope: response.scopes,
state: response.state || "",
properties: response.properties || {},
extendedLifetimeToken: response.extendedLifetimeToken ?? false,
shr: response.proofOfPossessionPayload,
};
return nativeResponse;
}
getDOMExtraParams(extraParameters) {
const stringifiedParams = Object.entries(extraParameters).reduce((record, [key, value]) => {
record[key] = String(value);
return record;
}, {});
const validExtraParams = {
...stringifiedParams,
};
return validExtraParams;
}
}
export { PlatformAuthDOMHandler };
//# sourceMappingURL=PlatformAuthDOMHandler.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthDOMHandler.mjs","sources":["../../../src/broker/nativeBroker/PlatformAuthDOMHandler.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;AAGG;MAsBU,sBAAsB,CAAA;AAM/B,IAAA,WAAA,CACI,MAAc,EACd,iBAAqC,EACrC,aAAqB,EAAA;AAErB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAC3C,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;AACnC,QAAA,IAAI,CAAC,gBAAgB,GAAG,qBAAqB,CAAC,qBAAqB,CAAC;KACvE;IAED,aAAa,cAAc,CACvB,MAAc,EACd,iBAAqC,EACrC,aAAqB,EAAA;AAErB,QAAA,MAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;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AyB;YACzC,YAAY,EAAE,QAAQ,CAAC,WAAW;YAClC,QAAQ,EAAE,QAAQ,CAAC,OAAO;YAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;YAChC,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,UAAU,EAAE,QAAQ,CAAC,SAAS;YAC9B,KAAK,EAAE,QAAQ,CAAC,MAAM;AACtB,YAAA,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE;AAC3B,YAAA,UAAU,EAAE,QAAQ,CAAC,UAAU,IAAI,EAAE;AACrC,YAAA,qBAAqB,EAAE,QAAQ,CAAC,qBAAqB,IAAI,KAAK;YAC9D,GAAG,EAAE,QAAQ,CAAC,wBAAwB;SACzC,CAAC;AAEF,QAAA,OAAO,cAAc,CAAC;KACzB;AAEO,IAAA,iBAAiB,CACrB,eAAwC,EAAA;QAExC,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,MAAM,CAC5D,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;YACrB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,YAAA,OAAO,MAAM,CAAC;SACjB,EACD,EAAgB,CACnB,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAAuB;AACzC,YAAA,GAAG,iBAAiB;SACvB,CAAC;AAEF,QAAA,OAAO,gBAAgB,CAAC;KAC3B;AACJ;;;;"}
@@ -0,0 +1,63 @@
import { Logger, IPerformanceClient } from "@azure/msal-common/browser";
import { PlatformAuthRequest } from "./PlatformAuthRequest.js";
import { PlatformAuthResponse } from "./PlatformAuthResponse.js";
import { IPlatformAuthHandler } from "./IPlatformAuthHandler.js";
export declare class PlatformAuthExtensionHandler implements IPlatformAuthHandler {
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;
platformAuthType: string;
constructor(logger: Logger, handshakeTimeoutMs: number, performanceClient: IPerformanceClient, extensionId?: string);
/**
* Sends a given message to the extension and resolves with the extension response
* @param request
*/
sendMessage(request: PlatformAuthRequest): Promise<PlatformAuthResponse>;
/**
* 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<PlatformAuthExtensionHandler>;
/**
* 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;
/**
* Validates native platform response before processing
* @param response
*/
private validatePlatformBrokerResponse;
/**
* 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;
getExtensionName(): string | undefined;
}
//# sourceMappingURL=PlatformAuthExtensionHandler.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthExtensionHandler.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/PlatformAuthExtensionHandler.ts"],"names":[],"mappings":"AASA,OAAO,EACH,MAAM,EAMN,kBAAkB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGH,mBAAmB,EACtB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AASjE,qBAAa,4BAA6B,YAAW,oBAAoB;IACrE,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;IAC5D,gBAAgB,EAAE,MAAM,CAAC;gBAGrB,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,MAAM,EAC1B,iBAAiB,EAAE,kBAAkB,EACrC,WAAW,CAAC,EAAE,MAAM;IAiBxB;;;OAGG;IACG,WAAW,CACb,OAAO,EAAE,mBAAmB,GAC7B,OAAO,CAAC,oBAAoB,CAAC;IAqChC;;;;;;OAMG;WACU,cAAc,CACvB,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,MAAM,EAC1B,iBAAiB,EAAE,kBAAkB,GACtC,OAAO,CAAC,4BAA4B,CAAC;IAwBxC;;OAEG;YACW,oBAAoB;IAsDlC;;;OAGG;IACH,OAAO,CAAC,eAAe;IA0DvB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAuGxB;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IAoBtC;;;OAGG;IACH,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC;;;OAGG;IACH,mBAAmB,IAAI,MAAM,GAAG,SAAS;IAIzC,gBAAgB,IAAI,MAAM,GAAG,SAAS;CAQzC"}
@@ -0,0 +1,274 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
import { PlatformAuthConstants, NativeExtensionMethod } from '../../utils/BrowserConstants.mjs';
import { PerformanceEvents, createAuthError, AuthErrorCodes } 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 PlatformAuthExtensionHandler {
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);
this.platformAuthType =
PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER;
}
/**
* Sends a given message to the extension and resolves with the extension response
* @param request
*/
async sendMessage(request) {
this.logger.trace(this.platformAuthType + " - sendMessage called.");
// fall back to native calls
const messageBody = {
method: NativeExtensionMethod.GetToken,
request: request,
};
const req = {
channel: PlatformAuthConstants.CHANNEL_ID,
extensionId: this.extensionId,
responseId: createNewGuid(),
body: messageBody,
};
this.logger.trace(this.platformAuthType + " - Sending request to browser extension");
this.logger.tracePii(this.platformAuthType +
` - Sending request to browser extension: ${JSON.stringify(req)}`);
this.messageChannel.port1.postMessage(req);
const response = await new Promise((resolve, reject) => {
this.resolvers.set(req.responseId, { resolve, reject });
});
const validatedResponse = this.validatePlatformBrokerResponse(response);
return validatedResponse;
}
/**
* 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("PlatformAuthExtensionHandler - createProvider called.");
try {
const preferredProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, PlatformAuthConstants.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 PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient);
await backupProvider.sendHandshakeRequest();
return backupProvider;
}
}
/**
* Send handshake request helper.
*/
async sendHandshakeRequest() {
this.logger.trace(this.platformAuthType + " - 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: PlatformAuthConstants.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(this.platformAuthType + " - onWindowMessage called");
// We only accept messages from ourselves
if (event.source !== window) {
return;
}
const request = event.data;
if (!request.channel ||
request.channel !== PlatformAuthConstants.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(this.platformAuthType +
`.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(this.platformAuthType + " - 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(this.platformAuthType +
" - Received response from browser extension");
this.logger.tracePii(this.platformAuthType +
` - 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(this.platformAuthType +
`.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(this.platformAuthType +
` - 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);
}
}
}
/**
* Validates native platform response before processing
* @param response
*/
validatePlatformBrokerResponse(response) {
if (response.hasOwnProperty("access_token") &&
response.hasOwnProperty("id_token") &&
response.hasOwnProperty("client_info") &&
response.hasOwnProperty("account") &&
response.hasOwnProperty("scope") &&
response.hasOwnProperty("expires_in")) {
return response;
}
else {
throw createAuthError(AuthErrorCodes.unexpectedError, "Response missing expected properties.");
}
}
/**
* 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;
}
getExtensionName() {
return this.getExtensionId() ===
PlatformAuthConstants.PREFERRED_EXTENSION_ID
? "chrome"
: this.getExtensionId()?.length
? "unknown"
: undefined;
}
}
export { PlatformAuthExtensionHandler };
//# sourceMappingURL=PlatformAuthExtensionHandler.mjs.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
import { LoggerOptions, IPerformanceClient, Logger, AuthenticationScheme } from "@azure/msal-common/browser";
import { BrowserConfiguration } from "../../config/Configuration.js";
import { IPlatformAuthHandler } from "./IPlatformAuthHandler.js";
/**
* Checks if the platform broker is available in the current environment.
* @param loggerOptions
* @param perfClient
* @returns
*/
export declare function isPlatformBrokerAvailable(loggerOptions?: LoggerOptions, perfClient?: IPerformanceClient, correlationId?: string): Promise<boolean>;
export declare function getPlatformAuthProvider(logger: Logger, performanceClient: IPerformanceClient, correlationId: string, nativeBrokerHandshakeTimeout?: number): Promise<IPlatformAuthHandler | undefined>;
/**
* Returns true if the DOM API support for platform auth is enabled in session storage
* @returns boolean
* @deprecated
*/
export declare function isDomEnabledForPlatformAuth(): boolean;
/**
* Returns boolean indicating whether or not the request should attempt to use native broker
* @param logger
* @param config
* @param platformAuthProvider
* @param authenticationScheme
*/
export declare function isPlatformAuthAllowed(config: BrowserConfiguration, logger: Logger, platformAuthProvider?: IPlatformAuthHandler, authenticationScheme?: AuthenticationScheme): boolean;
//# sourceMappingURL=PlatformAuthProvider.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthProvider.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/PlatformAuthProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,oBAAoB,EAEvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACH,oBAAoB,EAEvB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAMjE;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC3C,aAAa,CAAC,EAAE,aAAa,EAC7B,UAAU,CAAC,EAAE,kBAAkB,EAC/B,aAAa,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAED,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,kBAAkB,EACrC,aAAa,EAAE,MAAM,EACrB,4BAA4B,CAAC,EAAE,MAAM,GACtC,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAuC3C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CASrD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,MAAM,EACd,oBAAoB,CAAC,EAAE,oBAAoB,EAC3C,oBAAoB,CAAC,EAAE,oBAAoB,GAC5C,OAAO,CAkCT"}
@@ -0,0 +1,109 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
import { Logger, StubPerformanceClient, AuthenticationScheme } from '@azure/msal-common/browser';
import { name, version } from '../../packageMetadata.mjs';
import { DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS } from '../../config/Configuration.mjs';
import { PlatformAuthExtensionHandler } from './PlatformAuthExtensionHandler.mjs';
import { PlatformAuthDOMHandler } from './PlatformAuthDOMHandler.mjs';
import { createNewGuid } from '../../crypto/BrowserCrypto.mjs';
import { BrowserCacheLocation } from '../../utils/BrowserConstants.mjs';
import { PLATFORM_AUTH_DOM_SUPPORT } from '../../cache/CacheKeys.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Checks if the platform broker is available in the current environment.
* @param loggerOptions
* @param perfClient
* @returns
*/
async function isPlatformBrokerAvailable(loggerOptions, perfClient, correlationId) {
const logger = new Logger(loggerOptions || {}, name, version);
logger.trace("isPlatformBrokerAvailable called");
const performanceClient = perfClient || new StubPerformanceClient();
if (typeof window === "undefined") {
logger.trace("Non-browser environment detected, returning false");
return false;
}
return !!(await getPlatformAuthProvider(logger, performanceClient, correlationId || createNewGuid()));
}
async function getPlatformAuthProvider(logger, performanceClient, correlationId, nativeBrokerHandshakeTimeout) {
logger.trace("getPlatformAuthProvider called", correlationId);
const enablePlatformBrokerDOMSupport = isDomEnabledForPlatformAuth();
logger.trace("Has client allowed platform auth via DOM API: " +
enablePlatformBrokerDOMSupport);
let platformAuthProvider;
try {
if (enablePlatformBrokerDOMSupport) {
// Check if DOM platform API is supported first
platformAuthProvider = await PlatformAuthDOMHandler.createProvider(logger, performanceClient, correlationId);
}
if (!platformAuthProvider) {
logger.trace("Platform auth via DOM API not available, checking for extension");
/*
* If DOM APIs are not available, check if browser extension is available.
* Platform authentication via DOM APIs is preferred over extension APIs.
*/
platformAuthProvider =
await PlatformAuthExtensionHandler.createProvider(logger, nativeBrokerHandshakeTimeout ||
DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, performanceClient);
}
}
catch (e) {
logger.trace("Platform auth not available", e);
}
return platformAuthProvider;
}
/**
* Returns true if the DOM API support for platform auth is enabled in session storage
* @returns boolean
* @deprecated
*/
function isDomEnabledForPlatformAuth() {
let sessionStorage;
try {
sessionStorage = window[BrowserCacheLocation.SessionStorage];
// Mute errors if it's a non-browser environment or cookies are blocked.
return sessionStorage?.getItem(PLATFORM_AUTH_DOM_SUPPORT) === "true";
}
catch (e) {
return false;
}
}
/**
* Returns boolean indicating whether or not the request should attempt to use native broker
* @param logger
* @param config
* @param platformAuthProvider
* @param authenticationScheme
*/
function isPlatformAuthAllowed(config, logger, platformAuthProvider, authenticationScheme) {
logger.trace("isPlatformAuthAllowed called");
if (!config.system.allowPlatformBroker) {
logger.trace("isPlatformAuthAllowed: allowPlatformBroker is not enabled, returning false");
// Developer disabled WAM
return false;
}
if (!platformAuthProvider) {
logger.trace("isPlatformAuthAllowed: Platform auth provider is not initialized, returning false");
// Platform broker auth providers are not available
return false;
}
if (authenticationScheme) {
switch (authenticationScheme) {
case AuthenticationScheme.BEARER:
case AuthenticationScheme.POP:
logger.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true");
return true;
default:
logger.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false");
return false;
}
}
return true;
}
export { getPlatformAuthProvider, isDomEnabledForPlatformAuth, isPlatformAuthAllowed, isPlatformBrokerAvailable };
//# sourceMappingURL=PlatformAuthProvider.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthProvider.mjs","sources":["../../../src/broker/nativeBroker/PlatformAuthProvider.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAqBH;;;;;AAKG;AACI,eAAe,yBAAyB,CAC3C,aAA6B,EAC7B,UAA+B,EAC/B,aAAsB,EAAA;AAEtB,IAAA,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC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}
@@ -0,0 +1,78 @@
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 PlatformAuthRequest = {
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?: PlatformAuthRequest;
};
/**
* Browser extension request
*/
export type NativeExtensionRequest = {
channel: string;
responseId: string;
extensionId?: string;
body: NativeExtensionRequestBody;
};
export type PlatformDOMTokenRequest = {
brokerId: string;
accountId?: string;
clientId: string;
authority: string;
scope: string;
redirectUri: string;
correlationId: string;
isSecurityTokenService: boolean;
state?: string;
extraParameters?: DOMExtraParameters;
embeddedClientId?: string;
storeInCache?: StoreInCache;
};
export type DOMExtraParameters = StringDict & {
prompt?: string;
nonce?: string;
claims?: string;
loginHint?: string;
instanceAware?: string;
windowTitleSubstring?: string;
extendedExpiryToken?: string;
reqCnf?: string;
keyId?: string;
tokenType?: string;
shrClaims?: string;
shrNonce?: string;
resourceRequestMethod?: string;
resourceRequestUri?: string;
signPopToken?: string;
};
//# sourceMappingURL=PlatformAuthRequest.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthRequest.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/PlatformAuthRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AA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M,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,EAAE,OAAO,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IAOf,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,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,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC"}
@@ -0,0 +1,71 @@
/**
* 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 PlatformAuthResponse = {
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;
};
export type PlatformDOMTokenResponse = {
isSuccess: boolean;
state?: string;
accessToken: string;
expiresIn: number;
account: NativeAccountInfo;
clientInfo: string;
idToken: string;
scopes: string;
proofOfPossessionPayload?: string;
extendedLifetimeToken?: boolean;
error: ErrorResult;
properties?: Record<string, string>;
};
export type ErrorResult = {
code: string;
description?: string;
errorCode: string;
protocolError?: string;
status: string;
properties?: object;
};
//# sourceMappingURL=PlatformAuthResponse.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthResponse.d.ts","sourceRoot":"","sources":["../../../src/broker/nativeBroker/PlatformAuthResponse.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,oBAAoB,GAAG;IAC/B,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;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CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -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, correlationId: string, 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, correlationId: 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
*/
export declare function getAccountByUsername(username: string, logger: Logger, browserStorage: BrowserCacheManager, correlationId: 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
*/
export declare function getAccountByHomeId(homeAccountId: string, logger: Logger, browserStorage: BrowserCacheManager, correlationId: 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
*/
export declare function getAccountByLocalId(localAccountId: string, logger: Logger, browserStorage: BrowserCacheManager, correlationId: 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
*/
export declare function setActiveAccount(account: AccountInfo | null, browserStorage: BrowserCacheManager, correlationId: string): void;
/**
* Gets the currently active account
*/
export declare function getActiveAccount(browserStorage: BrowserCacheManager, correlationId: string): AccountInfo | null;
//# sourceMappingURL=AccountManager.d.ts.map
@@ -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,EAAE,MAAM,EACrB,aAAa,CAAC,EAAE,aAAa,GAC9B,WAAW,EAAE,CAKf;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACtB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,MAAM,GACtB,WAAW,GAAG,IAAI,CAepB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,MAAM,GACtB,WAAW,GAAG,IAAI,CA2BpB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAC9B,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,MAAM,GACtB,WAAW,GAAG,IAAI,CA2BpB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,MAAM,GACtB,WAAW,GAAG,IAAI,CA2BpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,MAAM,GACtB,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,cAAc,EAAE,mBAAmB,EACnC,aAAa,EAAE,MAAM,GACtB,WAAW,GAAG,IAAI,CAEpB"}
@@ -0,0 +1,128 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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, correlationId, accountFilter) {
logger.verbose("getAllAccounts called");
return isInBrowser
? browserStorage.getAllAccounts(accountFilter || {}, correlationId)
: [];
}
/**
* 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, correlationId) {
const account = browserStorage.getAccountInfoFilteredBy(accountFilter, correlationId);
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, correlationId) {
logger.trace("getAccountByUsername called");
if (!username) {
logger.warning("getAccountByUsername: No username provided");
return null;
}
const account = browserStorage.getAccountInfoFilteredBy({
username,
}, correlationId);
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, correlationId) {
logger.trace("getAccountByHomeId called");
if (!homeAccountId) {
logger.warning("getAccountByHomeId: No homeAccountId provided");
return null;
}
const account = browserStorage.getAccountInfoFilteredBy({
homeAccountId,
}, correlationId);
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, correlationId) {
logger.trace("getAccountByLocalId called");
if (!localAccountId) {
logger.warning("getAccountByLocalId: No localAccountId provided");
return null;
}
const account = browserStorage.getAccountInfoFilteredBy({
localAccountId,
}, correlationId);
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, correlationId) {
browserStorage.setActiveAccount(account, correlationId);
}
/**
* Gets the currently active account
*/
function getActiveAccount(browserStorage, correlationId) {
return browserStorage.getActiveAccount(correlationId);
}
export { getAccount, getAccountByHomeId, getAccountByLocalId, getAccountByUsername, getActiveAccount, getAllAccounts, setActiveAccount };
//# sourceMappingURL=AccountManager.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"AccountManager.mjs","sources":["../../src/cache/AccountManager.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAKH;;;;AAIG;AACG,SAAU,cAAc,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,OAAO,CACV,uEAAuE,CAC1E,CAAC;AACF,QAAA,MAAM,CAAC,UAAU,CACb,8EAA8E,cAAc,CAAA,CAAE,CACjG,CAAC;AACF,QAAA,OAAO,OAAO,CAAC;AAClB,KAAA;AAAM,SAAA;AACH,QAAA,MAAM,CAAC,OAAO,CACV,gEAAgE,CACnE,CAAC;AACF,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AACL,CAAC;AAED;;;AAGG;SACa,gBAAgB,CAC5B,OAA2B,EAC3B,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,cAAc,CAAC,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC;AAED;;AAEG;AACa,SAAA,gBAAgB,CAC5B,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,OAAO,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAC1D;;;;"}
@@ -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
@@ -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"}
@@ -0,0 +1,141 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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
@@ -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,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AM,SAAS,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC;AAC7D,YAAA,IAAI,SAAS,EAAE;AACX,gBAAA,IAAI,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;;;;"}
@@ -0,0 +1,312 @@
import { AccessTokenEntity, AccountEntity, AccountInfo, AppMetadataEntity, AuthorityMetadataEntity, CacheManager, CacheRecord, CommonAuthorizationUrlRequest, ICrypto, IdTokenEntity, IPerformanceClient, Logger, RefreshTokenEntity, ServerTelemetryEntity, StaticAuthorityOptions, StoreInCache, ThrottlingEntity, TokenKeys, CredentialEntity } from "@azure/msal-common/browser";
import { CacheOptions } from "../config/Configuration.js";
import { INTERACTION_TYPE } from "../utils/BrowserConstants.js";
import { MemoryStorage } from "./MemoryStorage.js";
import { IWindowStorage } from "./IWindowStorage.js";
import { PlatformAuthRequest } from "../broker/nativeBroker/PlatformAuthRequest.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;
private eventHandler;
constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger, performanceClient: IPerformanceClient, eventHandler: EventHandler, staticAuthorityOptions?: StaticAuthorityOptions);
initialize(correlationId: string): Promise<void>;
/**
* Migrates any existing cache data from previous versions of MSAL.js into the current cache structure.
*/
migrateExistingCache(correlationId: string): Promise<void>;
updateV0ToCurrent(currentSchema: number, v0Keys: Array<string>, v1Keys: Array<string>, correlationId: string): Promise<void[]>;
/**
* Tracks upgrades and downgrades for telemetry and debugging purposes
*/
private trackVersionChanges;
/**
* Parses passed value as JSON object, JSON.parse() will throw an error.
* @param input
*/
protected validateAndParseJson(jsonValue: string): object | null;
/**
* Helper to setItem in browser storage, with cleanup in case of quota errors
* @param key
* @param value
*/
setItem(key: string, value: string, correlationId: string): void;
/**
* Helper to setUserData in browser storage, with cleanup in case of quota errors
* @param key
* @param value
* @param correlationId
*/
setUserData(key: string, value: string, correlationId: string, timestamp: string): Promise<void>;
/**
* 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, correlationId: 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, correlationId: string): boolean;
/**
* Remove an account from the key map
* @param key
*/
removeAccountKeyFromMap(key: string, correlationId: string): void;
/**
* Extends inherited removeAccount function to include removal of the account key from the map
* @param key
*/
removeAccount(account: AccountInfo, correlationId: string): void;
/**
* Removes given idToken from the cache and from the key map
* @param key
*/
removeIdToken(key: string, correlationId: string): void;
/**
* Removes given accessToken from the cache and from the key map
* @param key
*/
removeAccessToken(key: string, correlationId: string, updateTokenKeys?: boolean): void;
/**
* Remove access token key from the key map
* @param key
* @param correlationId
* @param tokenKeys
*/
removeAccessTokenKeys(keys: Array<string>, correlationId: string, schemaVersion?: number): void;
/**
* Removes given refreshToken from the cache and from the key map
* @param key
*/
removeRefreshToken(key: string, correlationId: string): void;
/**
* Gets the keys for the cached tokens associated with this clientId
* @returns
*/
getTokenKeys(schemaVersion?: number): TokenKeys;
/**
* Stores the token keys in the cache
* @param tokenKeys
* @param correlationId
* @returns
*/
setTokenKeys(tokenKeys: TokenKeys, correlationId: string, schemaVersion?: number): void;
/**
* generates idToken entity from a string
* @param idTokenKey
*/
getIdTokenCredential(idTokenKey: string, correlationId: 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, correlationId: 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, correlationId: 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, correlationId: string): 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, correlationId: string): 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(correlationId: string): AccountInfo | null;
/**
* Sets the active account's localAccountId in cache
* @param account
*/
setActiveAccount(account: AccountInfo | null, correlationId: string): 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, correlationId: string): 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(correlationId: string): void;
/**
* Clears all access tokes that have claims prior to saving the current one
* @param performanceClient {IPerformanceClient}
* @param correlationId {string} correlation id
* @returns
*/
clearTokensAndKeysWithClaims(correlationId: string): void;
/**
* Prepend msal.<client-id> to each key
* @param key
* @param addInstanceId
*/
generateCacheKey(key: string): string;
/**
* Cache Key: msal.<schema_version>-<home_account_id>-<environment>-<credential_type>-<client_id or familyId>-<realm>-<scopes>-<claims hash>-<scheme>
* IdToken Example: uid.utid-login.microsoftonline.com-idtoken-app_client_id-contoso.com
* AccessToken Example: uid.utid-login.microsoftonline.com-accesstoken-app_client_id-contoso.com-scope1 scope2--pop
* RefreshToken Example: uid.utid-login.microsoftonline.com-refreshtoken-1-contoso.com
* @param credentialEntity
* @returns
*/
generateCredentialKey(credential: CredentialEntity): string;
/**
* Cache Key: msal.<schema_version>.<home_account_id>.<environment>.<tenant_id>
* @param account
* @returns
*/
generateAccountKey(account: AccountInfo): string;
/**
* Reset all temporary cache items
* @param state
*/
resetRequestCache(): void;
cacheAuthorizeRequest(authCodeRequest: CommonAuthorizationUrlRequest, codeVerifier?: string): void;
/**
* Gets the token exchange parameters from the cache. Throws an error if nothing is found.
*/
getCachedRequest(): [CommonAuthorizationUrlRequest, string];
/**
* Gets cached native request for redirect flows
*/
getCachedNativeRequest(): PlatformAuthRequest | null;
isInteractionInProgress(matchClientId?: boolean): boolean;
getInteractionInProgress(): {
clientId: string;
type: INTERACTION_TYPE;
} | null;
setInteractionInProgress(inProgress: boolean, type?: INTERACTION_TYPE): 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
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -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>, schemaVersion?: number): 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>, schemaVersion?: number): TokenKeys;
//# sourceMappingURL=CacheHelpers.d.ts.map
@@ -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;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;GAIG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,aAAa,CAAC,EAAE,MAAM,GACvB,KAAK,CAAC,MAAM,CAAC,CASf;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAC/B,aAAa,CAAC,EAAE,MAAM,GACvB,SAAS,CAqBX"}
@@ -0,0 +1,46 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
import { getAccountKeysCacheKey, getTokenKeysCacheKey } from './CacheKeys.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, schemaVersion) {
const accountKeys = storage.getItem(getAccountKeysCacheKey(schemaVersion));
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, schemaVersion) {
const item = storage.getItem(getTokenKeysCacheKey(clientId, schemaVersion));
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
@@ -0,0 +1 @@
{"version":3,"file":"CacheHelpers.mjs","sources":["../../src/cache/CacheHelpers.ts"],"sourcesContent":[null],"names":["CacheKeys.getAccountKeysCacheKey","CacheKeys.getTokenKeysCacheKey"],"mappings":";;;;AAAA;;;AAGG;AAMH;;;;AAIG;AACa,SAAA,cAAc,CAC1B,OAA+B,EAC/B,aAAsB,EAAA;AAEtB,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAC/BA,sBAAgC,CAAC,aAAa,CAAC,CAClD,CAAC;AACF,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;SACa,YAAY,CACxB,QAAgB,EAChB,OAA+B,EAC/B,aAAsB,EAAA;AAEtB,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CACxBC,oBAA8B,CAAC,QAAQ,EAAE,aAAa,CAAC,CAC1D,CAAC;AACF,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;;;;"}
@@ -0,0 +1,14 @@
export declare const PREFIX = "msal";
export declare const CACHE_KEY_SEPARATOR = "-";
export declare const CREDENTIAL_SCHEMA_VERSION = 1;
export declare const ACCOUNT_SCHEMA_VERSION = 1;
export declare const LOG_LEVEL_CACHE_KEY: string;
export declare const LOG_PII_CACHE_KEY: string;
export declare const BROWSER_PERF_ENABLED_KEY: string;
export declare const PLATFORM_AUTH_DOM_SUPPORT: string;
export declare const VERSION_CACHE_KEY: string;
export declare const ACCOUNT_KEYS = "account.keys";
export declare const TOKEN_KEYS = "token.keys";
export declare function getAccountKeysCacheKey(schema?: number): string;
export declare function getTokenKeysCacheKey(clientId: string, schema?: number): string;
//# sourceMappingURL=CacheKeys.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"CacheKeys.d.ts","sourceRoot":"","sources":["../../src/cache/CacheKeys.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,SAAS,CAAC;AAE7B,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,eAAO,MAAM,mBAAmB,QAA0C,CAAC;AAC3E,eAAO,MAAM,iBAAiB,QAAwC,CAAC;AACvE,eAAO,MAAM,wBAAwB,QAAoD,CAAC;AAC1F,eAAO,MAAM,yBAAyB,QAAkD,CAAC;AACzF,eAAO,MAAM,iBAAiB,QAAsB,CAAC;AACrD,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,wBAAgB,sBAAsB,CAClC,MAAM,GAAE,MAA+B,GACxC,MAAM,CAMR;AAED,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,MAAkC,GAC3C,MAAM,CAMR"}
@@ -0,0 +1,33 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
const PREFIX = "msal";
const BROWSER_PREFIX = "browser";
const CACHE_KEY_SEPARATOR = "-";
const CREDENTIAL_SCHEMA_VERSION = 1;
const ACCOUNT_SCHEMA_VERSION = 1;
const LOG_LEVEL_CACHE_KEY = `${PREFIX}.${BROWSER_PREFIX}.log.level`;
const LOG_PII_CACHE_KEY = `${PREFIX}.${BROWSER_PREFIX}.log.pii`;
const BROWSER_PERF_ENABLED_KEY = `${PREFIX}.${BROWSER_PREFIX}.performance.enabled`;
const PLATFORM_AUTH_DOM_SUPPORT = `${PREFIX}.${BROWSER_PREFIX}.platform.auth.dom`;
const VERSION_CACHE_KEY = `${PREFIX}.version`;
const ACCOUNT_KEYS = "account.keys";
const TOKEN_KEYS = "token.keys";
function getAccountKeysCacheKey(schema = ACCOUNT_SCHEMA_VERSION) {
if (schema < 1) {
return `${PREFIX}.${ACCOUNT_KEYS}`;
}
return `${PREFIX}.${schema}.${ACCOUNT_KEYS}`;
}
function getTokenKeysCacheKey(clientId, schema = CREDENTIAL_SCHEMA_VERSION) {
if (schema < 1) {
return `${PREFIX}.${TOKEN_KEYS}.${clientId}`;
}
return `${PREFIX}.${schema}.${TOKEN_KEYS}.${clientId}`;
}
export { ACCOUNT_KEYS, ACCOUNT_SCHEMA_VERSION, BROWSER_PERF_ENABLED_KEY, CACHE_KEY_SEPARATOR, CREDENTIAL_SCHEMA_VERSION, LOG_LEVEL_CACHE_KEY, LOG_PII_CACHE_KEY, PLATFORM_AUTH_DOM_SUPPORT, PREFIX, TOKEN_KEYS, VERSION_CACHE_KEY, getAccountKeysCacheKey, getTokenKeysCacheKey };
//# sourceMappingURL=CacheKeys.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"CacheKeys.mjs","sources":["../../src/cache/CacheKeys.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEI,MAAM,MAAM,GAAG,OAAO;AAC7B,MAAM,cAAc,GAAG,SAAS,CAAC;AAC1B,MAAM,mBAAmB,GAAG,IAAI;AAChC,MAAM,yBAAyB,GAAG,EAAE;AACpC,MAAM,sBAAsB,GAAG,EAAE;MAE3B,mBAAmB,GAAG,GAAG,MAAM,CAAA,CAAA,EAAI,cAAc,CAAA,UAAA,EAAa;MAC9D,iBAAiB,GAAG,GAAG,MAAM,CAAA,CAAA,EAAI,cAAc,CAAA,QAAA,EAAW;MAC1D,wBAAwB,GAAG,GAAG,MAAM,CAAA,CAAA,EAAI,cAAc,CAAA,oBAAA,EAAuB;MAC7E,yBAAyB,GAAG,GAAG,MAAM,CAAA,CAAA,EAAI,cAAc,CAAA,kBAAA,EAAqB;AAC5E,MAAA,iBAAiB,GAAG,CAAG,EAAA,MAAM,WAAW;AAC9C,MAAM,YAAY,GAAG,eAAe;AACpC,MAAM,UAAU,GAAG,aAAa;AAEvB,SAAA,sBAAsB,CAClC,MAAA,GAAiB,sBAAsB,EAAA;IAEvC,IAAI,MAAM,GAAG,CAAC,EAAE;AACZ,QAAA,OAAO,CAAG,EAAA,MAAM,CAAI,CAAA,EAAA,YAAY,EAAE,CAAC;AACtC,KAAA;AAED,IAAA,OAAO,GAAG,MAAM,CAAA,CAAA,EAAI,MAAM,CAAI,CAAA,EAAA,YAAY,EAAE,CAAC;AACjD,CAAC;SAEe,oBAAoB,CAChC,QAAgB,EAChB,SAAiB,yBAAyB,EAAA;IAE1C,IAAI,MAAM,GAAG,CAAC,EAAE;AACZ,QAAA,OAAO,GAAG,MAAM,CAAA,CAAA,EAAI,UAAU,CAAI,CAAA,EAAA,QAAQ,EAAE,CAAC;AAChD,KAAA;IAED,OAAO,CAAA,EAAG,MAAM,CAAI,CAAA,EAAA,MAAM,IAAI,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAE,CAAC;AAC3D;;;;"}
@@ -0,0 +1,23 @@
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;
decryptData(): Promise<object | null>;
}
/**
* Get cookie expiration time
* @param cookieLifeDays
*/
export declare function getCookieExpirationTime(cookieLifeDays: number): string;
//# sourceMappingURL=CookieStorage.d.ts.map
@@ -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;IAIjC,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAIxC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAMtE"}
@@ -0,0 +1,82 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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);
}
decryptData() {
// Cookie storage does not support encryption, so this method is a no-op
return Promise.resolve(null);
}
}
/**
* 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
@@ -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,MAAM;EACL;MAIE,aAAa,CAAA;IACtB,UAAU,GAAA;AACN,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC5B;AAED,IAAA,OAAO,CAAC,GAAW,EAAA;QACf,MAAM,IAAI,GAAG,CAAG,EAAA,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC9C,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACxC,YAAA,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAC7B,YAAA,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpE,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAE7B,IAAI,GAAG,KAAK,IAAI,EAAE;AACd,gBAAA,OAAO,KAAK,CAAC;AAChB,aAAA;AACJ,SAAA;AACD,QAAA,OAAO,EAAE,CAAC;KACb;IAED,WAAW,GAAA;AACP,QAAA,MAAM,qBAAqB,CAAC,oBAAoB,CAAC,oBAA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AAC,CAAC,CAAC;AAC9B,SAAC,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;QACnB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KACvC;IAED,WAAW,GAAA;;AAEP,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAChC;AACJ,CAAA;AAED;;;AAGG;AACG,SAAU,uBAAuB,CAAC,cAAsB,EAAA;AAC1D,IAAA,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;AACzB,IAAA,MAAM,IAAI,GAAG,IAAI,IAAI,CACjB,KAAK,CAAC,OAAO,EAAE,GAAG,cAAc,GAAG,sBAAsB,CAC5D,CAAC;AACF,IAAA,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC9B;;;;"}
@@ -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
@@ -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"}
@@ -0,0 +1,209 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
export type EncryptedData = {
id: string;
nonce: string;
data: string;
lastUpdatedAt: string;
};
export declare function isEncrypted(data: object): data is EncryptedData;
//# sourceMappingURL=EncryptedData.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"EncryptedData.d.ts","sourceRoot":"","sources":["../../src/cache/EncryptedData.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAM/D"}
@@ -0,0 +1,14 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
function isEncrypted(data) {
return (data.hasOwnProperty("id") &&
data.hasOwnProperty("nonce") &&
data.hasOwnProperty("data"));
}
export { isEncrypted };
//# sourceMappingURL=EncryptedData.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"EncryptedData.mjs","sources":["../../src/cache/EncryptedData.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AASG,SAAU,WAAW,CAAC,IAAY,EAAA;AACpC,IAAA,QACI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;AACzB,QAAA,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;AAC5B,QAAA,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAC7B;AACN;;;;"}
@@ -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
@@ -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"}
@@ -0,0 +1,12 @@
import type { ExternalTokenResponse } from "@azure/msal-common/browser";
import type { SilentRequest } from "../request/SilentRequest.js";
import type { LoadTokenOptions } from "./TokenCache.js";
import type { 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
@@ -0,0 +1 @@
{"version":3,"file":"ITokenCache.d.ts","sourceRoot":"","sources":["../../src/cache/ITokenCache.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,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"}
@@ -0,0 +1,42 @@
import { EncryptedData } from "./EncryptedData.js";
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, timestamp: 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;
decryptData(key: string, data: EncryptedData, correlationId: string): Promise<object | null>;
}
//# sourceMappingURL=IWindowStorage.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"IWindowStorage.d.ts","sourceRoot":"","sources":["../../src/cache/IWindowStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,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,CACP,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;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;IAElC,WAAW,CACP,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,aAAa,EACnB,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7B"}
@@ -0,0 +1,51 @@
import { IPerformanceClient, Logger } from "@azure/msal-common/browser";
import { IWindowStorage } from "./IWindowStorage.js";
import { EncryptedData } from "./EncryptedData.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;
decryptData(key: string, data: EncryptedData, correlationId: string): Promise<object | null>;
setItem(key: string, value: string): void;
setUserData(key: string, value: string, correlationId: string, timestamp: 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
@@ -0,0 +1 @@
{"version":3,"file":"LocalStorage.d.ts","sourceRoot":"","sources":["../../src/cache/LocalStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,kBAAkB,EAGlB,MAAM,EAET,MAAM,4BAA4B,CAAC;AAmBpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,EAAE,aAAa,EAAe,MAAM,oBAAoB,CAAC;AAUhE,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;IASjC,WAAW,CACb,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,aAAa,EACnB,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA4CzB,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,EACrB,SAAS,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAgChB,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;IA6CjC;;;;OAIG;YACW,yBAAyB;IAqDvC;;;;OAIG;YACW,WAAW;IA0BzB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,WAAW;CAkCtB"}
@@ -0,0 +1,297 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
import { invoke, PerformanceEvents, invokeAsync } from '@azure/msal-common/browser';
import { generateHKDF, createNewGuid, generateBaseKey, decrypt, encrypt } 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 { CookieStorage, SameSiteOptions } from './CookieStorage.mjs';
import { MemoryStorage } from './MemoryStorage.mjs';
import { getAccountKeys, getTokenKeys } from './CacheHelpers.mjs';
import { PREFIX, getAccountKeysCacheKey, getTokenKeysCacheKey } from './CacheKeys.mjs';
import { isEncrypted } from './EncryptedData.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) {
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),
};
}
else {
// Encryption key doesn't exist or is invalid, generate a new one
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
);
}
await invokeAsync(this.importExistingCache.bind(this), PerformanceEvents.ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);
// Register listener for cache updates in other tabs
this.broadcast.addEventListener("message", this.updateCache.bind(this));
this.initialized = true;
}
getItem(key) {
return window.localStorage.getItem(key);
}
getUserData(key) {
if (!this.initialized) {
throw createBrowserAuthError(uninitializedPublicClientApplication);
}
return this.memoryStorage.getItem(key);
}
async decryptData(key, data, correlationId) {
if (!this.initialized || !this.encryptionCookie) {
throw createBrowserAuthError(uninitializedPublicClientApplication);
}
if (data.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;
}
const decryptedData = await invokeAsync(decrypt, PerformanceEvents.Decrypt, this.logger, this.performanceClient, correlationId)(this.encryptionCookie.key, data.nonce, this.getContext(key), data.data);
if (!decryptedData) {
return null;
}
try {
return JSON.parse(decryptedData);
}
catch (e) {
this.performanceClient.incrementFields({ encryptedCacheCorruptionCount: 1 }, correlationId);
return null;
}
}
setItem(key, value) {
window.localStorage.setItem(key, value);
}
async setUserData(key, value, correlationId, timestamp) {
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,
lastUpdatedAt: timestamp,
};
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(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
if (accountKeys.length) {
this.setItem(getAccountKeysCacheKey(), JSON.stringify(accountKeys));
}
else {
this.removeItem(getAccountKeysCacheKey());
}
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
if (tokenKeys.idToken.length ||
tokenKeys.accessToken.length ||
tokenKeys.refreshToken.length) {
this.setItem(getTokenKeysCacheKey(this.clientId), JSON.stringify(tokenKeys));
}
else {
this.removeItem(getTokenKeysCacheKey(this.clientId));
}
}
/**
* 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 (!isEncrypted(encObj)) {
// Data is not encrypted
this.performanceClient.incrementFields({ unencryptedCacheCount: 1 }, correlationId);
return encObj;
}
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
File diff suppressed because one or more lines are too long
@@ -0,0 +1,16 @@
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;
decryptData(): Promise<object | null>;
}
//# sourceMappingURL=MemoryStorage.d.ts.map
@@ -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;IAIb,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAIxC"}
@@ -0,0 +1,49 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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();
}
decryptData() {
// Memory storage does not support encryption, so this method is a no-op
return Promise.resolve(null);
}
}
export { MemoryStorage };
//# sourceMappingURL=MemoryStorage.mjs.map
@@ -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;IAED,WAAW,GAAA;;AAEP,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAChC;AACJ;;;;"}
@@ -0,0 +1,14 @@
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;
decryptData(): Promise<object | null>;
}
//# sourceMappingURL=SessionStorage.d.ts.map
@@ -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;IAIjC,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAIxC"}
@@ -0,0 +1,47 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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);
}
decryptData() {
// Session storage does not support encryption, so this method is a no-op
return Promise.resolve(null);
}
}
export { SessionStorage };
//# sourceMappingURL=SessionStorage.mjs.map
@@ -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;IAED,WAAW,GAAA;;AAEP,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAChC;AACJ;;;;"}
@@ -0,0 +1,78 @@
import { ICrypto, Logger, ExternalTokenResponse } from "@azure/msal-common/browser";
import { BrowserConfiguration } from "../config/Configuration.js";
import type { SilentRequest } from "../request/SilentRequest.js";
import { BrowserCacheManager } from "./BrowserCacheManager.js";
import type { ITokenCache } from "./ITokenCache.js";
import type { 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
@@ -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,EASxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAIhF,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;IAqDzB;;;;;;;OAOG;YACW,WAAW;IAyBzB;;;;;;;;OAQG;YACW,eAAe;IA6D7B;;;;;;;OAOG;YACW,gBAAgB;IA+B9B;;;;;;;OAOG;IACH,OAAO,CAAC,4BAA4B;CAiDvC"}
@@ -0,0 +1,207 @@
/*! @azure/msal-browser v4.22.1 2025-09-09 */
'use strict';
import { AuthToken, Authority, AccountEntity, buildAccountToCache, CacheHelpers, ScopeSet, TimeUtils } 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, correlationId, 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 + TimeUtils.nowSeconds();
const extendedExpiresOn = options.extendedExpiresOn ||
(response.ext_expires_in || response.expires_in) +
TimeUtils.nowSeconds();
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();
// Access token expiresOn stored in seconds, converting to Date for AuthenticationResult
expiresOn = TimeUtils.toDateFromSeconds(cacheRecord.accessToken.expiresOn);
extExpiresOn = TimeUtils.toDateFromSeconds(cacheRecord.accessToken.extendedExpiresOn);
}
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
File diff suppressed because one or more lines are too long
@@ -0,0 +1,232 @@
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;
/**
* Flag of whether to encode query parameters
* @deprecated This flag is deprecated and will be removed in the next major version where all extra query params will be encoded by default.
*/
encodeExtraQueryParams?: 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 number of days cache entries written by previous versions of MSAL.js should be retained in the browser. Defaults to 5 days.
*/
cacheRetentionDays?: number;
/**
* Used to specify the temporaryCacheLocation user wants to set. Valid values are "localStorage", "sessionStorage" and "memoryStorage".
* @deprecated This option is deprecated and will be removed in the next major version.
*/
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.
* @deprecated This option is deprecated and will be removed in the next major version.
*/
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 the next 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.
* @deprecated This option is deprecated and will be removed in the next major version.
*/
cacheMigrationEnabled?: boolean;
/**
* Flag that determines whether access tokens are stored based on requested claims
* @deprecated This option is deprecated and will be removed in the next major version.
*/
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
@@ -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,EACjB,oBAAoB,EAGpB,kBAAkB,EAGrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,oBAAoB,EAEvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAMvE,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAC9C,eAAO,MAAM,yBAAyB,QAAQ,CAAC;AAC/C,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AACjD,eAAO,MAAM,0CAA0C,OAAO,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM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E,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,CA0ItB"}
@@ -0,0 +1,142 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'use strict';
import { StubPerformanceClient, ProtocolMode, Logger, LogLevel, createClientConfigurationError, ClientConfigurationErrorCodes, StubbedNetworkModule, DEFAULT_SYSTEM_OPTIONS, Constants, ServerResponseType, AzureCloudInstance } from '@azure/msal-common/browser';
import { BrowserConstants, BrowserCacheLocation } 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,
encodeExtraQueryParams: false,
};
// Default cache options for browser
const DEFAULT_CACHE_OPTIONS = {
cacheLocation: BrowserCacheLocation.SessionStorage,
cacheRetentionDays: 5,
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 with OIDC protocol mode
if (userInputAuth?.protocolMode &&
userInputAuth.protocolMode === ProtocolMode.OIDC &&
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
@@ -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;AAmO/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,OAAO,MAAM,KAAK,WAAW,GAAGA,aAA0B,EAAE,GAAG,EA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;AAC3B,QAAA,aAAa,CAAC,YAAY,KAAK,YAAY,CAAC,IAAI;QAChD,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;;;;"}
@@ -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
@@ -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"}
@@ -0,0 +1,35 @@
/*! @azure/msal-browser v4.24.0 2025-09-24 */
'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
@@ -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;;;;"}
@@ -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, isBroker?: boolean): 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
@@ -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,CACN,OAAO,CAAC,EAAE,4BAA4B,EACtC,QAAQ,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,iBAAiB,CAAC,OAAO,EAAE,YAA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