Estructura inicial del proyecto

This commit is contained in:
2026-06-02 16:57:08 +00:00
commit 8b306b9afc
9864 changed files with 1435687 additions and 0 deletions

21
backend/node_modules/@azure/msal-browser/LICENSE generated vendored Normal file
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

174
backend/node_modules/@azure/msal-browser/README.md generated vendored Normal file
View File

@ -0,0 +1,174 @@
# 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)
- [CDN Deprecation](#cdn-deprecation)
- [Via npm](#via-npm)
- [Via Yarn](#via-yarn)
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 [Microsoft Entra ID](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).
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).
## 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
### CDN Deprecation
> :warning: The `@azure/msal-browser` CDN has been fully deprecated as of `@azure/msal-browser@3.0.0` and is no longer supported. App developers using the MSAL CDN must upgrade to the latest possible version and consume MSAL through a package manager or bundling tool of their choice. For more information on version support, consult the table in the project [README.md](../../README.md#library-version-support-status).
### Via NPM
```javascript
npm install @azure/msal-browser
```
### Via Yarn
```javascript
yarn add @azure/msal-browser
```
## Usage
### Migrating from Previous MSAL Versions
Select the guide that matches your current MSAL version:
- [Migrating from MSAL v4.x to MSAL v5.x](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v4-migration.md)
- [Migrating from MSAL v3.x to MSAL v4.x](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v3-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)
- [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)
### 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)
- [MCP Flows](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-v5/lib/msal-browser/docs/mcp.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 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)
## 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
```
## Authorization Code Flow with Proof Key for Code Exchange (PKCE)
`@azure/msal-browser` implements the [OAuth 2.0 Authorization Code Flow with PKCE](https://tools.ietf.org/html/rfc7636) for browser-based applications.
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
## 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](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.

View File

@ -0,0 +1,92 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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;
},
handleRedirectPromise: () => {
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
},
loginPopup: () => {
return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled));
},
loginRedirect: () => {
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;
},
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

View File

@ -0,0 +1 @@
{"version":3,"file":"IPublicClientApplication.mjs","sources":["../../src/app/IPublicClientApplication.ts"],"sourcesContent":[null],"names":["BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled"],"mappings":";;;;;AAAA;;;AAGG;AA4EU,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,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;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;;;;;"}

View File

@ -0,0 +1,314 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { StandardController } from '../controllers/StandardController.mjs';
import { StandardOperatingContext } from '../operatingcontext/StandardOperatingContext.mjs';
import { NestedAppAuthController } from '../controllers/NestedAppAuthController.mjs';
import { NestedAppOperatingContext } from '../operatingcontext/NestedAppOperatingContext.mjs';
import { createNewGuid } from '../crypto/BrowserCrypto.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 {
/**
* @constructor
* Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object
*
* Important attributes in the Configuration object for auth are:
* - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
* - authority: the authority URL for your application.
* - redirect_uri: the uri of your application registered in the portal.
*
* In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
* It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
* If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
* If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
* If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
* To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
*
* In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
* Full B2C functionality will be available in this library in future versions.
*
* @param configuration Object for the MSAL PublicClientApplication instance
* @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)
*/
constructor(configuration, controller) {
this.controller =
controller ||
new StandardController(new StandardOperatingContext(configuration));
}
/**
* Initializer function to perform async startup tasks such as connecting to WAM extension
* @param request {?InitializeApplicationRequest}
*/
async initialize(request) {
return this.controller.initialize(request);
}
/**
* Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
*
* @param request
*
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
*/
async acquireTokenPopup(request) {
return this.controller.acquireTokenPopup(request);
}
/**
* Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
* the page, so any code that follows this function will not execute.
*
* IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
* browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
*
* @param request
*/
acquireTokenRedirect(request) {
return this.controller.acquireTokenRedirect(request);
}
/**
* Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
*
* @param {@link (SilentRequest:type)}
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object
*/
acquireTokenSilent(silentRequest) {
return this.controller.acquireTokenSilent(silentRequest);
}
/**
* This function redeems an authorization code (passed as code) from the eSTS token endpoint.
* This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
* This API is not indended for normal authorization code acquisition and redemption.
*
* Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
*
* @param request {@link AuthorizationCodeRequest}
* @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
*/
acquireTokenByCode(request) {
return this.controller.acquireTokenByCode(request);
}
/**
* Adds event callbacks to array
* @param callback
* @param eventTypes
*/
addEventCallback(callback, eventTypes) {
return this.controller.addEventCallback(callback, eventTypes);
}
/**
* Removes callback with provided id from callback array
* @param callbackId
*/
removeEventCallback(callbackId) {
return this.controller.removeEventCallback(callbackId);
}
/**
* Registers a callback to receive performance events.
*
* @param {PerformanceCallbackFunction} callback
* @returns {string}
*/
addPerformanceCallback(callback) {
return this.controller.addPerformanceCallback(callback);
}
/**
* Removes a callback registered with addPerformanceCallback.
*
* @param {string} callbackId
* @returns {boolean}
*/
removePerformanceCallback(callbackId) {
return this.controller.removePerformanceCallback(callbackId);
}
/**
* 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 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.
* @param options Object containing optional configuration for redirect promise handling.
* @returns Token response or null. If the return value is null, then no auth redirect was detected.
*/
handleRedirectPromise(options) {
return this.controller.handleRedirectPromise(options);
}
/**
* 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);
}
/**
* 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);
}
/**
* 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
* @param correlationId
* @param pcaFactory
* @returns IPublicClientApplication
*
*/
async function createNestablePublicClientApplication(configuration, correlationId, pcaFactory) {
const nestedAppAuth = new NestedAppOperatingContext(configuration);
await nestedAppAuth.initialize(correlationId);
if (nestedAppAuth.isAvailable()) {
const cid = correlationId || createNewGuid();
const controller = new NestedAppAuthController(nestedAppAuth);
const nestablePCA = pcaFactory
? pcaFactory(configuration, controller)
: new PublicClientApplication(configuration, controller);
await nestablePCA.initialize({ correlationId: cid });
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

View File

@ -0,0 +1 @@
{"version":3,"file":"PublicClientApplication.mjs","sources":["../../src/app/PublicClientApplication.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AAmCH;;;AAGG;MACU,uBAAuB,CAAA;AAGhC;;;;;;;;;;;;;;;;;;;;;AAqBG;IACH,WAAmB,CAAA,aAA4B,EAAE,UAAwB,EAAA;AACrE,QAAA,IAAI,CAAC,UAAU;YACX,UAAU;gBACV,IAAI,kBAAkB,CAAC,IAAI,wBAAwB,CAAC,aAAa,CAAC,CAAC,CAAC;KAC3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AAC,CAAC;QAC9D,MAAM,WAAW,GAAG,UAAU;AAC1B,cAAE,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC;cACrC,IAAI,uBAAuB,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAC7D,MAAM,WAAW,CAAC,UAAU,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC;AACrD,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;;;;"}

View File

@ -0,0 +1,16 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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

View File

@ -0,0 +1 @@
{"version":3,"file":"NativeStatusCodes.mjs","sources":["../../../src/broker/nativeBroker/NativeStatusCodes.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEH;AACO,MAAM,yBAAyB,GAAG,4BAA4B;AAC9D,MAAM,WAAW,GAAG,cAAc;AAClC,MAAM,UAAU,GAAG,aAAa;AAGhC,MAAM,QAAQ,GAAG,WAAW;AAC5B,MAAM,mBAAmB,GAAG,sBAAsB;AAClD,MAAM,cAAc,GAAG;;;;"}

View File

@ -0,0 +1,156 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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("12mj4a", correlationId);
// @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("1h5q1r", correlationId);
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("02bcil", request.correlationId);
try {
const platformDOMRequest = this.initializePlatformDOMRequest(request);
const response =
// @ts-ignore
await window.navigator.platformAuthentication.executeGetToken(platformDOMRequest);
return this.validatePlatformBrokerResponse(response, request.correlationId);
}
catch (e) {
this.logger.error("11im7g", request.correlationId);
throw e;
}
}
initializePlatformDOMRequest(request) {
this.logger.trace("15d6yv", request.correlationId);
const { accountId, clientId, authority, scope, redirectUri, correlationId, state, storeInCache, embeddedClientId, extraParameters, ...remainingProperties } = request;
const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
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, correlationId) {
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("0h4vei", correlationId);
return this.convertToPlatformBrokerResponse(response, correlationId);
}
else if (response.hasOwnProperty("error")) {
const errorResponse = response;
if (errorResponse.isSuccess === false &&
errorResponse.error &&
errorResponse.error.code) {
this.logger.trace("0g92vm", correlationId);
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, correlationId) {
this.logger.trace("14913t", correlationId);
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, correlationId) {
try {
const stringifiedProperties = {};
for (const [key, value] of Object.entries(extraParameters)) {
if (!value) {
continue;
}
if (typeof value === "object") {
stringifiedProperties[key] = JSON.stringify(value);
}
else {
stringifiedProperties[key] = String(value);
}
}
return stringifiedProperties;
}
catch (e) {
this.logger.error("0eu9o3", correlationId);
this.logger.errorPii("17rpl5", correlationId);
return {};
}
}
}
export { PlatformAuthDOMHandler };
//# sourceMappingURL=PlatformAuthDOMHandler.mjs.map

View File

@ -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,CACR;;AAKJ,QAAA,IAAI,MAAM,CAAC,SAAS,EAAE,sBAAsB,EAAE;AAC1C,YAAA,MAAM,kBAAkB;;AAEpB,YAAA,MAAM,MAAM,CAAC,SAAS,CAAC,sBAAsB,CAAC,qBAAqB,CAC/D,qBAAqB,CAAC,wBAAwB,CACjD,CAAC;YACN,IACI,kBAAkB,EAAE,QAAQ,CACxB,qBAAqB,CAAC,iBAAiB,CAC1C,EACH;AACE,gBAAA,MAAM,CAAC,KAAK,CACR;gBAGJ,OAAO,IAAI,sBAAsB,CAC7B,MAAM,EACN,iBAAiB,EACjB,aAAa,CAChB,CAAC;AACL,aAAA;AACJ,SAAA;AACD,QAAA,OAAO,SAAS,CAAC;KACpB;AAED;;;AAGG;IACH,cAAc,GAAA;QACV,OAAO,qBAAqB,CAAC,wBAAwB,CAAC;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MAAM,qBAAqB,GAAe,EAAE,CAAC;AAC7C,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;gBACxD,IAAI,CAAC,KAAK,EAAE;oBACR,SAAS;AACZ,iBAAA;AACD,gBAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;oBAC3B,qBAAqB,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACtD,iBAAA;AAAM,qBAAA;oBACH,qBAAqB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9C,iBAAA;AACJ,aAAA;AACD,YAAA,OAAO,qBAAqB,CAAC;AAChC,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,QAAQ,EAAiB,aAAA,CAAA,CAAA;AAG7B,YAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAChB,QAAQ,EAAC,aAAA,CAAA,CAAgB;AAG7B,YAAA,OAAO,EAAE,CAAC;AACb,SAAA;KACJ;AACJ;;;;"}

View File

@ -0,0 +1,272 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { PlatformAuthConstants, NativeExtensionMethod } from '../../utils/BrowserConstants.mjs';
import { createAuthError, AuthErrorCodes } from '@azure/msal-common/browser';
import { NativeMessageHandlerHandshake } from '../../telemetry/BrowserPerformanceEvents.mjs';
import { createNativeAuthError } from '../../error/NativeAuthError.mjs';
import { createBrowserAuthError } from '../../error/BrowserAuthError.mjs';
import { createNewGuid } from '../../crypto/BrowserCrypto.mjs';
import { createGuid } from '../../utils/BrowserUtils.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 = this.performanceClient.startMeasurement(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("0on4p2", request.correlationId);
// 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("1qadfi", request.correlationId);
this.logger.tracePii("1xm533", request.correlationId);
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, correlationId) {
logger.trace("15zfnw", correlationId);
try {
const preferredProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, PlatformAuthConstants.PREFERRED_EXTENSION_ID);
await preferredProvider.sendHandshakeRequest(correlationId);
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(correlationId);
return backupProvider;
}
}
/**
* Send handshake request helper.
*/
async sendHandshakeRequest(correlationId) {
this.logger.trace("1dpg9o", correlationId);
// 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) {
const correlationId = createGuid();
this.logger.trace("0jpn5u", correlationId);
// 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("07buhm", correlationId);
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
? "0xrkug"
: "No extension installed", correlationId);
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) {
const correlationId = createGuid();
this.logger.trace("1py8yf", correlationId);
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("19hpgm", correlationId);
this.logger.tracePii("179a24", correlationId);
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("082qnt", correlationId);
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("0yf5ib", correlationId);
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("0xf978", correlationId);
this.logger.errorPii("04i99o", correlationId);
this.logger.errorPii("0xdvsy", correlationId);
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

View File

@ -0,0 +1,96 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { Logger, StubPerformanceClient, createClientConfigurationError, ClientConfigurationErrorCodes, Constants } 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';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Checks if the platform broker is available in the current environment.
* @param domConfig - Whether to enable platform broker DOM API support (required)
* @param loggerOptions - Optional logger options
* @param perfClient - Optional performance client
* @param correlationId - Optional correlation ID
* @returns Promise<boolean> indicating if platform broker is available
*/
async function isPlatformBrokerAvailable(domConfig, loggerOptions, perfClient, correlationId) {
const logger = new Logger(loggerOptions || {}, name, version);
const performanceClient = perfClient || new StubPerformanceClient();
if (typeof window === "undefined") {
logger.trace("082ed3", correlationId || createNewGuid());
return false;
}
return !!(await getPlatformAuthProvider(logger, performanceClient, correlationId || createNewGuid(), undefined, domConfig));
}
async function getPlatformAuthProvider(logger, performanceClient, correlationId, nativeBrokerHandshakeTimeout, enablePlatformBrokerDOMSupport) {
logger.trace("134j0v", correlationId);
logger.trace("04c81g", correlationId);
let platformAuthProvider;
try {
if (enablePlatformBrokerDOMSupport) {
// Check if DOM platform API is supported first
platformAuthProvider = await PlatformAuthDOMHandler.createProvider(logger, performanceClient, correlationId);
}
if (!platformAuthProvider) {
logger.trace("0l3na8", correlationId);
/*
* 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, correlationId);
}
}
catch (e) {
logger.trace("0icbd7", e);
}
return platformAuthProvider;
}
/**
* Returns boolean indicating whether or not the request should attempt to use platform broker
* @param logger
* @param config
* @param correlationId
* @param platformAuthProvider
* @param authenticationScheme
*/
function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvider, authenticationScheme) {
logger.trace("0uko3r", correlationId);
// throw an error if allowPlatformBroker is not enabled and allowPlatformBrokerWithDOM is enabled
if (!config.system.allowPlatformBroker &&
config.experimental.allowPlatformBrokerWithDOM) {
throw createClientConfigurationError(ClientConfigurationErrorCodes.invalidPlatformBrokerConfiguration);
}
if (!config.system.allowPlatformBroker) {
logger.trace("04hozs", correlationId);
// Developer disabled WAM
return false;
}
if (!platformAuthProvider) {
logger.trace("0kvv1r", correlationId);
// Platform broker auth providers are not available
return false;
}
if (authenticationScheme) {
switch (authenticationScheme) {
case Constants.AuthenticationScheme.BEARER:
case Constants.AuthenticationScheme.POP:
logger.trace("18tev1", correlationId);
return true;
default:
logger.trace("1dd2nh", correlationId);
return false;
}
}
return true;
}
export { getPlatformAuthProvider, isPlatformAuthAllowed, isPlatformBrokerAvailable };
//# sourceMappingURL=PlatformAuthProvider.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"PlatformAuthProvider.mjs","sources":["../../../src/broker/nativeBroker/PlatformAuthProvider.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;AAGG;AAqBH;;;;;;;AAOG;AACI,eAAe,yBAAyB,CAC3C,SAAkB,EAClB,aAA6B,EAC7B,UAA+B,EAC/B,aAAsB,EAAA;AAEtB,IAAA,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAE9D,IAAA,MAAM,iBAAiB,GAAG,UAAU,IAAI,IAAI,qBAAqB,EAAE,CAAC;AAEpE,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAC/B,MAAM,CAAC,KAAK,CACR,QAAmD,EAAA,aAAA,IAAA,aAAA,EAAA,CAAA,CAAA;AAGvD,QAAA,OAAO,KAAK,CAAC;AAChB,KAAA;IAED,OAAO,CAAC,EAAE,MAAM,uBAAuB,CACnC,MAAM,EACN,iBAAiB,EACjB,aAAa,IAAI,aAAa,EAAE,EAChC,SAAS,EACT,SAAS,CACZ,CAAC,CAAC;AACP,CAAC;AAEM,eAAe,uBAAuB,CACzC,MAAc,EACd,iBAAqC,EACrC,aAAqB,EACrB,4BAAqC,EACrC,8BAAwC,EAAA;AAExC,IAAA,MAAM,CAAC,KAAK,CAAC;IAEb,MAAM,CAAC,KAAK,CACR,QAAA,EAAA,aAAA,CAAA,CAAA;AAIJ,IAAA,IAAI,oBAAsD,CAAC;IAC3D,IAAI;AACA,QAAA,IAAI,8BAA8B,EAAE;;AAEhC,YAAA,oBAAoB,GAAG,MAAM,sBAAsB,CAAC,cAAc,CAC9D,MAAM,EACN,iBAAiB,EACjB,aAAa,CAChB,CAAC;AACL,SAAA;QACD,IAAI,CAAC,oBAAoB,EAAE;AACvB,YAAA,MAAM,CAAC,KAAK,CACR;AAGJ;;;AAGG;YACH,oBAAoB;AAChB,gBAAA,MAAM,4BAA4B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*! @azure/msal-browser v5.11.0 2026-05-19 */
'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("1yd030", correlationId);
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) {
logger.trace("0u7b90", correlationId);
const account = browserStorage.getAccountInfoFilteredBy(accountFilter, correlationId);
if (account) {
logger.verbose("0btgll", correlationId);
return account;
}
else {
logger.verbose("0ltaj5", correlationId);
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, getActiveAccount, getAllAccounts, setActiveAccount };
//# sourceMappingURL=AccountManager.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AccountManager.mjs","sources":["../../src/cache/AccountManager.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAKH;;;;AAIG;AACG,SAAU,cAAc,CAC1B,MAAc,EACd,cAAmC,EACnC,WAAoB,EACpB,aAAqB,EACrB,aAA6B,EAAA;AAE7B,IAAA,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAE,CAAA;AACxC,IAAA,OAAO,WAAW;UACZ,cAAc,CAAC,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC;UAC3D,EAAE,CAAC;AACb,CAAC;AAED;;;;AAIG;AACG,SAAU,UAAU,CACtB,aAA4B,EAC5B,MAAc,EACd,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,MAAM,CAAC,KAAK,CAAC,uBAAqB,CAAA,CAAA;IAClC,MAAM,OAAO,GAAuB,cAAc,CAAC,wBAAwB,CACvE,aAAa,EACb,aAAa,CAChB,CAAC;AAEF,IAAA,IAAI,OAAO,EAAE;AACT,QAAA,MAAM,CAAC,OAAO,CACV;AAGJ,QAAA,OAAO,OAAO,CAAC;AAClB,KAAA;AAAM,SAAA;AACH,QAAA,MAAM,CAAC,OAAO,CACV;AAGJ,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;;;;"}

View File

@ -0,0 +1,148 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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, correlationId) {
if (error instanceof BrowserAuthError &&
error.errorCode === databaseUnavailable) {
this.logger.error("1wx7zz", correlationId);
}
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
* @param correlationId
*/
async getItem(key, correlationId) {
const item = this.inMemoryCache.getItem(key);
if (!item) {
try {
this.logger.verbose("0naxpl", correlationId);
return await this.indexedDBCache.getItem(key);
}
catch (e) {
this.handleDatabaseAccessError(e, correlationId);
}
}
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
* @param correlationId
*/
async setItem(key, value, correlationId) {
this.inMemoryCache.setItem(key, value);
try {
await this.indexedDBCache.setItem(key, value);
}
catch (e) {
this.handleDatabaseAccessError(e, correlationId);
}
}
/**
* Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.
* @param key
* @param correlationId
*/
async removeItem(key, correlationId) {
this.inMemoryCache.removeItem(key);
try {
await this.indexedDBCache.removeItem(key);
}
catch (e) {
this.handleDatabaseAccessError(e, correlationId);
}
}
/**
* 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.
* @param correlationId
*/
async getKeys(correlationId) {
const cacheKeys = this.inMemoryCache.getKeys();
if (cacheKeys.length === 0) {
try {
this.logger.verbose("1iqrbq", correlationId);
return await this.indexedDBCache.getKeys();
}
catch (e) {
this.handleDatabaseAccessError(e, correlationId);
}
}
return cacheKeys;
}
/**
* Returns true or false if the given key is present in the cache.
* @param key
* @param correlationId
*/
async containsKey(key, correlationId) {
const containsKey = this.inMemoryCache.containsKey(key);
if (!containsKey) {
try {
this.logger.verbose("03zl2j", correlationId);
return await this.indexedDBCache.containsKey(key);
}
catch (e) {
this.handleDatabaseAccessError(e, correlationId);
}
}
return containsKey;
}
/**
* Clears in-memory Map
* @param correlationId
*/
clearInMemory(correlationId) {
// InMemory cache is a Map instance, clear is straightforward
this.logger.verbose("03r21p", correlationId);
this.inMemoryCache.clear();
this.logger.verbose("0uksk1", correlationId);
}
/**
* Tries to delete the IndexedDB database
* @param correlationId
* @returns
*/
async clearPersistent(correlationId) {
try {
this.logger.verbose("0rdqut", correlationId);
const dbDeleted = await this.indexedDBCache.deleteDatabase();
if (dbDeleted) {
this.logger.verbose("149ouc", correlationId);
}
return dbDeleted;
}
catch (e) {
this.handleDatabaseAccessError(e, correlationId);
return false;
}
}
}
export { AsyncMemoryStorage };
//# sourceMappingURL=AsyncMemoryStorage.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AsyncMemoryStorage.mjs","sources":["../../src/cache/AsyncMemoryStorage.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.databaseUnavailable"],"mappings":";;;;;;;AAAA;;;AAGG;AAWH;;;AAGG;MACU,kBAAkB,CAAA;AAK3B,IAAA,WAAA,CAAY,MAAc,EAAA;AACtB,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAK,CAAC;AAC5C,QAAA,IAAI,CAAC,cAAc,GAAG,IAAI,eAAe,EAAK,CAAC;AAC/C,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;IAEO,yBAAyB,CAC7B,KAAc,EACd,aAAqB,EAAA;QAErB,IACI,KAAK,YAAY,gBAAgB;AACjC,YAAA,KAAK,CAAC,SAAS,KAAKA,mBAAyC,EAC/D;YACE,IAAI,CAAC,MAAM,CAAC,KAAK,CACb,QAA6I,EAAA,aAAA,CAAA,CAAA;AAGpJ,SAAA;AAAM,aAAA;AACH,YAAA,MAAM,KAAK,CAAC;AACf,SAAA;KACJ;AACD;;;;;AAKG;AACH,IAAA,MAAM,OAAO,CAAC,GAAW,EAAE,aAAqB,EAAA;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE;YACP,IAAI;gBACA,IAAI,CAAC,MAAM,CAAC,OAAO,CACf,QAA6E,EAAA,aAAA,CAAA,CAAA;gBAGjF,OA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MAAM,CAAC,OAAO,CACf,QAA6B,EAAA,aAAA,CAAA,CAAA;AAGpC,aAAA;AAED,YAAA,OAAO,SAAS,CAAC;AACpB,SAAA;AAAC,QAAA,OAAO,CAAC,EAAE;AACR,YAAA,IAAI,CAAC,yBAAyB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;AACjD,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;KACJ;AACJ;;;;"}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,46 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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

View File

@ -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;;;;"}

View File

@ -0,0 +1,33 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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 = 3;
const ACCOUNT_SCHEMA_VERSION = 3;
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 VERSION_CACHE_KEY = `${PREFIX}.version`;
const ACCOUNT_KEYS = "account.keys";
const TOKEN_KEYS = "token.keys";
const SSO_CAPABLE = `${PREFIX}.${BROWSER_PREFIX}.sso.capable`;
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, PREFIX, SSO_CAPABLE, TOKEN_KEYS, VERSION_CACHE_KEY, getAccountKeysCacheKey, getTokenKeysCacheKey };
//# sourceMappingURL=CacheKeys.mjs.map

View File

@ -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;AAE7E,MAAA,iBAAiB,GAAG,CAAG,EAAA,MAAM,WAAW;AAC9C,MAAM,YAAY,GAAG,eAAe;AACpC,MAAM,UAAU,GAAG,aAAa;MAC1B,WAAW,GAAG,GAAG,MAAM,CAAA,CAAA,EAAI,cAAc,CAAA,YAAA,EAAe;AAErD,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;;;;"}

View File

@ -0,0 +1,95 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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].trim();
const eqIndex = cookie.indexOf("=");
const rawKey = eqIndex === -1 ? cookie : cookie.substring(0, eqIndex);
if (rawKey === name) {
const rawValue = eqIndex === -1 ? "" : cookie.substring(eqIndex + 1);
try {
return decodeURIComponent(rawValue);
}
catch {
return rawValue;
}
}
}
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 trimmed = cookie.trim();
const eqIndex = trimmed.indexOf("=");
const rawKey = eqIndex === -1 ? trimmed : trimmed.substring(0, eqIndex);
try {
keys.push(decodeURIComponent(rawKey));
}
catch {
// Skip cookies with malformed percent-encoded sequences in the key
}
});
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

View File

@ -0,0 +1 @@
{"version":3,"file":"CookieStorage.mjs","sources":["../../src/cache/CookieStorage.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAQH;AACA,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,GAA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;YAC7D,IAAI;gBACA,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AACzC,aAAA;YAAC,MAAM;;AAEP,aAAA;AACL,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;;;;"}

View File

@ -0,0 +1,209 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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

View File

@ -0,0 +1,14 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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

View File

@ -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;;;;"}

View File

@ -0,0 +1,310 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { invoke, invokeAsync } from '@azure/msal-common/browser';
import { Base64Decode, GenerateHKDF, GenerateBaseKey, UrlEncodeArr, ImportExistingCache, Decrypt, Encrypt } from '../telemetry/BrowserPerformanceEvents.mjs';
import { LocalStorageUpdated } from '../telemetry/BrowserRootPerformanceEvents.mjs';
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, Base64Decode, this.logger, this.performanceClient, correlationId)(parsedCookie.key);
this.encryptionCookie = {
id: parsedCookie.id,
key: await invokeAsync(generateHKDF, 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, GenerateBaseKey, this.logger, this.performanceClient, correlationId)();
const keyStr = invoke(urlEncodeArr, UrlEncodeArr, this.logger, this.performanceClient, correlationId)(new Uint8Array(baseKey));
this.encryptionCookie = {
id: id,
key: await invokeAsync(generateHKDF, 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), ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);
// Register listener for cache updates in other tabs
this.broadcast.addEventListener("message", (event) => {
this.updateCache(event, correlationId);
});
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, 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),
lastUpdatedAt: data.lastUpdatedAt,
};
}
catch (e) {
this.performanceClient.incrementFields({ encryptedCacheCorruptionCount: 1 }, correlationId);
return null;
}
}
setItem(key, value) {
window.localStorage.setItem(key, value);
}
async setUserData(key, value, correlationId, timestamp, kmsi) {
if (!this.initialized || !this.encryptionCookie) {
throw createBrowserAuthError(uninitializedPublicClientApplication);
}
if (kmsi) {
this.setItem(key, value);
}
else {
const { data, nonce } = await invokeAsync(encrypt, 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.setItem(key, JSON.stringify(encryptedData));
}
this.memoryStorage.setItem(key, value);
// 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 rawCache;
}
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;
}
this.performanceClient.incrementFields({ encryptedCacheCount: 1 }, correlationId);
return invokeAsync(decrypt, 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, correlationId) {
this.logger.trace("17cxcm", correlationId);
const perfMeasurement = this.performanceClient.startMeasurement(LocalStorageUpdated);
perfMeasurement.add({ isBackground: true });
const { key, value, context } = event.data;
if (!key) {
this.logger.error("0e10qr", correlationId);
perfMeasurement.end({ success: false, errorCode: "noKey" });
return;
}
if (context && context !== this.clientId) {
this.logger.trace("04rtdy", correlationId);
perfMeasurement.end({
success: false,
errorCode: "contextMismatch",
});
return;
}
if (!value) {
this.memoryStorage.removeItem(key);
this.logger.verbose("04ypih", correlationId);
}
else {
this.memoryStorage.setItem(key, value);
this.logger.verbose("1vzsgt", correlationId);
}
perfMeasurement.end({ success: true });
}
}
export { LocalStorage };
//# sourceMappingURL=LocalStorage.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,49 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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

View File

@ -0,0 +1 @@
{"version":3,"file":"MemoryStorage.mjs","sources":["../../src/cache/MemoryStorage.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;MAIU,aAAa,CAAA;AAGtB,IAAA,WAAA,GAAA;AACI,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAa,CAAC;KACrC;AAED,IAAA,MAAM,UAAU,GAAA;;KAEf;AAED,IAAA,OAAO,CAAC,GAAW,EAAA;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;KACtC;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KAC5B;IAED,OAAO,CAAC,GAAW,EAAE,KAAQ,EAAA;QACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC9B;AAED,IAAA,MAAM,WAAW,CAAC,GAAW,EAAE,KAAQ,EAAA;AACnC,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC5B;AAED,IAAA,UAAU,CAAC,GAAW,EAAA;AAClB,QAAA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC1B;IAED,OAAO,GAAA;QACH,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAQ,EAAE,GAAW,KAAI;AACzC,YAAA,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,SAAC,CAAC,CAAC;AACH,QAAA,OAAO,SAAS,CAAC;KACpB;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC9B;IAED,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;KACtB;IAED,WAAW,GAAA;;AAEP,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAChC;AACJ;;;;"}

View File

@ -0,0 +1,47 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'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

View File

@ -0,0 +1 @@
{"version":3,"file":"SessionStorage.mjs","sources":["../../src/cache/SessionStorage.ts"],"sourcesContent":[null],"names":["BrowserConfigurationAuthErrorCodes.storageNotSupported"],"mappings":";;;;;AAAA;;;AAGG;MAQU,cAAc,CAAA;AACvB,IAAA,WAAA,GAAA;AACI,QAAA,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;AACxB,YAAA,MAAM,mCAAmC,CACrCA,mBAAsD,CACzD,CAAC;AACL,SAAA;KACJ;AAED,IAAA,MAAM,UAAU,GAAA;;KAEf;AAED,IAAA,OAAO,CAAC,GAAW,EAAA;QACf,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KAC7C;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KAC5B;IAED,OAAO,CAAC,GAAW,EAAE,KAAa,EAAA;QAC9B,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC7C;AAED,IAAA,MAAM,WAAW,CAAC,GAAW,EAAE,KAAa,EAAA;AACxC,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAC5B;AAED,IAAA,UAAU,CAAC,GAAW,EAAA;AAClB,QAAA,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;KACzC;IAED,OAAO,GAAA;QACH,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;KAC7C;AAED,IAAA,WAAW,CAAC,GAAW,EAAA;QACnB,OAAO,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;KACpD;IAED,WAAW,GAAA;;AAEP,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAChC;AACJ;;;;"}

View File

@ -0,0 +1,218 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { StubPerformanceClient, AuthToken, Logger, buildStaticAuthorityOptions, AuthorityFactory, Authority, invokeAsync, AccountEntityUtils, buildAccountToCache, CacheHelpers, ScopeSet, TimeUtils } from '@azure/msal-common/browser';
import { buildConfiguration } from '../config/Configuration.mjs';
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
import { CryptoOps } from '../crypto/CryptoOps.mjs';
import { base64Decode } from '../encode/Base64Decode.mjs';
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
import { EventHandler } from '../event/EventHandler.mjs';
import { LoadAccount, LoadIdToken, LoadAccessToken, LoadRefreshToken } from '../telemetry/BrowserPerformanceEvents.mjs';
import { LoadExternalTokens } from '../telemetry/BrowserRootPerformanceEvents.mjs';
import { ApiId } from '../utils/BrowserConstants.mjs';
import { blockNonBrowserEnvironment } from '../utils/BrowserUtils.mjs';
import { BrowserCacheManager } from './BrowserCacheManager.mjs';
import { unableToLoadToken } from '../error/BrowserAuthErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* API to load tokens to msal-browser cache.
* @param config - Object to configure the MSAL app.
* @param request - Silent request containing authority, scopes, and account.
* @param response - External token response to load into the cache.
* @param options - Options controlling how tokens are loaded into the cache.
* @param performanceClient - Optional performance client used for telemetry measurements.
* @returns `AuthenticationResult` for the response that was loaded.
*/
async function loadExternalTokens(config, request, response, options, performanceClient = new StubPerformanceClient()) {
blockNonBrowserEnvironment();
const browserConfig = buildConfiguration(config, true);
const correlationId = request.correlationId || createNewGuid();
const rootMeasurement = performanceClient.startMeasurement(LoadExternalTokens, correlationId);
try {
const idTokenClaims = response.id_token
? AuthToken.extractTokenClaims(response.id_token, base64Decode)
: undefined;
const kmsi = AuthToken.isKmsi(idTokenClaims || {});
const authorityOptions = {
protocolMode: browserConfig.system.protocolMode,
knownAuthorities: browserConfig.auth.knownAuthorities,
cloudDiscoveryMetadata: browserConfig.auth.cloudDiscoveryMetadata,
authorityMetadata: browserConfig.auth.authorityMetadata,
};
const logger = new Logger(browserConfig.system.loggerOptions || {});
const cryptoOps = new CryptoOps(logger, browserConfig.telemetry.client);
const storage = new BrowserCacheManager(browserConfig.auth.clientId, browserConfig.cache, cryptoOps, logger, browserConfig.telemetry.client, new EventHandler(logger), buildStaticAuthorityOptions(browserConfig.auth));
const authorityString = request.authority || browserConfig.auth.authority;
const authority = await AuthorityFactory.createDiscoveredInstance(Authority.generateAuthority(authorityString, request.azureCloudOptions), browserConfig.system.networkClient, storage, authorityOptions, logger, correlationId, performanceClient);
const cacheRecordAccount = await invokeAsync(loadAccount, LoadAccount, logger, performanceClient, correlationId)(request, options.clientInfo || response.client_info || "", correlationId, storage, logger, cryptoOps, authority, idTokenClaims, performanceClient);
const idToken = await invokeAsync(loadIdToken, LoadIdToken, logger, performanceClient, correlationId)(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, kmsi, correlationId, storage, logger, config.auth.clientId);
const accessToken = await invokeAsync(loadAccessToken, LoadAccessToken, logger, performanceClient, correlationId)(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, kmsi, options, correlationId, storage, logger, config.auth.clientId);
const refreshToken = await invokeAsync(loadRefreshToken, LoadRefreshToken, logger, performanceClient, correlationId)(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, kmsi, correlationId, storage, logger, config.auth.clientId, performanceClient);
rootMeasurement.end({ success: true }, undefined, AccountEntityUtils.getAccountInfo(cacheRecordAccount));
return generateAuthenticationResult(request, {
account: cacheRecordAccount,
idToken,
accessToken,
refreshToken,
}, authority, idTokenClaims);
}
catch (error) {
rootMeasurement.end({ success: false }, error);
throw error;
}
}
/**
* Helper function to load account to msal-browser cache
* @param idToken
* @param environment
* @param clientInfo
* @param authorityType
* @param requestHomeAccountId
* @returns `AccountEntity`
*/
async function loadAccount(request, clientInfo, correlationId, storage, logger, cryptoObj, authority, idTokenClaims, performanceClient) {
logger.verbose("0ke46k", correlationId);
if (request.account) {
const accountEntity = AccountEntityUtils.createAccountEntityFromAccountInfo(request.account);
await storage.setAccount(accountEntity, correlationId, AuthToken.isKmsi(idTokenClaims || {}), ApiId.loadExternalTokens);
return accountEntity;
}
else if (!clientInfo && !idTokenClaims) {
logger.error("0hzcn4", correlationId);
throw createBrowserAuthError(unableToLoadToken);
}
const homeAccountId = AccountEntityUtils.generateHomeAccountId(clientInfo, authority.authorityType, logger, cryptoObj, correlationId, idTokenClaims);
const claimsTenantId = idTokenClaims?.tid;
const cachedAccount = buildAccountToCache(storage, authority, homeAccountId, base64Decode, correlationId, idTokenClaims, clientInfo, authority.getPreferredCache(), claimsTenantId, undefined, // authCodePayload
undefined, // nativeAccountId
logger, performanceClient);
await storage.setAccount(cachedAccount, correlationId, AuthToken.isKmsi(idTokenClaims || {}), ApiId.loadExternalTokens);
return cachedAccount;
}
/**
* Helper function to load id tokens to msal-browser cache
* @param idToken
* @param homeAccountId
* @param environment
* @param tenantId
* @returns `IdTokenEntity`
*/
async function loadIdToken(response, homeAccountId, environment, tenantId, kmsi, correlationId, storage, logger, clientId) {
if (!response.id_token) {
logger.verbose("1pm7g1", correlationId);
return null;
}
logger.verbose("168lyi", correlationId);
const idTokenEntity = CacheHelpers.createIdTokenEntity(homeAccountId, environment, response.id_token, clientId, tenantId);
await storage.setIdTokenCredential(idTokenEntity, correlationId, kmsi);
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 function loadAccessToken(request, response, homeAccountId, environment, tenantId, kmsi, options, correlationId, storage, logger, clientId) {
if (!response.access_token) {
logger.verbose("1ckp9e", correlationId);
return null;
}
else if (!response.expires_in) {
logger.error("15mzx8", correlationId);
return null;
}
else if (!response.scope && (!request.scopes || !request.scopes.length)) {
logger.error("1h7xse", correlationId);
return null;
}
logger.verbose("01kmxb", correlationId);
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, clientId, tenantId, scopes.printScopes(), expiresOn, extendedExpiresOn, base64Decode);
await storage.setAccessTokenCredential(accessTokenEntity, correlationId, kmsi);
return accessTokenEntity;
}
/**
* Helper function to load refresh tokens to msal-browser cache
* @param request
* @param response
* @param homeAccountId
* @param environment
* @returns `RefreshTokenEntity`
*/
async function loadRefreshToken(response, homeAccountId, environment, kmsi, correlationId, storage, logger, clientId, performanceClient) {
if (!response.refresh_token) {
logger.verbose("1l7um5", correlationId);
return null;
}
const expiresOn = response.refresh_token_expires_in
? response.refresh_token_expires_in + TimeUtils.nowSeconds()
: undefined;
performanceClient.addFields({
extRtExpiresOnSeconds: expiresOn,
}, correlationId);
logger.verbose("0qy8ev", correlationId);
const refreshTokenEntity = CacheHelpers.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, clientId, response.foci, undefined, // userAssertionHash
expiresOn);
await storage.setRefreshTokenCredential(refreshTokenEntity, correlationId, kmsi);
return refreshTokenEntity;
}
/**
* Helper function to generate an `AuthenticationResult` for the result.
* @param request
* @param idTokenObj
* @param cacheRecord
* @param authority
* @returns `AuthenticationResult`
*/
function generateAuthenticationResult(request, cacheRecord, authority, idTokenClaims) {
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.canonicalAuthority,
uniqueId: cacheRecord.account.localAccountId,
tenantId: cacheRecord.account.realm,
scopes: responseScopes,
account: AccountEntityUtils.getAccountInfo(accountEntity),
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 || "",
fromPlatformBroker: false,
};
}
export { loadExternalTokens };
//# sourceMappingURL=TokenCache.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,136 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { StubPerformanceClient, ProtocolMode, Logger, LogLevel, createClientConfigurationError, ClientConfigurationErrorCodes, StubbedNetworkModule, DEFAULT_SYSTEM_OPTIONS, Constants, AzureCloudInstance } from '@azure/msal-common/browser';
import { BrowserCacheLocation } from '../utils/BrowserConstants.mjs';
import { NavigationClient } from '../navigation/NavigationClient.mjs';
import { FetchClient } from '../network/FetchClient.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, experimental: userInputExperimental, telemetry: userInputTelemetry, }, isBrowserEnvironment) {
// Default auth options for browser
const DEFAULT_AUTH_OPTIONS = {
clientId: "",
authority: `${Constants.DEFAULT_AUTHORITY}`,
knownAuthorities: [],
cloudDiscoveryMetadata: "",
authorityMetadata: "",
redirectUri: typeof window !== "undefined" && window.location
? window.location.href.split("?")[0].split("#")[0]
: "",
postLogoutRedirectUri: "",
clientCapabilities: [],
OIDCOptions: {
responseMode: Constants.ResponseMode.FRAGMENT,
defaultScopes: [
Constants.OPENID_SCOPE,
Constants.PROFILE_SCOPE,
Constants.OFFLINE_ACCESS_SCOPE,
],
},
azureCloudOptions: {
azureCloudInstance: AzureCloudInstance.None,
tenant: "",
},
instanceAware: false,
isMcp: false,
verifySSO: false,
};
// Default cache options for browser
const DEFAULT_CACHE_OPTIONS = {
cacheLocation: BrowserCacheLocation.SessionStorage,
cacheRetentionDays: 5,
};
// 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(),
popupBridgeTimeout: userInputSystem?.popupBridgeTimeout || DEFAULT_POPUP_TIMEOUT_MS,
iframeBridgeTimeout: userInputSystem?.iframeBridgeTimeout || DEFAULT_IFRAME_TIMEOUT_MS,
redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,
allowRedirectInIframe: false,
navigatePopups: true,
allowPlatformBroker: false,
nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||
DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
protocolMode: ProtocolMode.AAD,
};
const providedSystemOptions = {
...DEFAULT_BROWSER_SYSTEM_OPTIONS,
...userInputSystem,
loggerOptions: userInputSystem?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
};
const DEFAULT_TELEMETRY_OPTIONS = {
application: {
appName: "",
appVersion: "",
},
client: new StubPerformanceClient(),
};
const DEFAULT_EXPERIMENTAL_OPTIONS = {
iframeTimeoutTelemetry: false,
allowPlatformBrokerWithDOM: false,
};
// Throw an error if user has set OIDCOptions without being in OIDC protocol mode
if (userInputSystem?.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 (userInputSystem?.protocolMode &&
userInputSystem.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,
experimental: {
...DEFAULT_EXPERIMENTAL_OPTIONS,
...userInputExperimental,
},
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

View File

@ -0,0 +1 @@
{"version":3,"file":"Configuration.mjs","sources":["../../src/config/Configuration.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AA0BH;AACO,MAAM,wBAAwB,GAAG,MAAM;AACvC,MAAM,yBAAyB,GAAG,MAAM;AACxC,MAAM,2BAA2B,GAAG,MAAM;AAC1C,MAAM,0CAA0C,GAAG,KAAK;AAuM/D;;;;;;;;AAQG;AACG,SAAU,kBAAkB,CAC9B,EACI,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,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AAI,MAAM,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;AAC/D,QAAA,MAAM,CAAC,OAAO,CACV,IAAI,CAAC,SAAS,CACV,8BAA8B,CAC1B,6BAA6B,CAAC,oBAAoB,CACrD,CACJ,EACD,EAAE,CACL,CAAC;AACL,KAAA;;IAGD,IACI,eAAe,EAAE,YAAY;AAC7B,QAAA,eAAe,CAAC,YAAY,KAAK,YAAY,CAAC,IAAI;QAClD,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,YAAY,EAAE;AACV,YAAA,GAAG,4BAA4B;AAC/B,YAAA,GAAG,qBAAqB;AAC3B,SAAA;AACD,QAAA,SAAS,EAAE,EAAE,GAAG,yBAAyB,EAAE,GAAG,kBAAkB,EAAE;KACrE,CAAC;AAEF,IAAA,OAAO,eAAe,CAAC;AAC3B;;;;"}

View File

@ -0,0 +1,481 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { DEFAULT_CRYPTO_IMPLEMENTATION, buildStaticAuthorityOptions, enforceResourceParameter, TimeUtils, AuthError, Constants, AccountEntityUtils, AuthToken } from '@azure/msal-common/browser';
import { AcquireTokenPopup, SsoSilent, AcquireTokenSilent } from '../telemetry/BrowserRootPerformanceEvents.mjs';
import { InteractionType, CacheLookupPolicy, DEFAULT_REQUEST, ApiId } from '../utils/BrowserConstants.mjs';
import { CryptoOps } from '../crypto/CryptoOps.mjs';
import { NestedAppAuthAdapter } from '../naa/mapping/NestedAppAuthAdapter.mjs';
import { NestedAppAuthError } from '../error/NestedAppAuthError.mjs';
import { EventHandler } from '../event/EventHandler.mjs';
import { EventType } from '../event/EventType.mjs';
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.mjs';
import { getAccount, getAllAccounts, setActiveAccount, getActiveAccount } from '../cache/AccountManager.mjs';
import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class NestedAppAuthController {
constructor(operatingContext) {
this.operatingContext = operatingContext;
const proxy = this.operatingContext.getBridgeProxy();
if (proxy !== undefined) {
this.bridgeProxy = proxy;
}
else {
throw new Error("unexpected: bridgeProxy is undefined");
}
// Set the configuration.
this.config = operatingContext.getConfig();
// Initialize logger
this.logger = this.operatingContext.getLogger();
// Initialize performance client
this.performanceClient = this.config.telemetry.client;
// Initialize the crypto class.
this.browserCrypto = operatingContext.isBrowserEnvironment()
? new CryptoOps(this.logger, this.performanceClient, true)
: DEFAULT_CRYPTO_IMPLEMENTATION;
this.eventHandler = new EventHandler(this.logger);
// Initialize the browser storage class.
this.browserStorage = this.operatingContext.isBrowserEnvironment()
? new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger, this.performanceClient, this.eventHandler, buildStaticAuthorityOptions(this.config.auth))
: DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger, this.performanceClient, this.eventHandler);
this.nestedAppAuthAdapter = new NestedAppAuthAdapter(this.config.auth.clientId, this.config.auth.clientCapabilities, this.browserCrypto, this.logger);
// Set the active account if available
const accountContext = this.bridgeProxy.getAccountContext();
this.currentAccountContext = accountContext ? accountContext : null;
}
/**
* Factory function to create a new instance of NestedAppAuthController
* @param operatingContext
* @returns Promise<IController>
*/
static async createController(operatingContext) {
const controller = new NestedAppAuthController(operatingContext);
return Promise.resolve(controller);
}
/**
* Specific implementation of initialize function for NestedAppAuthController
* @returns
*/
async initialize(request,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
isBroker) {
const initCorrelationId = request?.correlationId || createNewGuid();
await this.browserStorage.initialize(initCorrelationId);
return Promise.resolve();
}
/**
* Validate the incoming request and add correlationId if not present
* @param request
* @returns
*/
ensureValidRequest(request) {
if (request?.correlationId) {
return request;
}
return {
...request,
correlationId: this.browserCrypto.createNewGuid(),
};
}
/**
* Internal implementation of acquireTokenInteractive flow
* @param request
* @returns
*/
async acquireTokenInteractive(request) {
const validRequest = this.ensureValidRequest(request);
const correlationId = validRequest.correlationId || createNewGuid();
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, InteractionType.Popup, validRequest);
const atPopupMeasurement = this.performanceClient.startMeasurement(AcquireTokenPopup, correlationId);
atPopupMeasurement.add({ nestedAppAuthRequest: true });
try {
enforceResourceParameter(this.config.auth.isMcp, validRequest);
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
const reqTimestamp = TimeUtils.nowSeconds();
const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
const result = {
...this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp),
};
// cache the tokens in the response
try {
// cache hydration can fail in JS Runtime scenario that doesn't support full crypto API
await this.hydrateCache(result, request);
}
catch (error) {
this.logger.warningPii("1mwr91", correlationId);
}
// cache the account context in memory after successful token fetch
this.currentAccountContext = {
homeAccountId: result.account.homeAccountId,
environment: result.account.environment,
tenantId: result.account.tenantId,
};
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, correlationId, InteractionType.Popup, result);
atPopupMeasurement.add({
accessTokenSize: result.accessToken.length,
idTokenSize: result.idToken.length,
});
atPopupMeasurement.end({
success: true,
requestId: result.requestId,
}, undefined, result.account);
return result;
}
catch (e) {
const error = e instanceof AuthError
? e
: this.nestedAppAuthAdapter.fromBridgeError(e);
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, correlationId, InteractionType.Popup, null, e);
atPopupMeasurement.end({
success: false,
}, e, request.account);
throw error;
}
}
/**
* Internal implementation of acquireTokenSilent flow
* @param request
* @returns
*/
async acquireTokenSilentInternal(request) {
const validRequest = this.ensureValidRequest(request);
const correlationId = validRequest.correlationId || createNewGuid();
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, InteractionType.Silent, validRequest);
// Look for tokens in the cache first
const result = await this.acquireTokenFromCache(validRequest);
if (result) {
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, correlationId, InteractionType.Silent, result);
return result;
}
// proceed with acquiring tokens via the host
const ssoSilentMeasurement = this.performanceClient.startMeasurement(SsoSilent, correlationId);
ssoSilentMeasurement.increment({
visibilityChangeCount: 0,
});
ssoSilentMeasurement.add({
nestedAppAuthRequest: true,
});
try {
enforceResourceParameter(this.config.auth.isMcp, validRequest);
const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
naaRequest.forceRefresh = validRequest.forceRefresh;
const reqTimestamp = TimeUtils.nowSeconds();
const response = await this.bridgeProxy.getTokenSilent(naaRequest);
const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
// cache the tokens in the response
try {
// cache hydration can fail in JS Runtime scenario that doesn't support full crypto API
await this.hydrateCache(result, request);
}
catch (error) {
this.logger.warningPii("1mwr91", correlationId);
}
// cache the account context in memory after successful token fetch
this.currentAccountContext = {
homeAccountId: result.account.homeAccountId,
environment: result.account.environment,
tenantId: result.account.tenantId,
};
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, correlationId, InteractionType.Silent, result);
ssoSilentMeasurement?.add({
accessTokenSize: result.accessToken.length,
idTokenSize: result.idToken.length,
});
ssoSilentMeasurement?.end({
success: true,
requestId: result.requestId,
}, undefined, result.account);
return result;
}
catch (e) {
const error = e instanceof AuthError
? e
: this.nestedAppAuthAdapter.fromBridgeError(e);
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, correlationId, InteractionType.Silent, null, e);
ssoSilentMeasurement?.end({
success: false,
}, e, request.account);
throw error;
}
}
/**
* acquires tokens from cache
* @param request
* @returns
*/
async acquireTokenFromCache(request) {
const correlationId = request.correlationId || createNewGuid();
const atsMeasurement = this.performanceClient.startMeasurement(AcquireTokenSilent, correlationId);
atsMeasurement?.add({
nestedAppAuthRequest: true,
});
// if the request has claims, we cannot look up in the cache
if (request.claims) {
this.logger.verbose("11t57w", correlationId);
return null;
}
// if the request has forceRefresh, we cannot look up in the cache
if (request.forceRefresh) {
this.logger.verbose("1ovnmo", correlationId);
return null;
}
// respect cache lookup policy
let result = null;
if (!request.cacheLookupPolicy) {
request.cacheLookupPolicy = CacheLookupPolicy.Default;
}
switch (request.cacheLookupPolicy) {
case CacheLookupPolicy.Default:
case CacheLookupPolicy.AccessToken:
case CacheLookupPolicy.AccessTokenAndRefreshToken:
result = await this.acquireTokenFromCacheInternal(request);
break;
default:
return null;
}
if (result) {
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, correlationId, InteractionType.Silent, result);
atsMeasurement.add({
accessTokenSize: result.accessToken.length,
idTokenSize: result.idToken.length,
});
atsMeasurement.end({
success: true,
}, undefined, result.account);
return result;
}
this.logger.warning("1yb4fi", correlationId);
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, correlationId, InteractionType.Silent, null);
atsMeasurement.end({
success: false,
}, undefined, request.account);
return null;
}
/**
*
* @param request
* @returns
*/
async acquireTokenFromCacheInternal(request) {
// always prioritize the account context from the bridge
const accountContext = this.bridgeProxy.getAccountContext() || this.currentAccountContext;
const correlationId = request.correlationId || createNewGuid();
let currentAccount = null;
if (accountContext) {
currentAccount = getAccount(accountContext, this.logger, this.browserStorage, correlationId);
}
// fall back to brokering if no cached account is found
if (!currentAccount) {
this.logger.verbose("10qnr0", correlationId);
return Promise.resolve(null);
}
this.logger.verbose("1u7hux", correlationId);
const authRequest = {
...request,
correlationId: correlationId,
authority: request.authority || currentAccount.environment,
scopes: request.scopes?.length
? request.scopes
: [...Constants.OIDC_DEFAULT_SCOPES],
};
// fetch access token and check for expiry
const tokenKeys = this.browserStorage.getTokenKeys();
const cachedAccessToken = this.browserStorage.getAccessToken(currentAccount, authRequest, tokenKeys, currentAccount.tenantId);
// If there is no access token, log it and return null
if (!cachedAccessToken) {
this.logger.verbose("03vm49", correlationId);
return Promise.resolve(null);
}
else if (TimeUtils.wasClockTurnedBack(cachedAccessToken.cachedAt) ||
TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.system.tokenRenewalOffsetSeconds)) {
this.logger.verbose("18egye", correlationId);
return Promise.resolve(null);
}
else if (authRequest.resource) {
const requestedResource = authRequest.resource;
const cachedResource = cachedAccessToken.resource;
if (!cachedResource || cachedResource !== requestedResource) {
this.logger.verbose("0qraxd", correlationId);
return Promise.resolve(null);
}
}
const cachedIdToken = this.browserStorage.getIdToken(currentAccount, authRequest.correlationId, tokenKeys, currentAccount.tenantId);
if (!cachedIdToken) {
this.logger.verbose("0d68kd", correlationId);
return Promise.resolve(null);
}
return this.nestedAppAuthAdapter.toAuthenticationResultFromCache(currentAccount, cachedIdToken, cachedAccessToken, authRequest, authRequest.correlationId);
}
/**
* acquireTokenPopup flow implementation
* @param request
* @returns
*/
async acquireTokenPopup(request) {
return this.acquireTokenInteractive(request);
}
/**
* acquireTokenRedirect flow is not supported in nested app auth
* @param request
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
acquireTokenRedirect(request) {
throw NestedAppAuthError.createUnsupportedError();
}
/**
* acquireTokenSilent flow implementation
* @param silentRequest
* @returns
*/
async acquireTokenSilent(silentRequest) {
return this.acquireTokenSilentInternal(silentRequest);
}
/**
* Hybrid flow is not currently supported in nested app auth
* @param request
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
acquireTokenByCode(request // eslint-disable-line @typescript-eslint/no-unused-vars
) {
throw NestedAppAuthError.createUnsupportedError();
}
/**
* Adds event callbacks to array
* @param callback
* @param eventTypes
*/
addEventCallback(callback, eventTypes) {
return this.eventHandler.addEventCallback(callback, eventTypes);
}
/**
* Removes callback with provided id from callback array
* @param callbackId
*/
removeEventCallback(callbackId) {
this.eventHandler.removeEventCallback(callbackId);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
addPerformanceCallback(callback) {
throw NestedAppAuthError.createUnsupportedError();
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
removePerformanceCallback(callbackId) {
throw NestedAppAuthError.createUnsupportedError();
}
// #region Account APIs
/**
* Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
* @param accountFilter - (Optional) filter to narrow down the accounts returned
* @returns Array of AccountInfo objects in cache
*/
getAllAccounts(accountFilter) {
return getAllAccounts(this.logger, this.browserStorage, this.isBrowserEnv(), createNewGuid(), accountFilter);
}
/**
* Returns the first account found in the cache that matches the account filter passed in.
* @param accountFilter
* @returns The first account found in the cache matching the provided filter or null if no account could be found.
*/
getAccount(accountFilter) {
return getAccount(accountFilter, this.logger, this.browserStorage, createNewGuid());
}
/**
* Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
* @param account
*/
setActiveAccount(account) {
/*
* StandardController uses this to allow the developer to set the active account
* in the nested app auth scenario the active account is controlled by the app hosting the nested app
*/
return setActiveAccount(account, this.browserStorage, createNewGuid());
}
/**
* Gets the currently active account
*/
getActiveAccount() {
return getActiveAccount(this.browserStorage, createNewGuid());
}
// #endregion
handleRedirectPromise(options // eslint-disable-line @typescript-eslint/no-unused-vars
) {
return Promise.resolve(null);
}
loginPopup(request // eslint-disable-line @typescript-eslint/no-unused-vars
) {
return this.acquireTokenInteractive(request || DEFAULT_REQUEST);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
loginRedirect(request) {
throw NestedAppAuthError.createUnsupportedError();
}
logoutRedirect(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars
) {
throw NestedAppAuthError.createUnsupportedError();
}
logoutPopup(logoutRequest // eslint-disable-line @typescript-eslint/no-unused-vars
) {
throw NestedAppAuthError.createUnsupportedError();
}
ssoSilent(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
request) {
return this.acquireTokenSilentInternal(request);
}
/**
* Returns the logger instance
*/
getLogger() {
return this.logger;
}
/**
* Replaces the default logger set in configurations with new Logger with new configurations
* @param logger Logger instance
*/
setLogger(logger) {
this.logger = logger;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
initializeWrapperLibrary(sku, version) {
/*
* Standard controller uses this to set the sku and version of the wrapper library in the storage
* we do nothing here
*/
return;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
setNavigationClient(navigationClient) {
this.logger.warning("1k8729", "");
}
getConfiguration() {
return this.config;
}
isBrowserEnv() {
return this.operatingContext.isBrowserEnvironment();
}
getBrowserCrypto() {
return this.browserCrypto;
}
getPerformanceClient() {
throw NestedAppAuthError.createUnsupportedError();
}
getRedirectResponse() {
throw NestedAppAuthError.createUnsupportedError();
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async clearCache(logoutRequest) {
throw NestedAppAuthError.createUnsupportedError();
}
async hydrateCache(result, request) {
this.logger.verbose("16jycr", result.correlationId);
const accountEntity = AccountEntityUtils.createAccountEntityFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
await this.browserStorage.setAccount(accountEntity, result.correlationId, AuthToken.isKmsi(result.idTokenClaims), ApiId.hydrateCache);
return this.browserStorage.hydrateCache(result, request);
}
}
export { NestedAppAuthController };
//# sourceMappingURL=NestedAppAuthController.mjs.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

View File

@ -0,0 +1,306 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
import { KEY_FORMAT_JWK } from '../utils/BrowserConstants.mjs';
import { urlEncodeArr, base64Encode } from '../encode/Base64Encode.mjs';
import { base64DecToArr, base64Decode } from '../encode/Base64Decode.mjs';
import { nonBrowserEnvironment, cryptoNonExistent, failedToDecryptEarResponse } from '../error/BrowserAuthErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* This file defines functions used by the browser library to perform cryptography operations such as
* hashing and encoding. It also has helper functions to validate the availability of specific APIs.
*/
/**
* See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams
*/
// Algorithms
const PKCS1_V15_KEYGEN_ALG = "RSASSA-PKCS1-v1_5";
const AES_GCM = "AES-GCM";
const HKDF = "HKDF";
// SHA-256 hashing algorithm
const S256_HASH_ALG = "SHA-256";
// MOD length for PoP tokens
const MODULUS_LENGTH = 2048;
// Public Exponent
const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
// UUID hex digits
const UUID_CHARS = "0123456789abcdef";
// Array to store UINT32 random value
const UINT32_ARR = new Uint32Array(1);
// Key Format
const RAW = "raw";
// Key Usages
const ENCRYPT = "encrypt";
const DECRYPT = "decrypt";
const DERIVE_KEY = "deriveKey";
// Suberror
const SUBTLE_SUBERROR = "crypto_subtle_undefined";
const keygenAlgorithmOptions = {
name: PKCS1_V15_KEYGEN_ALG,
hash: S256_HASH_ALG,
modulusLength: MODULUS_LENGTH,
publicExponent: PUBLIC_EXPONENT,
};
/**
* Check whether browser crypto is available.
*/
function validateCryptoAvailable(skipValidateSubtleCrypto) {
if (!window) {
throw createBrowserAuthError(nonBrowserEnvironment);
}
if (!window.crypto) {
throw createBrowserAuthError(cryptoNonExistent);
}
if (!skipValidateSubtleCrypto && !window.crypto.subtle) {
throw createBrowserAuthError(cryptoNonExistent, SUBTLE_SUBERROR);
}
}
/**
* Returns a sha-256 hash of the given dataString as an ArrayBuffer.
* @param dataString {string} data string
* @param performanceClient {?IPerformanceClient}
* @param correlationId {?string} correlation id
*/
async function sha256Digest(dataString) {
const encoder = new TextEncoder();
const data = encoder.encode(dataString);
return window.crypto.subtle.digest(S256_HASH_ALG, data);
}
/**
* Populates buffer with cryptographically random values.
* @param dataBuffer
*/
function getRandomValues(dataBuffer) {
return window.crypto.getRandomValues(dataBuffer);
}
/**
* Returns random Uint32 value.
* @returns {number}
*/
function getRandomUint32() {
window.crypto.getRandomValues(UINT32_ARR);
return UINT32_ARR[0];
}
/**
* Creates a UUID v7 from the current timestamp.
* Implementation relies on the system clock to guarantee increasing order of generated identifiers.
* @returns {number}
*/
function createNewGuid() {
const currentTimestamp = Date.now();
const baseRand = getRandomUint32() * 0x400 + (getRandomUint32() & 0x3ff);
// Result byte array
const bytes = new Uint8Array(16);
// A 12-bit `rand_a` field value
const randA = Math.trunc(baseRand / 2 ** 30);
// The higher 30 bits of 62-bit `rand_b` field value
const randBHi = baseRand & (2 ** 30 - 1);
// The lower 32 bits of 62-bit `rand_b` field value
const randBLo = getRandomUint32();
bytes[0] = currentTimestamp / 2 ** 40;
bytes[1] = currentTimestamp / 2 ** 32;
bytes[2] = currentTimestamp / 2 ** 24;
bytes[3] = currentTimestamp / 2 ** 16;
bytes[4] = currentTimestamp / 2 ** 8;
bytes[5] = currentTimestamp;
bytes[6] = 0x70 | (randA >>> 8);
bytes[7] = randA;
bytes[8] = 0x80 | (randBHi >>> 24);
bytes[9] = randBHi >>> 16;
bytes[10] = randBHi >>> 8;
bytes[11] = randBHi;
bytes[12] = randBLo >>> 24;
bytes[13] = randBLo >>> 16;
bytes[14] = randBLo >>> 8;
bytes[15] = randBLo;
let text = "";
for (let i = 0; i < bytes.length; i++) {
text += UUID_CHARS.charAt(bytes[i] >>> 4);
text += UUID_CHARS.charAt(bytes[i] & 0xf);
if (i === 3 || i === 5 || i === 7 || i === 9) {
text += "-";
}
}
return text;
}
/**
* Generates a keypair based on current keygen algorithm config.
* @param extractable
* @param usages
*/
async function generateKeyPair(extractable, usages) {
return window.crypto.subtle.generateKey(keygenAlgorithmOptions, extractable, usages);
}
/**
* Export key as Json Web Key (JWK)
* @param key
*/
async function exportJwk(key) {
return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
}
/**
* Imports key as Json Web Key (JWK), can set extractable and usages.
* @param key
* @param extractable
* @param usages
*/
async function importJwk(key, extractable, usages) {
return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, keygenAlgorithmOptions, extractable, usages);
}
/**
* Signs given data with given key
* @param key
* @param data
*/
async function sign(key, data) {
return window.crypto.subtle.sign(keygenAlgorithmOptions, key, data);
}
/**
* Generates Base64 encoded jwk used in the Encrypted Authorize Response (EAR) flow
*/
async function generateEarKey() {
const key = await generateBaseKey();
const keyStr = urlEncodeArr(new Uint8Array(key));
const jwk = {
alg: "dir",
kty: "oct",
k: keyStr,
};
return base64Encode(JSON.stringify(jwk));
}
/**
* Parses earJwk for encryption key and returns CryptoKey object
* @param earJwk
* @returns
*/
async function importEarKey(earJwk) {
const b64DecodedJwk = base64Decode(earJwk);
const jwkJson = JSON.parse(b64DecodedJwk);
const rawKey = jwkJson.k;
const keyBuffer = base64DecToArr(rawKey);
return window.crypto.subtle.importKey(RAW, keyBuffer, AES_GCM, false, [
DECRYPT,
]);
}
/**
* Decrypt ear_jwe response returned in the Encrypted Authorize Response (EAR) flow
* @param earJwk
* @param earJwe
* @returns
*/
async function decryptEarResponse(earJwk, earJwe) {
const earJweParts = earJwe.split(".");
if (earJweParts.length !== 5) {
throw createBrowserAuthError(failedToDecryptEarResponse, "jwe_length");
}
const key = await importEarKey(earJwk).catch(() => {
throw createBrowserAuthError(failedToDecryptEarResponse, "import_key");
});
try {
const header = new TextEncoder().encode(earJweParts[0]);
const iv = base64DecToArr(earJweParts[2]);
const ciphertext = base64DecToArr(earJweParts[3]);
const tag = base64DecToArr(earJweParts[4]);
const tagLengthBits = tag.byteLength * 8;
// Concat ciphertext and tag
const encryptedData = new Uint8Array(ciphertext.length + tag.length);
encryptedData.set(ciphertext);
encryptedData.set(tag, ciphertext.length);
const decryptedData = await window.crypto.subtle.decrypt({
name: AES_GCM,
iv: iv,
tagLength: tagLengthBits,
additionalData: header,
}, key, encryptedData);
return new TextDecoder().decode(decryptedData);
}
catch (e) {
throw createBrowserAuthError(failedToDecryptEarResponse, "decrypt");
}
}
/**
* Generates symmetric base encryption key. This may be stored as all encryption/decryption keys will be derived from this one.
*/
async function generateBaseKey() {
const key = await window.crypto.subtle.generateKey({
name: AES_GCM,
length: 256,
}, true, [ENCRYPT, DECRYPT]);
return window.crypto.subtle.exportKey(RAW, key);
}
/**
* Returns the raw key to be passed into the key derivation function
* @param baseKey
* @returns
*/
async function generateHKDF(baseKey) {
return window.crypto.subtle.importKey(RAW, baseKey, HKDF, false, [
DERIVE_KEY,
]);
}
/**
* Given a base key and a nonce generates a derived key to be used in encryption and decryption.
* Note: every time we encrypt a new key is derived
* @param baseKey
* @param nonce
* @returns
*/
async function deriveKey(baseKey, nonce, context) {
return window.crypto.subtle.deriveKey({
name: HKDF,
salt: nonce,
hash: S256_HASH_ALG,
info: new TextEncoder().encode(context),
}, baseKey, { name: AES_GCM, length: 256 }, false, [ENCRYPT, DECRYPT]);
}
/**
* Encrypt the given data given a base key. Returns encrypted data and a nonce that must be provided during decryption
* @param key
* @param rawData
*/
async function encrypt(baseKey, rawData, context) {
const encodedData = new TextEncoder().encode(rawData);
// The nonce must never be reused with a given key.
const nonce = window.crypto.getRandomValues(new Uint8Array(16));
const derivedKey = await deriveKey(baseKey, nonce, context);
const encryptedData = await window.crypto.subtle.encrypt({
name: AES_GCM,
iv: new Uint8Array(12), // New key is derived for every encrypt so we don't need a new nonce
}, derivedKey, encodedData);
return {
data: urlEncodeArr(new Uint8Array(encryptedData)),
nonce: urlEncodeArr(nonce),
};
}
/**
* Decrypt data with the given key and nonce
* @param key
* @param nonce
* @param encryptedData
* @returns
*/
async function decrypt(baseKey, nonce, context, encryptedData) {
const encodedData = base64DecToArr(encryptedData);
const derivedKey = await deriveKey(baseKey, base64DecToArr(nonce), context);
const decryptedData = await window.crypto.subtle.decrypt({
name: AES_GCM,
iv: new Uint8Array(12), // New key is derived for every encrypt so we don't need a new nonce
}, derivedKey, encodedData);
return new TextDecoder().decode(decryptedData);
}
/**
* Returns the SHA-256 hash of an input string
* @param plainText
*/
async function hashString(plainText) {
const hashBuffer = await sha256Digest(plainText);
const hashBytes = new Uint8Array(hashBuffer);
return urlEncodeArr(hashBytes);
}
export { createNewGuid, decrypt, decryptEarResponse, encrypt, exportJwk, generateBaseKey, generateEarKey, generateHKDF, generateKeyPair, getRandomValues, hashString, importEarKey, importJwk, sha256Digest, sign, validateCryptoAvailable };
//# sourceMappingURL=BrowserCrypto.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,194 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { createClientAuthError, ClientAuthErrorCodes, JoseHeader } from '@azure/msal-common/browser';
import { CryptoOptsGetPublicKeyThumbprint, CryptoOptsSignJwt } from '../telemetry/BrowserPerformanceEvents.mjs';
import { base64Encode, urlEncode, urlEncodeArr } from '../encode/Base64Encode.mjs';
import { base64Decode } from '../encode/Base64Decode.mjs';
import { validateCryptoAvailable, createNewGuid, generateKeyPair, exportJwk, importJwk, sign, hashString } from './BrowserCrypto.mjs';
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
import { AsyncMemoryStorage } from '../cache/AsyncMemoryStorage.mjs';
import { cryptoKeyNotFound } from '../error/BrowserAuthErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
*/
class CryptoOps {
constructor(logger, performanceClient, skipValidateSubtleCrypto) {
this.logger = logger;
// Browser crypto needs to be validated first before any other classes can be set.
validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
this.cache = new AsyncMemoryStorage(this.logger);
this.performanceClient = performanceClient;
}
/**
* Creates a new random GUID - used to populate state and nonce.
* @returns string (GUID)
*/
createNewGuid() {
return createNewGuid();
}
/**
* Encodes input string to base64.
* @param input
*/
base64Encode(input) {
return base64Encode(input);
}
/**
* Decodes input string from base64.
* @param input
*/
base64Decode(input) {
return base64Decode(input);
}
/**
* Encodes input string to base64 URL safe string.
* @param input
*/
base64UrlEncode(input) {
return urlEncode(input);
}
/**
* Stringifies and base64Url encodes input public key
* @param inputKid
* @returns Base64Url encoded public key
*/
encodeKid(inputKid) {
return this.base64UrlEncode(JSON.stringify({ kid: inputKid }));
}
/**
* Generates a keypair, stores it and returns a thumbprint
* @param request
*/
async getPublicKeyThumbprint(request) {
const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(CryptoOptsGetPublicKeyThumbprint, request.correlationId);
// Generate Keypair
const keyPair = await generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES);
// Generate Thumbprint for Public Key
const publicKeyJwk = await exportJwk(keyPair.publicKey);
const pubKeyThumprintObj = {
e: publicKeyJwk.e,
kty: publicKeyJwk.kty,
n: publicKeyJwk.n,
};
const publicJwkString = getSortedObjectString(pubKeyThumprintObj);
const publicJwkHash = await this.hashString(publicJwkString);
// Generate Thumbprint for Private Key
const privateKeyJwk = await exportJwk(keyPair.privateKey);
// Re-import private key to make it unextractable
const unextractablePrivateKey = await importJwk(privateKeyJwk, false, ["sign"]);
// Store Keypair data in keystore
await this.cache.setItem(publicJwkHash, {
privateKey: unextractablePrivateKey,
publicKey: keyPair.publicKey,
requestMethod: request.resourceRequestMethod,
requestUri: request.resourceRequestUri,
}, request.correlationId);
if (publicKeyThumbMeasurement) {
publicKeyThumbMeasurement.end({
success: true,
});
}
return publicJwkHash;
}
/**
* Removes cryptographic keypair from key store matching the keyId passed in
* @param kid
* @param correlationId
*/
async removeTokenBindingKey(kid, correlationId) {
await this.cache.removeItem(kid, correlationId);
const keyFound = await this.cache.containsKey(kid, correlationId);
if (keyFound) {
throw createClientAuthError(ClientAuthErrorCodes.bindingKeyNotRemoved);
}
}
/**
* Removes all cryptographic keys from IndexedDB storage
* @param correlationId
*/
async clearKeystore(correlationId) {
// Delete in-memory keystores
this.cache.clearInMemory(correlationId);
/**
* There is only one database, so calling clearPersistent on asymmetric keystore takes care of
* every persistent keystore
*/
try {
await this.cache.clearPersistent(correlationId);
return true;
}
catch (e) {
if (e instanceof Error) {
this.logger.error("1owpn8", correlationId);
}
else {
this.logger.error("0yrmwo", correlationId);
}
return false;
}
}
/**
* Signs the given object as a jwt payload with private key retrieved by given kid.
* @param payload
* @param kid
*/
async signJwt(payload, kid, shrOptions, correlationId) {
const signJwtMeasurement = this.performanceClient?.startMeasurement(CryptoOptsSignJwt, correlationId);
const cachedKeyPair = await this.cache.getItem(kid, correlationId || "");
if (!cachedKeyPair) {
throw createBrowserAuthError(cryptoKeyNotFound);
}
// Get public key as JWK
const publicKeyJwk = await exportJwk(cachedKeyPair.publicKey);
const publicKeyJwkString = getSortedObjectString(publicKeyJwk);
// Base64URL encode public key thumbprint with keyId only: BASE64URL({ kid: "FULL_PUBLIC_KEY_HASH" })
const encodedKeyIdThumbprint = urlEncode(JSON.stringify({ kid: kid }));
// Generate header
const shrHeader = JoseHeader.getShrHeaderString({
...shrOptions?.header,
alg: publicKeyJwk.alg,
kid: encodedKeyIdThumbprint,
});
const encodedShrHeader = urlEncode(shrHeader);
// Generate payload
payload.cnf = {
jwk: JSON.parse(publicKeyJwkString),
};
const encodedPayload = urlEncode(JSON.stringify(payload));
// Form token string
const tokenString = `${encodedShrHeader}.${encodedPayload}`;
// Sign token
const encoder = new TextEncoder();
const tokenBuffer = encoder.encode(tokenString);
const signatureBuffer = await sign(cachedKeyPair.privateKey, tokenBuffer);
const encodedSignature = urlEncodeArr(new Uint8Array(signatureBuffer));
const signedJwt = `${tokenString}.${encodedSignature}`;
if (signJwtMeasurement) {
signJwtMeasurement.end({
success: true,
});
}
return signedJwt;
}
/**
* Returns the SHA-256 hash of an input string
* @param plainText
*/
async hashString(plainText) {
return hashString(plainText);
}
}
CryptoOps.POP_KEY_USAGES = ["sign", "verify"];
CryptoOps.EXTRACTABLE = true;
function getSortedObjectString(obj) {
return JSON.stringify(obj, Object.keys(obj).sort());
}
export { CryptoOps };
//# sourceMappingURL=CryptoOps.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"CryptoOps.mjs","sources":["../../src/crypto/CryptoOps.ts"],"sourcesContent":[null],"names":["BrowserCrypto.validateCryptoAvailable","BrowserCrypto.createNewGuid","BrowserPerformanceEvents.CryptoOptsGetPublicKeyThumbprint","BrowserCrypto.generateKeyPair","BrowserCrypto.exportJwk","BrowserCrypto.importJwk","BrowserPerformanceEvents.CryptoOptsSignJwt","BrowserAuthErrorCodes.cryptoKeyNotFound","BrowserCrypto.sign","BrowserCrypto.hashString"],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAkCH;;;AAGG;MACU,SAAS,CAAA;AAalB,IAAA,WAAA,CACI,MAAc,EACd,iBAAsC,EACtC,wBAAkC,EAAA;AAElC,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;AAErB,QAAAA,uBAAqC,CACjC,wBAAwB,IAAI,KAAK,CACpC,CAAC;QACF,IAAI,CAAC,KAAK,GAAG,IAAI,kBAAkB,CAAgB,IAAI,CAAC,MAAM,CAAC,CAAC;AAChE,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;KAC9C;AAED;;;AAGG;IACH,aAAa,GAAA;AACT,QAAA,OAAOC,aAA2B,EAAE,CAAC;KACxC;AAED;;;AAGG;AACH,IAAA,YAAY,CAAC,KAAa,EAAA;AACtB,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;KAC9B;AAED;;;AAGG;AACH,IAAA,YAAY,CAAC,KAAa,EAAA;AACtB,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;KA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AAW,EAAE,CAAC;QAClC,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAChD,QAAA,MAAM,eAAe,GAAG,MAAMI,IAAkB,CAC5C,aAAa,CAAC,UAAU,EACxB,WAAW,CACd,CAAC;QACF,MAAM,gBAAgB,GAAG,YAAY,CAAC,IAAI,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC;AAEvE,QAAA,MAAM,SAAS,GAAG,CAAA,EAAG,WAAW,CAAI,CAAA,EAAA,gBAAgB,EAAE,CAAC;AAEvD,QAAA,IAAI,kBAAkB,EAAE;YACpB,kBAAkB,CAAC,GAAG,CAAC;AACnB,gBAAA,OAAO,EAAE,IAAI;AAChB,aAAA,CAAC,CAAC;AACN,SAAA;AAED,QAAA,OAAO,SAAS,CAAC;KACpB;AAED;;;AAGG;IACH,MAAM,UAAU,CAAC,SAAiB,EAAA;AAC9B,QAAA,OAAOC,UAAwB,CAAC,SAAS,CAAC,CAAC;KAC9C;;AAzPc,SAAA,CAAA,cAAc,GAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACrD,SAAW,CAAA,WAAA,GAAY,IAAI,CAAC;AA2P/C,SAAS,qBAAqB,CAAC,GAAW,EAAA;AACtC,IAAA,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACxD;;;;"}

View File

@ -0,0 +1,64 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { invoke, invokeAsync } from '@azure/msal-common/browser';
import { GenerateCodeVerifier, GenerateCodeChallengeFromVerifier, GetRandomValues, Sha256Digest } from '../telemetry/BrowserPerformanceEvents.mjs';
import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
import { urlEncodeArr } from '../encode/Base64Encode.mjs';
import { getRandomValues, sha256Digest } from './BrowserCrypto.mjs';
import { pkceNotCreated } from '../error/BrowserAuthErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
// Constant byte array length
const RANDOM_BYTE_ARR_LENGTH = 32;
/**
* This file defines APIs to generate PKCE codes and code verifiers.
*/
/**
* Generates PKCE Codes. See the RFC for more information: https://tools.ietf.org/html/rfc7636
*/
async function generatePkceCodes(performanceClient, logger, correlationId) {
const codeVerifier = invoke(generateCodeVerifier, GenerateCodeVerifier, logger, performanceClient, correlationId)(performanceClient, logger, correlationId);
const codeChallenge = await invokeAsync(generateCodeChallengeFromVerifier, GenerateCodeChallengeFromVerifier, logger, performanceClient, correlationId)(codeVerifier, performanceClient, logger, correlationId);
return {
verifier: codeVerifier,
challenge: codeChallenge,
};
}
/**
* Generates a random 32 byte buffer and returns the base64
* encoded string to be used as a PKCE Code Verifier
*/
function generateCodeVerifier(performanceClient, logger, correlationId) {
try {
// Generate random values as utf-8
const buffer = new Uint8Array(RANDOM_BYTE_ARR_LENGTH);
invoke(getRandomValues, GetRandomValues, logger, performanceClient, correlationId)(buffer);
// encode verifier as base64
const pkceCodeVerifierB64 = urlEncodeArr(buffer);
return pkceCodeVerifierB64;
}
catch (e) {
throw createBrowserAuthError(pkceNotCreated);
}
}
/**
* Creates a base64 encoded PKCE Code Challenge string from the
* hash created from the PKCE Code Verifier supplied
*/
async function generateCodeChallengeFromVerifier(pkceCodeVerifier, performanceClient, logger, correlationId) {
try {
// hashed verifier
const pkceHashedCodeVerifier = await invokeAsync(sha256Digest, Sha256Digest, logger, performanceClient, correlationId)(pkceCodeVerifier);
// encode hash as base64
return urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier));
}
catch (e) {
throw createBrowserAuthError(pkceNotCreated);
}
}
export { generatePkceCodes };
//# sourceMappingURL=PkceGenerator.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"PkceGenerator.mjs","sources":["../../src/crypto/PkceGenerator.ts"],"sourcesContent":[null],"names":["BrowserPerformanceEvents.GenerateCodeVerifier","BrowserPerformanceEvents.GenerateCodeChallengeFromVerifier","BrowserPerformanceEvents.GetRandomValues","BrowserAuthErrorCodes.pkceNotCreated","BrowserPerformanceEvents.Sha256Digest"],"mappings":";;;;;;;;;AAAA;;;AAGG;AAiBH;AACA,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC;;AAEG;AAEH;;AAEG;AACI,eAAe,iBAAiB,CACnC,iBAAqC,EACrC,MAAc,EACd,aAAqB,EAAA;IAErB,MAAM,YAAY,GAAG,MAAM,CACvB,oBAAoB,EACpBA,oBAA6C,EAC7C,MAAM,EACN,iBAAiB,EACjB,aAAa,CAChB,CAAC,iBAAiB,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC5C,MAAM,aAAa,GAAG,MAAM,WAAW,CACnC,iCAAiC,EACjCC,iCAA0D,EAC1D,MAAM,EACN,iBAAiB,EACjB,aAAa,CAChB,CAAC,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC1D,OAAO;AACH,QAAA,QAAQ,EAAE,YAAY;AACtB,QAAA,SAAS,EAAE,aAAa;KAC3B,CAAC;AACN,CAAC;AAED;;;AAGG;AACH,SAAS,oBAAoB,CACzB,iBAAqC,EACrC,MAAc,EACd,aAAqB,EAAA;IAErB,IAAI;;AAEA,QAAA,MAAM,MAAM,GAAe,IAAI,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAClE,QAAA,MAAM,CACF,eAAe,EACfC,eAAwC,EACxC,MAAM,EACN,iBAAiB,EACjB,aAAa,CAChB,CAAC,MAAM,CAAC,CAAC;;AAEV,QAAA,MAAM,mBAAmB,GAAW,YAAY,CAAC,MAAM,CAAC,CAAC;AACzD,QAAA,OAAO,mBAAmB,CAAC;AAC9B,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE;AACR,QAAA,MAAM,sBAAsB,CAACC,cAAoC,CAAC,CAAC;AACtE,KAAA;AACL,CAAC;AAED;;;AAGG;AACH,eAAe,iCAAiC,CAC5C,gBAAwB,EACxB,iBAAqC,EACrC,MAAc,EACd,aAAqB,EAAA;IAErB,IAAI;;QAEA,MAAM,sBAAsB,GAAG,MAAM,WAAW,CAC5C,YAAY,EACZC,YAAqC,EACrC,MAAM,EACN,iBAAiB,EACjB,aAAa,CAChB,CAAC,gBAAgB,CAAC,CAAC;;QAEpB,OAAO,YAAY,CAAC,IAAI,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC;AAC/D,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE;AACR,QAAA,MAAM,sBAAsB,CAACD,cAAoC,CAAC,CAAC;AACtE,KAAA;AACL;;;;"}

View File

@ -0,0 +1,49 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { CryptoOps } from './CryptoOps.mjs';
import { Logger, PopTokenGenerator, StubPerformanceClient } from '@azure/msal-common/browser';
import { name, version } from '../packageMetadata.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class SignedHttpRequest {
constructor(shrParameters, shrOptions) {
const loggerOptions = (shrOptions && shrOptions.loggerOptions) || {};
this.logger = new Logger(loggerOptions, name, version);
this.cryptoOps = new CryptoOps(this.logger);
this.popTokenGenerator = new PopTokenGenerator(this.cryptoOps, new StubPerformanceClient());
this.shrParameters = shrParameters;
}
/**
* Generates and caches a keypair for the given request options.
* @returns Public key digest, which should be sent to the token issuer.
*/
async generatePublicKeyThumbprint() {
const { kid } = await this.popTokenGenerator.generateKid(this.shrParameters);
return kid;
}
/**
* Generates a signed http request for the given payload with the given key.
* @param payload Payload to sign (e.g. access token)
* @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)
* @param claims Additional claims to include/override in the signed JWT
* @returns Pop token signed with the corresponding private key
*/
async signRequest(payload, publicKeyThumbprint, claims) {
return this.popTokenGenerator.signPayload(payload, publicKeyThumbprint, this.shrParameters, claims);
}
/**
* Removes cached keys from browser for given public key thumbprint
* @param publicKeyThumbprint Public key digest (from generatePublicKeyThumbprint API)
* @param correlationId
* @returns If keys are properly deleted
*/
async removeKeys(publicKeyThumbprint, correlationId) {
return this.cryptoOps.removeTokenBindingKey(publicKeyThumbprint, correlationId);
}
}
export { SignedHttpRequest };
//# sourceMappingURL=SignedHttpRequest.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"SignedHttpRequest.mjs","sources":["../../src/crypto/SignedHttpRequest.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;AAGG;MAgBU,iBAAiB,CAAA;IAM1B,WACI,CAAA,aAA0C,EAC1C,UAAqC,EAAA;QAErC,MAAM,aAAa,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,aAAa,KAAK,EAAE,CAAC;AACrE,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5C,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAC1C,IAAI,CAAC,SAAS,EACd,IAAI,qBAAqB,EAAE,CAC9B,CAAC;AACF,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;KACtC;AAED;;;AAGG;AACH,IAAA,MAAM,2BAA2B,GAAA;AAC7B,QAAA,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CACpD,IAAI,CAAC,aAAa,CACrB,CAAC;AAEF,QAAA,OAAO,GAAG,CAAC;KACd;AAED;;;;;;AAMG;AACH,IAAA,MAAM,WAAW,CACb,OAAe,EACf,mBAA2B,EAC3B,MAAe,EAAA;AAEf,QAAA,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CACrC,OAAO,EACP,mBAAmB,EACnB,IAAI,CAAC,aAAa,EAClB,MAAM,CACT,CAAC;KACL;AAED;;;;;AAKG;AACH,IAAA,MAAM,UAAU,CACZ,mBAA2B,EAC3B,aAAqB,EAAA;QAErB,OAAO,IAAI,CAAC,SAAS,CAAC,qBAAqB,CACvC,mBAAmB,EACnB,aAAa,CAChB,CAAC;KACL;AACJ;;;;"}

View File

@ -0,0 +1,59 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { Constants } from '@azure/msal-common/browser';
import { version } from '../packageMetadata.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
const GrantType = {
PASSWORD: "password",
OOB: "oob",
CONTINUATION_TOKEN: "continuation_token",
REDIRECT: "redirect",
ATTRIBUTES: "attributes",
MFA_OOB: "mfa_oob",
};
const ChallengeType = {
PASSWORD: "password",
OOB: "oob",
REDIRECT: "redirect",
PREVERIFIED: "preverified",
};
const DefaultScopes = [
Constants.OPENID_SCOPE,
Constants.PROFILE_SCOPE,
Constants.OFFLINE_ACCESS_SCOPE,
];
const HttpHeaderKeys = {
CONTENT_TYPE: "Content-Type",
X_MS_REQUEST_ID: "x-ms-request-id",
};
const CustomHeaderConstants = {
REQUIRED_PREFIX: "x-",
RESERVED_PREFIXES: [
"x-client-",
"x-ms-",
"x-broker-",
"x-app-",
],
};
const DefaultPackageInfo = {
SKU: "msal.browser",
VERSION: version,
OS: "",
CPU: "",
};
const ResetPasswordPollStatus = {
IN_PROGRESS: "in_progress",
SUCCEEDED: "succeeded",
FAILED: "failed",
NOT_STARTED: "not_started",
};
const DefaultCustomAuthApiCodeLength = -1; // Default value indicating that the code length is not specified
const DefaultCustomAuthApiCodeResendIntervalInSec = 300; // seconds
const PasswordResetPollingTimeoutInMs = 300000; // milliseconds
export { ChallengeType, CustomHeaderConstants, DefaultCustomAuthApiCodeLength, DefaultCustomAuthApiCodeResendIntervalInSec, DefaultPackageInfo, DefaultScopes, GrantType, HttpHeaderKeys, PasswordResetPollingTimeoutInMs, ResetPasswordPollStatus };
//# sourceMappingURL=CustomAuthConstants.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"CustomAuth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0,0 +1,97 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { CustomAuthStandardController } from './controller/CustomAuthStandardController.mjs';
import { CustomAuthOperatingContext } from './operating_context/CustomAuthOperatingContext.mjs';
import { InvalidConfigurationError } from './core/error/InvalidConfigurationError.mjs';
import { ChallengeType } from './CustomAuthConstants.mjs';
import { PublicClientApplication } from '../app/PublicClientApplication.mjs';
import { MissingConfiguration, InvalidAuthority, InvalidChallengeType } from './core/error/InvalidConfigurationErrorCodes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class CustomAuthPublicClientApplication extends PublicClientApplication {
/**
* Creates a new instance of a PublicClientApplication with the given configuration and controller to start Native authentication flows
* @param {CustomAuthConfiguration} config - A configuration object for the PublicClientApplication instance
* @returns {Promise<ICustomAuthPublicClientApplication>} - A promise that resolves to a CustomAuthPublicClientApplication instance
*/
static async create(config) {
CustomAuthPublicClientApplication.validateConfig(config);
const customAuthController = new CustomAuthStandardController(new CustomAuthOperatingContext(config));
await customAuthController.initialize();
const app = new CustomAuthPublicClientApplication(config, customAuthController);
return app;
}
constructor(config, controller) {
super(config, controller);
this.customAuthController = controller;
}
/**
* Gets the current account from the browser cache.
* @param {AccountRetrievalInputs} accountRetrievalInputs?:AccountRetrievalInputs
* @returns {GetAccountResult} - The result of the get account operation
*/
getCurrentAccount(accountRetrievalInputs) {
return this.customAuthController.getCurrentAccount(accountRetrievalInputs);
}
/**
* Initiates the sign-in flow.
* This method results in sign-in completion, or extra actions (password, code, etc.) required to complete the sign-in.
* Create result with error details if any exception thrown.
* @param {SignInInputs} signInInputs - Inputs for the sign-in flow
* @returns {Promise<SignInResult>} - A promise that resolves to SignInResult
*/
signIn(signInInputs) {
return this.customAuthController.signIn(signInInputs);
}
/**
* Initiates the sign-up flow.
* This method results in sign-up completion, or extra actions (password, code, etc.) required to complete the sign-up.
* Create result with error details if any exception thrown.
* @param {SignUpInputs} signUpInputs
* @returns {Promise<SignUpResult>} - A promise that resolves to SignUpResult
*/
signUp(signUpInputs) {
return this.customAuthController.signUp(signUpInputs);
}
/**
* Initiates the reset password flow.
* This method results in triggering extra action (submit code) to complete the reset password.
* Create result with error details if any exception thrown.
* @param {ResetPasswordInputs} resetPasswordInputs - Inputs for the reset password flow
* @returns {Promise<ResetPasswordStartResult>} - A promise that resolves to ResetPasswordStartResult
*/
resetPassword(resetPasswordInputs) {
return this.customAuthController.resetPassword(resetPasswordInputs);
}
/**
* Validates the configuration to ensure it is a valid CustomAuthConfiguration object.
* @param {CustomAuthConfiguration} config - The configuration object for the PublicClientApplication.
* @returns {void}
*/
static validateConfig(config) {
// Ensure the configuration object has a valid CIAM authority URL.
if (!config) {
throw new InvalidConfigurationError(MissingConfiguration, "The configuration is missing.");
}
if (!config.auth?.authority) {
throw new InvalidConfigurationError(InvalidAuthority, `The authority URL '${config.auth?.authority}' is not set.`);
}
const challengeTypes = config.customAuth.challengeTypes;
if (!!challengeTypes && challengeTypes.length > 0) {
challengeTypes.forEach((challengeType) => {
const lowerCaseChallengeType = challengeType.toLowerCase();
if (lowerCaseChallengeType !== ChallengeType.PASSWORD &&
lowerCaseChallengeType !== ChallengeType.OOB &&
lowerCaseChallengeType !== ChallengeType.REDIRECT) {
throw new InvalidConfigurationError(InvalidChallengeType, `Challenge type ${challengeType} in the configuration are not valid. Supported challenge types are ${Object.values(ChallengeType)}`);
}
});
}
}
}
export { CustomAuthPublicClientApplication };
//# sourceMappingURL=CustomAuthPublicClientApplication.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"CustomAuthPublicClientApplication.mjs","sources":["../../src/custom_auth/CustomAuthPublicClientApplication.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;AAGG;AA0BG,MAAO,iCACT,SAAQ,uBAAuB,CAAA;AAK/B;;;;AAIG;AACH,IAAA,aAAa,MAAM,CACf,MAA+B,EAAA;AAE/B,QAAA,iCAAiC,CAAC,cAAc,CAAC,MAAM,CA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AAA,EAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,CAAA,aAAA,CAAe,CAC9D,CAAC;AACL,SAAA;AAED,QAAA,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC;QAExD,IAAI,CAAC,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;AAC/C,YAAA,cAAc,CAAC,OAAO,CAAC,CAAC,aAAa,KAAI;AACrC,gBAAA,MAAM,sBAAsB,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;AAC3D,gBAAA,IACI,sBAAsB,KAAK,aAAa,CAAC,QAAQ;oBACjD,sBAAsB,KAAK,aAAa,CAAC,GAAG;AAC5C,oBAAA,sBAAsB,KAAK,aAAa,CAAC,QAAQ,EACnD;AACE,oBAAA,MAAM,IAAI,yBAAyB,CAC/B,oBAAoB,EACpB,kBAAkB,aAAa,CAAA,mEAAA,EAAsE,MAAM,CAAC,MAAM,CAC9G,aAAa,CAChB,CAAA,CAAE,CACN,CAAC;AACL,iBAAA;AACL,aAAC,CAAC,CAAC;AACN,SAAA;KACJ;AACJ;;;;"}

View File

@ -0,0 +1,332 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { GetAccountResult } from '../get_account/auth_flow/result/GetAccountResult.mjs';
import { SignInResult } from '../sign_in/auth_flow/result/SignInResult.mjs';
import { SignUpResult } from '../sign_up/auth_flow/result/SignUpResult.mjs';
import { SignInClient } from '../sign_in/interaction_client/SignInClient.mjs';
import { CustomAuthAccountData } from '../get_account/auth_flow/CustomAuthAccountData.mjs';
import { UnexpectedError } from '../core/error/UnexpectedError.mjs';
import { ResetPasswordStartResult } from '../reset_password/auth_flow/result/ResetPasswordStartResult.mjs';
import { CustomAuthAuthority } from '../core/CustomAuthAuthority.mjs';
import { DefaultPackageInfo } from '../CustomAuthConstants.mjs';
import { SIGN_IN_CODE_SEND_RESULT_TYPE, SIGN_IN_PASSWORD_REQUIRED_RESULT_TYPE, SIGN_IN_COMPLETED_RESULT_TYPE, SIGN_IN_JIT_REQUIRED_RESULT_TYPE, SIGN_IN_MFA_REQUIRED_RESULT_TYPE } from '../sign_in/interaction_client/result/SignInActionResult.mjs';
import { SignUpClient } from '../sign_up/interaction_client/SignUpClient.mjs';
import { CustomAuthInterationClientFactory } from '../core/interaction_client/CustomAuthInterationClientFactory.mjs';
import { SIGN_UP_CODE_REQUIRED_RESULT_TYPE, SIGN_UP_PASSWORD_REQUIRED_RESULT_TYPE } from '../sign_up/interaction_client/result/SignUpActionResult.mjs';
import { CustomAuthApiClient } from '../core/network_client/custom_auth_api/CustomAuthApiClient.mjs';
import { FetchHttpClient } from '../core/network_client/http_client/FetchHttpClient.mjs';
import { ResetPasswordClient } from '../reset_password/interaction_client/ResetPasswordClient.mjs';
import { JitClient } from '../core/interaction_client/jit/JitClient.mjs';
import { MfaClient } from '../core/interaction_client/mfa/MfaClient.mjs';
import { NoCachedAccountFoundError } from '../core/error/NoCachedAccountFoundError.mjs';
import { ensureArgumentIsNotNullOrUndefined, ensureArgumentIsNotEmptyString, ensureArgumentIsJSONString } from '../core/utils/ArgumentValidator.mjs';
import { UserAlreadySignedInError } from '../core/error/UserAlreadySignedInError.mjs';
import { CustomAuthSilentCacheClient } from '../get_account/interaction_client/CustomAuthSilentCacheClient.mjs';
import { UnsupportedEnvironmentError } from '../core/error/UnsupportedEnvironmentError.mjs';
import { SignInCodeRequiredState } from '../sign_in/auth_flow/state/SignInCodeRequiredState.mjs';
import { SignInPasswordRequiredState } from '../sign_in/auth_flow/state/SignInPasswordRequiredState.mjs';
import { SignInCompletedState } from '../sign_in/auth_flow/state/SignInCompletedState.mjs';
import { AuthMethodRegistrationRequiredState } from '../core/auth_flow/jit/state/AuthMethodRegistrationState.mjs';
import { MfaAwaitingState } from '../core/auth_flow/mfa/state/MfaState.mjs';
import { SignUpCodeRequiredState } from '../sign_up/auth_flow/state/SignUpCodeRequiredState.mjs';
import { SignUpPasswordRequiredState } from '../sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs';
import { ResetPasswordCodeRequiredState } from '../reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs';
import { StandardController } from '../../controllers/StandardController.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/*
* Controller for standard native auth operations.
*/
class CustomAuthStandardController extends StandardController {
/*
* Constructor for CustomAuthStandardController.
* @param operatingContext - The operating context for the controller.
* @param customAuthApiClient - The client to use for custom auth API operations.
*/
constructor(operatingContext, customAuthApiClient) {
super(operatingContext);
if (!this.isBrowserEnvironment) {
this.logger.verbose("1f7i3q", "");
throw new UnsupportedEnvironmentError();
}
this.logger = this.logger.clone(DefaultPackageInfo.SKU, DefaultPackageInfo.VERSION);
this.customAuthConfig = operatingContext.getCustomAuthConfig();
this.authority = new CustomAuthAuthority(this.customAuthConfig.auth.authority, this.customAuthConfig, this.networkClient, this.browserStorage, this.logger, this.performanceClient, this.customAuthConfig.customAuth?.authApiProxyUrl);
const interactionClientFactory = new CustomAuthInterationClientFactory(this.customAuthConfig, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, customAuthApiClient ??
new CustomAuthApiClient(this.authority.getCustomAuthApiDomain(), this.customAuthConfig.auth.clientId, new FetchHttpClient(this.logger), this.customAuthConfig.customAuth?.capabilities?.join(" "), this.customAuthConfig.customAuth?.customAuthApiQueryParams, this.customAuthConfig.customAuth?.requestInterceptor, this.logger), this.authority);
this.signInClient = interactionClientFactory.create(SignInClient);
this.signUpClient = interactionClientFactory.create(SignUpClient);
this.resetPasswordClient =
interactionClientFactory.create(ResetPasswordClient);
this.jitClient = interactionClientFactory.create(JitClient);
this.mfaClient = interactionClientFactory.create(MfaClient);
this.cacheClient = interactionClientFactory.create(CustomAuthSilentCacheClient);
}
/*
* Gets the current account from the cache.
* @param accountRetrievalInputs - Inputs for getting the current cached account
* @returns {GetAccountResult} The account result
*/
getCurrentAccount(accountRetrievalInputs) {
const correlationId = this.getCorrelationId(accountRetrievalInputs);
try {
this.logger.verbose("0mb49j", correlationId);
const account = this.cacheClient.getCurrentAccount(correlationId);
if (account) {
this.logger.verbose("1utnrc", correlationId);
return new GetAccountResult(new CustomAuthAccountData(account, this.customAuthConfig, this.cacheClient, this.logger, correlationId));
}
throw new NoCachedAccountFoundError(correlationId);
}
catch (error) {
this.logger.errorPii("0ar5hw", correlationId);
return GetAccountResult.createWithError(error);
}
}
/*
* Signs the user in.
* @param signInInputs - Inputs for signing in the user.
* @returns {Promise<SignInResult>} The result of the operation.
*/
async signIn(signInInputs) {
const correlationId = this.getCorrelationId(signInInputs);
try {
ensureArgumentIsNotNullOrUndefined("signInInputs", signInInputs, correlationId);
ensureArgumentIsNotEmptyString("signInInputs.username", signInInputs.username, correlationId);
this.ensureUserNotSignedIn(correlationId);
if (signInInputs.claims) {
ensureArgumentIsJSONString("signInInputs.claims", signInInputs.claims, correlationId);
}
// start the signin flow
const signInStartParams = {
clientId: this.customAuthConfig.auth.clientId,
correlationId: correlationId,
challengeType: this.customAuthConfig.customAuth.challengeTypes ?? [],
username: signInInputs.username,
password: signInInputs.password,
};
this.logger.verbose("0mncjk", correlationId);
const startResult = await this.signInClient.start(signInStartParams);
this.logger.verbose("0b1x6k", correlationId);
if (startResult.type === SIGN_IN_CODE_SEND_RESULT_TYPE) {
// require code
this.logger.verbose("19jerh", correlationId);
return new SignInResult(new SignInCodeRequiredState({
correlationId: startResult.correlationId,
continuationToken: startResult.continuationToken,
logger: this.logger,
config: this.customAuthConfig,
signInClient: this.signInClient,
cacheClient: this.cacheClient,
jitClient: this.jitClient,
mfaClient: this.mfaClient,
username: signInInputs.username,
codeLength: startResult.codeLength,
scopes: signInInputs.scopes ?? [],
claims: signInInputs.claims,
}));
}
else if (startResult.type === SIGN_IN_PASSWORD_REQUIRED_RESULT_TYPE) {
// require password
this.logger.verbose("0457px", correlationId);
if (!signInInputs.password) {
this.logger.verbose("09dgsg", correlationId);
return new SignInResult(new SignInPasswordRequiredState({
correlationId: startResult.correlationId,
continuationToken: startResult.continuationToken,
logger: this.logger,
config: this.customAuthConfig,
signInClient: this.signInClient,
cacheClient: this.cacheClient,
jitClient: this.jitClient,
mfaClient: this.mfaClient,
username: signInInputs.username,
scopes: signInInputs.scopes ?? [],
claims: signInInputs.claims,
}));
}
this.logger.verbose("1dm2kj", correlationId);
// if the password is provided, then try to get token silently.
const submitPasswordParams = {
clientId: this.customAuthConfig.auth.clientId,
correlationId: correlationId,
challengeType: this.customAuthConfig.customAuth.challengeTypes ?? [],
scopes: signInInputs.scopes ?? [],
continuationToken: startResult.continuationToken,
password: signInInputs.password,
username: signInInputs.username,
claims: signInInputs.claims,
};
const submitPasswordResult = await this.signInClient.submitPassword(submitPasswordParams);
this.logger.verbose("09ajki", correlationId);
if (submitPasswordResult.type === SIGN_IN_COMPLETED_RESULT_TYPE) {
const accountInfo = new CustomAuthAccountData(submitPasswordResult.authenticationResult.account, this.customAuthConfig, this.cacheClient, this.logger, correlationId);
return new SignInResult(new SignInCompletedState(), accountInfo);
}
else if (submitPasswordResult.type ===
SIGN_IN_JIT_REQUIRED_RESULT_TYPE) {
// Authentication method registration is required - create AuthMethodRegistrationRequiredState
this.logger.verbose("187c19", correlationId);
return new SignInResult(new AuthMethodRegistrationRequiredState({
correlationId: correlationId,
continuationToken: submitPasswordResult.continuationToken,
logger: this.logger,
config: this.customAuthConfig,
jitClient: this.jitClient,
cacheClient: this.cacheClient,
authMethods: submitPasswordResult.authMethods,
username: signInInputs.username,
scopes: signInInputs.scopes ?? [],
claims: signInInputs.claims,
}));
}
else if (submitPasswordResult.type ===
SIGN_IN_MFA_REQUIRED_RESULT_TYPE) {
// MFA is required - create MfaAwaitingState
this.logger.verbose("1t79dc", correlationId);
return new SignInResult(new MfaAwaitingState({
correlationId: correlationId,
continuationToken: submitPasswordResult.continuationToken,
logger: this.logger,
config: this.customAuthConfig,
mfaClient: this.mfaClient,
cacheClient: this.cacheClient,
scopes: signInInputs.scopes ?? [],
authMethods: submitPasswordResult.authMethods ?? [],
}));
}
else {
// Unexpected result type
const result = submitPasswordResult;
const error = new Error(`Unexpected result type: ${result.type}`);
return SignInResult.createWithError(error);
}
}
this.logger.error("14awz5", correlationId);
throw new UnexpectedError("Unknow sign-in result type", correlationId);
}
catch (error) {
this.logger.errorPii("1te6co", correlationId);
return SignInResult.createWithError(error);
}
}
/*
* Signs the user up.
* @param signUpInputs - Inputs for signing up the user.
* @returns {Promise<SignUpResult>} The result of the operation
*/
async signUp(signUpInputs) {
const correlationId = this.getCorrelationId(signUpInputs);
try {
ensureArgumentIsNotNullOrUndefined("signUpInputs", signUpInputs, correlationId);
ensureArgumentIsNotEmptyString("signUpInputs.username", signUpInputs.username, correlationId);
this.ensureUserNotSignedIn(correlationId);
this.logger.verbose("1f4ezz", correlationId);
const startResult = await this.signUpClient.start({
clientId: this.customAuthConfig.auth.clientId,
correlationId: correlationId,
challengeType: this.customAuthConfig.customAuth.challengeTypes ?? [],
username: signUpInputs.username,
password: signUpInputs.password,
attributes: signUpInputs.attributes,
});
this.logger.verbose("1pwgi0", correlationId);
if (startResult.type === SIGN_UP_CODE_REQUIRED_RESULT_TYPE) {
// Code required
this.logger.verbose("1hm6bi", correlationId);
return new SignUpResult(new SignUpCodeRequiredState({
correlationId: startResult.correlationId,
continuationToken: startResult.continuationToken,
logger: this.logger,
config: this.customAuthConfig,
signInClient: this.signInClient,
signUpClient: this.signUpClient,
cacheClient: this.cacheClient,
jitClient: this.jitClient,
mfaClient: this.mfaClient,
username: signUpInputs.username,
codeLength: startResult.codeLength,
codeResendInterval: startResult.interval,
}));
}
else if (startResult.type === SIGN_UP_PASSWORD_REQUIRED_RESULT_TYPE) {
// Password required
this.logger.verbose("098u8y", correlationId);
return new SignUpResult(new SignUpPasswordRequiredState({
correlationId: startResult.correlationId,
continuationToken: startResult.continuationToken,
logger: this.logger,
config: this.customAuthConfig,
signInClient: this.signInClient,
signUpClient: this.signUpClient,
cacheClient: this.cacheClient,
jitClient: this.jitClient,
mfaClient: this.mfaClient,
username: signUpInputs.username,
}));
}
this.logger.error("12ceo3", correlationId);
throw new UnexpectedError("Unknown sign-up result type", correlationId);
}
catch (error) {
this.logger.errorPii("1ym5p8", correlationId);
return SignUpResult.createWithError(error);
}
}
/*
* Resets the user's password.
* @param resetPasswordInputs - Inputs for resetting the user's password.
* @returns {Promise<ResetPasswordStartResult>} The result of the operation.
*/
async resetPassword(resetPasswordInputs) {
const correlationId = this.getCorrelationId(resetPasswordInputs);
try {
ensureArgumentIsNotNullOrUndefined("resetPasswordInputs", resetPasswordInputs, correlationId);
ensureArgumentIsNotEmptyString("resetPasswordInputs.username", resetPasswordInputs.username, correlationId);
this.ensureUserNotSignedIn(correlationId);
this.logger.verbose("1u9e3k", correlationId);
const startResult = await this.resetPasswordClient.start({
clientId: this.customAuthConfig.auth.clientId,
correlationId: correlationId,
challengeType: this.customAuthConfig.customAuth.challengeTypes ?? [],
username: resetPasswordInputs.username,
});
this.logger.verbose("1axxe2", correlationId);
return new ResetPasswordStartResult(new ResetPasswordCodeRequiredState({
correlationId: startResult.correlationId,
continuationToken: startResult.continuationToken,
logger: this.logger,
config: this.customAuthConfig,
signInClient: this.signInClient,
resetPasswordClient: this.resetPasswordClient,
cacheClient: this.cacheClient,
jitClient: this.jitClient,
mfaClient: this.mfaClient,
username: resetPasswordInputs.username,
codeLength: startResult.codeLength,
}));
}
catch (error) {
this.logger.errorPii("1s0wwh", correlationId);
return ResetPasswordStartResult.createWithError(error);
}
}
getCorrelationId(actionInputs) {
return (actionInputs?.correlationId || this.browserCrypto.createNewGuid());
}
ensureUserNotSignedIn(correlationId) {
const account = this.getCurrentAccount({
correlationId: correlationId,
});
if (account && !!account.data) {
this.logger.error("1a17tw", correlationId);
throw new UserAlreadySignedInError(correlationId);
}
}
}
export { CustomAuthStandardController };
//# sourceMappingURL=CustomAuthStandardController.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,82 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { Authority } from '@azure/msal-common/browser';
import { SIGNIN_TOKEN } from './network_client/custom_auth_api/CustomAuthApiEndpoint.mjs';
import { buildUrl } from './utils/UrlUtils.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Authority class which can be used to create an authority object for Custom Auth features.
*/
class CustomAuthAuthority extends Authority {
/**
* Constructor for the Custom Auth Authority.
* @param authority - The authority URL for the authority.
* @param networkInterface - The network interface implementation to make requests.
* @param cacheManager - The cache manager.
* @param authorityOptions - The options for the authority.
* @param logger - The logger for the authority.
* @param customAuthProxyDomain - The custom auth proxy domain.
*/
constructor(authority, config, networkInterface, cacheManager, logger, performanceClient, customAuthProxyDomain) {
const ciamAuthorityUrl = CustomAuthAuthority.transformCIAMAuthority(authority);
const authorityOptions = {
protocolMode: config.system.protocolMode,
OIDCOptions: config.auth.OIDCOptions,
knownAuthorities: config.auth.knownAuthorities,
cloudDiscoveryMetadata: config.auth.cloudDiscoveryMetadata,
authorityMetadata: config.auth.authorityMetadata,
};
super(ciamAuthorityUrl, networkInterface, cacheManager, authorityOptions, logger, "", performanceClient);
this.customAuthProxyDomain = customAuthProxyDomain;
// Set the metadata for the authority
const metadataEntity = {
aliases: [this.hostnameAndPort],
preferred_cache: this.getPreferredCache(),
preferred_network: this.hostnameAndPort,
canonical_authority: this.canonicalAuthority,
authorization_endpoint: "",
token_endpoint: this.tokenEndpoint,
end_session_endpoint: "",
issuer: "",
aliasesFromNetwork: false,
endpointsFromNetwork: false,
/*
* give max value to make sure it doesn't expire,
* as we only initiate the authority metadata entity once and it doesn't change
*/
expiresAt: Number.MAX_SAFE_INTEGER,
jwks_uri: "",
};
const cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache, this.correlationId);
cacheManager.setAuthorityMetadata(cacheKey, metadataEntity, this.correlationId);
}
/**
* Gets the custom auth endpoint.
* The open id configuration doesn't have the correct endpoint for the auth APIs.
* We need to generate the endpoint manually based on the authority URL.
* @returns The custom auth endpoint
*/
getCustomAuthApiDomain() {
/*
* The customAuthProxyDomain is used to resolve the CORS issue when calling the auth APIs.
* If the customAuthProxyDomain is not provided, we will generate the auth API domain based on the authority URL.
*/
return !this.customAuthProxyDomain
? this.canonicalAuthority
: this.customAuthProxyDomain;
}
getPreferredCache() {
return this.canonicalAuthorityUrlComponents.HostNameAndPort;
}
get tokenEndpoint() {
const endpointUrl = buildUrl(this.getCustomAuthApiDomain(), SIGNIN_TOKEN);
return endpointUrl.href;
}
}
export { CustomAuthAuthority };
//# sourceMappingURL=CustomAuthAuthority.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"CustomAuthAuthority.mjs","sources":["../../../src/custom_auth/core/CustomAuthAuthority.ts"],"sourcesContent":[null],"names":["CustomAuthApiEndpoint.SIGNIN_TOKEN"],"mappings":";;;;;;AAAA;;;AAGG;AAcH;;AAEG;AACG,MAAO,mBAAoB,SAAQ,SAAS,CAAA;AAC9C;;;;;;;;AAQG;AACH,IAAA,WAAA,CACI,SAAiB,EACjB,MAA4B,EAC5B,gBAAgC,EAChC,YAAiC,EACjC,MAAc,EACd,iBAAqC,EAC7B,qBAA8B,EAAA;QAEtC,MAAM,gBAAgB,GAClB,mBAAmB,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;AAE1D,QAAA,MAAM,gBAAgB,GAAqB;AACvC,YAAA,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY;AACxC,YAAA,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW;AACpC,YAAA,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,gBAAgB;AAC9C,YAAA,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,sBAAsB;AAC1D,YAAA,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB;SACnD,CAAC;AAEF,QAAA,KAAK,CACD,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB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3B;AACJ;;;;"}

View File

@ -0,0 +1,134 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { CustomAuthApiError, RedirectError } from '../error/CustomAuthApiError.mjs';
import { NoCachedAccountFoundError } from '../error/NoCachedAccountFoundError.mjs';
import { InvalidArgumentError } from '../error/InvalidArgumentError.mjs';
import { USER_NOT_FOUND, INVALID_REQUEST, UNSUPPORTED_CHALLENGE_TYPE, INVALID_GRANT, USER_ALREADY_EXISTS, ATTRIBUTES_REQUIRED, EXPIRED_TOKEN, ACCESS_DENIED } from '../network_client/custom_auth_api/types/ApiErrorCodes.mjs';
import { INVALID_OOB_VALUE, ATTRIBUTE_VALIATION_FAILED, PROVIDER_BLOCKED_BY_REPUTATION, PASSWORD_BANNED, PASSWORD_IS_INVALID, PASSWORD_RECENTLY_USED, PASSWORD_TOO_LONG, PASSWORD_TOO_SHORT, PASSWORD_TOO_WEAK } from '../network_client/custom_auth_api/types/ApiSuberrors.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Base class for all auth flow errors.
*/
class AuthFlowErrorBase {
constructor(errorData) {
this.errorData = errorData;
}
isUserNotFoundError() {
return this.errorData.error === USER_NOT_FOUND;
}
isUserInvalidError() {
return ((this.errorData instanceof InvalidArgumentError &&
this.errorData.errorDescription?.includes("username")) ||
(this.errorData instanceof CustomAuthApiError &&
!!this.errorData.errorDescription?.includes("username parameter is empty or not valid") &&
!!this.errorData.errorCodes?.includes(90100)));
}
isUnsupportedChallengeTypeError() {
return ((this.errorData.error === INVALID_REQUEST &&
(this.errorData.errorDescription?.includes("The challenge_type list parameter contains an unsupported challenge type") ??
false)) ||
this.errorData.error ===
UNSUPPORTED_CHALLENGE_TYPE);
}
isPasswordIncorrectError() {
const isIncorrectPassword = this.errorData.error === INVALID_GRANT &&
this.errorData instanceof CustomAuthApiError &&
(this.errorData.errorCodes ?? []).includes(50126);
const isPasswordEmpty = this.errorData instanceof InvalidArgumentError &&
this.errorData.errorDescription?.includes("password") === true;
return isIncorrectPassword || isPasswordEmpty;
}
isInvalidCodeError() {
return ((this.errorData.error === INVALID_GRANT &&
this.errorData instanceof CustomAuthApiError &&
this.errorData.subError ===
INVALID_OOB_VALUE) ||
(this.errorData instanceof InvalidArgumentError &&
(this.errorData.errorDescription?.includes("code") ||
this.errorData.errorDescription?.includes("challenge")) ===
true));
}
isRedirectError() {
return this.errorData instanceof RedirectError;
}
isInvalidNewPasswordError() {
const invalidPasswordSubErrors = new Set([
PASSWORD_BANNED,
PASSWORD_IS_INVALID,
PASSWORD_RECENTLY_USED,
PASSWORD_TOO_LONG,
PASSWORD_TOO_SHORT,
PASSWORD_TOO_WEAK,
]);
return (this.errorData instanceof CustomAuthApiError &&
this.errorData.error === INVALID_GRANT &&
invalidPasswordSubErrors.has(this.errorData.subError ?? ""));
}
isUserAlreadyExistsError() {
return (this.errorData instanceof CustomAuthApiError &&
this.errorData.error === USER_ALREADY_EXISTS);
}
isAttributeRequiredError() {
return (this.errorData instanceof CustomAuthApiError &&
this.errorData.error === ATTRIBUTES_REQUIRED);
}
isAttributeValidationFailedError() {
return ((this.errorData instanceof CustomAuthApiError &&
this.errorData.error === INVALID_GRANT &&
this.errorData.subError ===
ATTRIBUTE_VALIATION_FAILED) ||
(this.errorData instanceof InvalidArgumentError &&
this.errorData.errorDescription?.includes("attributes") ===
true));
}
isNoCachedAccountFoundError() {
return this.errorData instanceof NoCachedAccountFoundError;
}
isTokenExpiredError() {
return (this.errorData instanceof CustomAuthApiError &&
this.errorData.error === EXPIRED_TOKEN);
}
/**
* @todo verify the password change required error can be detected once the MFA is in place.
* This error will be raised during signin and refresh tokens when calling /token endpoint.
*/
isPasswordResetRequiredError() {
return (this.errorData instanceof CustomAuthApiError &&
this.errorData.error === INVALID_REQUEST &&
this.errorData.errorCodes?.includes(50142) === true);
}
isInvalidInputError() {
return (this.errorData instanceof CustomAuthApiError &&
this.errorData.error === INVALID_REQUEST &&
this.errorData.errorCodes?.includes(901001) === true);
}
isVerificationContactBlockedError() {
return (this.errorData instanceof CustomAuthApiError &&
this.errorData.error === ACCESS_DENIED &&
this.errorData.subError ===
PROVIDER_BLOCKED_BY_REPUTATION);
}
}
class AuthActionErrorBase extends AuthFlowErrorBase {
/**
* Checks if the error is due to the expired continuation token.
* @returns {boolean} True if the error is due to the expired continuation token, false otherwise.
*/
isTokenExpired() {
return this.isTokenExpiredError();
}
/**
* Check if client app supports the challenge type configured in Entra.
* @returns {boolean} True if client app doesn't support the challenge type configured in Entra, "loginPopup" function is required to continue the operation.
*/
isRedirectRequired() {
return this.isRedirectError();
}
}
export { AuthActionErrorBase, AuthFlowErrorBase };
//# sourceMappingURL=AuthFlowErrorBase.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthFlowErrorBase.mjs","sources":["../../../../src/custom_auth/core/auth_flow/AuthFlowErrorBase.ts"],"sourcesContent":[null],"names":["CustomAuthApiErrorCode.USER_NOT_FOUND","CustomAuthApiErrorCode.INVALID_REQUEST","CustomAuthApiErrorCode.UNSUPPORTED_CHALLENGE_TYPE","CustomAuthApiErrorCode.INVALID_GRANT","CustomAuthApiSuberror.INVALID_OOB_VALUE","CustomAuthApiSuberror.PASSWORD_BANNED","CustomAuthApiSuberror.PASSWORD_IS_INVALID","CustomAuthApiSuberror.PASSWORD_RECENTLY_USED","CustomAuthApiSuberror.PASSWORD_TOO_LONG","CustomAuthApiSuberror.PASSWORD_TOO_SHORT","CustomAuthApiSuberror.PASSWORD_TOO_WEAK","CustomAuthApiErrorCode.USER_ALREADY_EXISTS","CustomAuthApiErrorCode.ATTRIBUTES_REQUIRED","CustomAuthApiSuberror.ATTRIBUTE_VALIATION_FAILED","CustomAuthApiErrorCode.EXPIRED_TOKEN","CustomAuthApiErrorCode.ACCESS_DENIED","CustomAuthApiSuberror.PROVIDER_BLOCKED_BY_REPUTATION"],"mappings":";;;;;;;;AAAA;;;AAGG;AAWH;;AAEG;MACmB,iBAAiB,CAAA;AACnC,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V,QAAA,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;KACrC;AAED;;;AAGG;IACH,kBAAkB,GAAA;AACd,QAAA,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;KACjC;AACJ;;;;"}

View File

@ -0,0 +1,59 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthError } from '@azure/msal-common/browser';
import { CustomAuthError } from '../error/CustomAuthError.mjs';
import { MsalCustomAuthError } from '../error/MsalCustomAuthError.mjs';
import { UnexpectedError } from '../error/UnexpectedError.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/*
* Base class for a result of an authentication operation.
* @typeParam TState - The type of the auth flow state.
* @typeParam TError - The type of error.
* @typeParam TData - The type of the result data.
*/
class AuthFlowResultBase {
/*
*constructor for ResultBase
* @param state - The state.
* @param data - The result data.
*/
constructor(state, data) {
this.state = state;
this.data = data;
}
/*
* Creates a CustomAuthError with an error.
* @param error - The error that occurred.
* @returns The auth error.
*/
static createErrorData(error) {
if (error instanceof CustomAuthError) {
return error;
}
else if (error instanceof AuthError) {
const errorCodes = [];
if ("errorNo" in error) {
if (typeof error.errorNo === "string") {
const code = Number(error.errorNo);
if (!isNaN(code)) {
errorCodes.push(code);
}
}
else if (typeof error.errorNo === "number") {
errorCodes.push(error.errorNo);
}
}
return new MsalCustomAuthError(error.errorCode, error.errorMessage, error.subError, errorCodes, error.correlationId);
}
else {
return new UnexpectedError(error);
}
}
}
export { AuthFlowResultBase };
//# sourceMappingURL=AuthFlowResultBase.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthFlowResultBase.mjs","sources":["../../../../src/custom_auth/core/auth_flow/AuthFlowResultBase.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AASH;;;;;AAKG;MACmB,kBAAkB,CAAA;AAKpC;;;;AAIG;IACH,WAAmB,CAAA,KAAa,EAAS,IAAY,EAAA;QAAlC,IAAK,CAAA,KAAA,GAAL,KAAK,CAAQ;QAAS,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAQ;KAAI;AAOzD;;;;AAIG;IACO,OAAO,eAAe,CAAC,KAAc,EAAA;QAC3C,IAAI,KAAK,YAAY,eAAe,EAAE;AAClC,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;aAAM,IAAI,KAAK,YAAY,SAAS,EAAE;YACnC,MAAM,UAAU,GAAkB,EAAE,CAAC;YAErC,IAAI,SAAS,IAAI,KAAK,EAAE;AACpB,gBAAA,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE;oBACnC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACnC,oBAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;AACd,wBAAA,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,qBAAA;AACJ,iBAAA;AAAM,qBAAA,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE;AAC1C,oBAAA,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAClC,iBAAA;AACJ,aAAA;YAED,OAAO,IAAI,mBAAmB,CAC1B,KAAK,CAAC,SAAS,EACf,KAAK,CAAC,YAAY,EAClB,KAAK,CAAC,QAAQ,EACd,UAAU,EACV,KAAK,CAAC,aAAa,CACtB,CAAC;AACL,SAAA;AAAM,aAAA;AACH,YAAA,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;AACrC,SAAA;KACJ;AACJ;;;;"}

View File

@ -0,0 +1,45 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { InvalidArgumentError } from '../error/InvalidArgumentError.mjs';
import { ensureArgumentIsNotEmptyString } from '../utils/ArgumentValidator.mjs';
import { DefaultCustomAuthApiCodeLength } from '../../CustomAuthConstants.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Base class for the state of an authentication flow.
*/
class AuthFlowStateBase {
}
/**
* Base class for the action requried state in an authentication flow.
*/
class AuthFlowActionRequiredStateBase extends AuthFlowStateBase {
/**
* Creates a new instance of AuthFlowActionRequiredStateBase.
* @param stateParameters The parameters for the auth state.
*/
constructor(stateParameters) {
ensureArgumentIsNotEmptyString("correlationId", stateParameters.correlationId);
super();
this.stateParameters = stateParameters;
}
ensureCodeIsValid(code, codeLength) {
if (codeLength !== DefaultCustomAuthApiCodeLength &&
(!code || code.length !== codeLength)) {
this.stateParameters.logger.error("0jr92e", this.stateParameters.correlationId);
throw new InvalidArgumentError("code", this.stateParameters.correlationId);
}
}
ensurePasswordIsNotEmpty(password) {
if (!password) {
this.stateParameters.logger.error("140ijv", this.stateParameters.correlationId);
throw new InvalidArgumentError("password", this.stateParameters.correlationId);
}
}
}
export { AuthFlowActionRequiredStateBase, AuthFlowStateBase };
//# sourceMappingURL=AuthFlowState.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthFlowState.mjs","sources":["../../../../src/custom_auth/core/auth_flow/AuthFlowState.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAeH;;AAEG;MACmB,iBAAiB,CAAA;AAKtC,CAAA;AAED;;AAEG;AACG,MAAgB,+BAEpB,SAAQ,iBAAiB,CAAA;AACvB;;;AAGG;AACH,IAAA,WAAA,CAA+B,eAA2B,EAAA;AACtD,QAAA,8BAA8B,CAC1B,eAAe,EACf,eAAe,CAAC,aAAa,CAChC,CAAC;AAEF,QAAA,KAAK,EAAE,CAAC;QANmB,IAAe,CAAA,eAAA,GAAf,eAAe,CAAY;KAOzD;IAES,iBAAiB,CAAC,IAAY,EAAE,UAAkB,EAAA;QACxD,IACI,UAAU,KAAK,8BAA8B;aAC5C,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,EACvC;AACE,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAC7B,QAAoE,EAAA,IAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA;YAIxE,MAAM,IAAI,oBAAoB,CAC1B,MAAM,EACN,IAAI,CAAC,eAAe,CAAC,aAAa,CACrC,CAAC;AACL,SAAA;KACJ;AAES,IAAA,wBAAwB,CAAC,QAAgB,EAAA;QAC/C,IAAI,CAAC,QAAQ,EAAE;AACX,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAC7B,QAA6D,EAAA,IAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA;YAIjE,MAAM,IAAI,oBAAoB,CAC1B,UAAU,EACV,IAAI,CAAC,eAAe,CAAC,aAAa,CACrC,CAAC;AACL,SAAA;KACJ;AACJ;;;;"}

View File

@ -0,0 +1,45 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
// Sign in state types
const SIGN_IN_CODE_REQUIRED_STATE_TYPE = "SignInCodeRequiredState";
const SIGN_IN_PASSWORD_REQUIRED_STATE_TYPE = "SignInPasswordRequiredState";
const SIGN_IN_CONTINUATION_STATE_TYPE = "SignInContinuationState";
const SIGN_IN_COMPLETED_STATE_TYPE = "SignInCompletedState";
const SIGN_IN_FAILED_STATE_TYPE = "SignInFailedState";
// Sign up state types
const SIGN_UP_CODE_REQUIRED_STATE_TYPE = "SignUpCodeRequiredState";
const SIGN_UP_PASSWORD_REQUIRED_STATE_TYPE = "SignUpPasswordRequiredState";
const SIGN_UP_ATTRIBUTES_REQUIRED_STATE_TYPE = "SignUpAttributesRequiredState";
const SIGN_UP_COMPLETED_STATE_TYPE = "SignUpCompletedState";
const SIGN_UP_FAILED_STATE_TYPE = "SignUpFailedState";
// Reset password state types
const RESET_PASSWORD_CODE_REQUIRED_STATE_TYPE = "ResetPasswordCodeRequiredState";
const RESET_PASSWORD_PASSWORD_REQUIRED_STATE_TYPE = "ResetPasswordPasswordRequiredState";
const RESET_PASSWORD_COMPLETED_STATE_TYPE = "ResetPasswordCompletedState";
const RESET_PASSWORD_FAILED_STATE_TYPE = "ResetPasswordFailedState";
// Get account state types
const GET_ACCOUNT_COMPLETED_STATE_TYPE = "GetAccountCompletedState";
const GET_ACCOUNT_FAILED_STATE_TYPE = "GetAccountFailedState";
// Get access token state types
const GET_ACCESS_TOKEN_COMPLETED_STATE_TYPE = "GetAccessTokenCompletedState";
const GET_ACCESS_TOKEN_FAILED_STATE_TYPE = "GetAccessTokenFailedState";
// Sign out state types
const SIGN_OUT_COMPLETED_STATE_TYPE = "SignOutCompletedState";
const SIGN_OUT_FAILED_STATE_TYPE = "SignOutFailedState";
// MFA state types
const MFA_AWAITING_STATE_TYPE = "MfaAwaitingState";
const MFA_VERIFICATION_REQUIRED_STATE_TYPE = "MfaVerificationRequiredState";
const MFA_COMPLETED_STATE_TYPE = "MfaCompletedState";
const MFA_FAILED_STATE_TYPE = "MfaFailedState";
// Auth method registration (JIT) state types
const AUTH_METHOD_REGISTRATION_REQUIRED_STATE_TYPE = "AuthMethodRegistrationRequiredState";
const AUTH_METHOD_VERIFICATION_REQUIRED_STATE_TYPE = "AuthMethodVerificationRequiredState";
const AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE = "AuthMethodRegistrationCompletedState";
const AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE = "AuthMethodRegistrationFailedState";
export { AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE, AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE, AUTH_METHOD_REGISTRATION_REQUIRED_STATE_TYPE, AUTH_METHOD_VERIFICATION_REQUIRED_STATE_TYPE, GET_ACCESS_TOKEN_COMPLETED_STATE_TYPE, GET_ACCESS_TOKEN_FAILED_STATE_TYPE, GET_ACCOUNT_COMPLETED_STATE_TYPE, GET_ACCOUNT_FAILED_STATE_TYPE, MFA_AWAITING_STATE_TYPE, MFA_COMPLETED_STATE_TYPE, MFA_FAILED_STATE_TYPE, MFA_VERIFICATION_REQUIRED_STATE_TYPE, RESET_PASSWORD_CODE_REQUIRED_STATE_TYPE, RESET_PASSWORD_COMPLETED_STATE_TYPE, RESET_PASSWORD_FAILED_STATE_TYPE, RESET_PASSWORD_PASSWORD_REQUIRED_STATE_TYPE, SIGN_IN_CODE_REQUIRED_STATE_TYPE, SIGN_IN_COMPLETED_STATE_TYPE, SIGN_IN_CONTINUATION_STATE_TYPE, SIGN_IN_FAILED_STATE_TYPE, SIGN_IN_PASSWORD_REQUIRED_STATE_TYPE, SIGN_OUT_COMPLETED_STATE_TYPE, SIGN_OUT_FAILED_STATE_TYPE, SIGN_UP_ATTRIBUTES_REQUIRED_STATE_TYPE, SIGN_UP_CODE_REQUIRED_STATE_TYPE, SIGN_UP_COMPLETED_STATE_TYPE, SIGN_UP_FAILED_STATE_TYPE, SIGN_UP_PASSWORD_REQUIRED_STATE_TYPE };
//# sourceMappingURL=AuthFlowStateTypes.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthFlowStateTypes.mjs","sources":["../../../../src/custom_auth/core/auth_flow/AuthFlowStateTypes.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEH;AACO,MAAM,gCAAgC,GAAG,0BAA0B;AACnE,MAAM,oCAAoC,GAC7C,8BAA8B;AAC3B,MAAM,+BAA+B,GAAG,0BAA0B;AAClE,MAAM,4BAA4B,GAAG,uBAAuB;AAC5D,MAAM,yBAAyB,GAAG,oBAAoB;AAE7D;AACO,MAAM,gCAAgC,GAAG,0BAA0B;AACnE,MAAM,oCAAoC,GAC7C,8BAA8B;AAC3B,MAAM,sCAAsC,GAC/C,gCAAgC;AAC7B,MAAM,4BAA4B,GAAG,uBAAuB;AAC5D,MAAM,yBAAyB,GAAG,oBAAoB;AAE7D;AACO,MAAM,uCAAuC,GAChD,iCAAiC;AAC9B,MAAM,2CAA2C,GACpD,qCAAqC;AAClC,MAAM,mCAAmC,GAC5C,8BAA8B;AAC3B,MAAM,gCAAgC,GAAG,2BAA2B;AAE3E;AACO,MAAM,gCAAgC,GAAG,2BAA2B;AACpE,MAAM,6BAA6B,GAAG,wBAAwB;AAErE;AACO,MAAM,qCAAqC,GAC9C,+BAA+B;AAC5B,MAAM,kCAAkC,GAAG,4BAA4B;AAE9E;AACO,MAAM,6BAA6B,GAAG,wBAAwB;AAC9D,MAAM,0BAA0B,GAAG,qBAAqB;AAE/D;AACO,MAAM,uBAAuB,GAAG,mBAAmB;AACnD,MAAM,oCAAoC,GAC7C,+BAA+B;AAC5B,MAAM,wBAAwB,GAAG,oBAAoB;AACrD,MAAM,qBAAqB,GAAG,iBAAiB;AAEtD;AACO,MAAM,4CAA4C,GACrD,sCAAsC;AACnC,MAAM,4CAA4C,GACrD,sCAAsC;AACnC,MAAM,6CAA6C,GACtD,uCAAuC;AACpC,MAAM,0CAA0C,GACnD;;;;"}

View File

@ -0,0 +1,42 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthActionErrorBase } from '../../AuthFlowErrorBase.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Error that occurred during authentication method challenge request.
*/
class AuthMethodRegistrationChallengeMethodError extends AuthActionErrorBase {
/**
* Checks if the input for auth method registration is incorrect.
* @returns true if the input is incorrect, false otherwise.
*/
isInvalidInput() {
return this.isInvalidInputError();
}
/**
* Checks if the error is due to the verification contact (e.g., phone number or email) being blocked. Consider using a different email/phone number or a different authentication method.
* @returns true if the error is due to the verification contact being blocked, false otherwise.
*/
isVerificationContactBlocked() {
return this.isVerificationContactBlockedError();
}
}
/**
* Error that occurred during authentication method challenge submission.
*/
class AuthMethodRegistrationSubmitChallengeError extends AuthActionErrorBase {
/**
* Checks if the submitted challenge code is incorrect.
* @returns true if the challenge code is incorrect, false otherwise.
*/
isIncorrectChallenge() {
return this.isInvalidCodeError();
}
}
export { AuthMethodRegistrationChallengeMethodError, AuthMethodRegistrationSubmitChallengeError };
//# sourceMappingURL=AuthMethodRegistrationError.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthMethodRegistrationError.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;AAEG;AACG,MAAO,0CAA2C,SAAQ,mBAAmB,CAAA;AAC/E;;;AAGG;IACH,cAAc,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;KACrC;AAED;;;AAGG;IACH,4BAA4B,GAAA;AACxB,QAAA,OAAO,IAAI,CAAC,iCAAiC,EAAE,CAAC;KACnD;AACJ,CAAA;AAED;;AAEG;AACG,MAAO,0CAA2C,SAAQ,mBAAmB,CAAA;AAC/E;;;AAGG;IACH,oBAAoB,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;KACpC;AACJ;;;;"}

View File

@ -0,0 +1,56 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowResultBase } from '../../AuthFlowResultBase.mjs';
import { AuthMethodRegistrationChallengeMethodError } from '../error_type/AuthMethodRegistrationError.mjs';
import { AuthMethodRegistrationFailedState } from '../state/AuthMethodRegistrationFailedState.mjs';
import { AUTH_METHOD_VERIFICATION_REQUIRED_STATE_TYPE, AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE, AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Result of challenging an authentication method for registration.
* Uses base state type to avoid circular dependencies.
*/
class AuthMethodRegistrationChallengeMethodResult extends AuthFlowResultBase {
/**
* Creates an AuthMethodRegistrationChallengeMethodResult with an error.
* @param error The error that occurred.
* @returns The AuthMethodRegistrationChallengeMethodResult with error.
*/
static createWithError(error) {
const result = new AuthMethodRegistrationChallengeMethodResult(new AuthMethodRegistrationFailedState());
result.error = new AuthMethodRegistrationChallengeMethodError(AuthMethodRegistrationChallengeMethodResult.createErrorData(error));
return result;
}
/**
* Checks if the result indicates that verification is required.
* @returns true if verification is required, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isVerificationRequired() {
return (this.state.stateType ===
AUTH_METHOD_VERIFICATION_REQUIRED_STATE_TYPE);
}
/**
* Checks if the result indicates that registration is completed (fast-pass scenario).
* @returns true if registration is completed, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isCompleted() {
return (this.state.stateType ===
AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE);
}
/**
* Checks if the result is in a failed state.
* @returns true if the result is failed, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isFailed() {
return (this.state.stateType === AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE);
}
}
export { AuthMethodRegistrationChallengeMethodResult };
//# sourceMappingURL=AuthMethodRegistrationChallengeMethodResult.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthMethodRegistrationChallengeMethodResult.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAcH;;;AAGG;AACG,MAAO,2CAA4C,SAAQ,kBAIhE,CAAA;AACG;;;;AAIG;IACH,OAAO,eAAe,CAClB,KAAc,EAAA;QAEd,MAAM,MAAM,GAAG,IAAI,2CAA2C,CAC1D,IAAI,iCAAiC,EAAE,CAC1C,CAAC;AACF,QAAA,MAAM,CAAC,KAAK,GAAG,IAAI,0CAA0C,CACzD,2CAA2C,CAAC,eAAe,CAAC,KAAK,CAAC,CACrE,CAAC;AACF,QAAA,OAAO,MAAM,CAAC;KACjB;AAED;;;;AAIG;IACH,sBAAsB,GAAA;AAGlB,QAAA,QACI,IAAI,CAAC,KAAK,CAAC,SAAS;AACpB,YAAA,4CAA4C,EAC9C;KACL;AAED;;;;AAIG;IACH,WAAW,GAAA;AAGP,QAAA,QACI,IAAI,CAAC,KAAK,CAAC,SAAS;AACpB,YAAA,6CAA6C,EAC/C;KACL;AAED;;;;AAIG;IACH,QAAQ,GAAA;QAGJ,QACI,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,0CAA0C,EACrE;KACL;AACJ;;;;"}

View File

@ -0,0 +1,46 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowResultBase } from '../../AuthFlowResultBase.mjs';
import { AuthMethodRegistrationSubmitChallengeError } from '../error_type/AuthMethodRegistrationError.mjs';
import { AuthMethodRegistrationFailedState } from '../state/AuthMethodRegistrationFailedState.mjs';
import { AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE, AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Result of submitting a challenge for authentication method registration.
*/
class AuthMethodRegistrationSubmitChallengeResult extends AuthFlowResultBase {
/**
* Creates an AuthMethodRegistrationSubmitChallengeResult with an error.
* @param error The error that occurred.
* @returns The AuthMethodRegistrationSubmitChallengeResult with error.
*/
static createWithError(error) {
const result = new AuthMethodRegistrationSubmitChallengeResult(new AuthMethodRegistrationFailedState());
result.error = new AuthMethodRegistrationSubmitChallengeError(AuthMethodRegistrationSubmitChallengeResult.createErrorData(error));
return result;
}
/**
* Checks if the result indicates that registration is completed.
* @returns true if registration is completed, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isCompleted() {
return (this.state.stateType ===
AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE);
}
/**
* Checks if the result is in a failed state.
* @returns true if the result is failed, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isFailed() {
return (this.state.stateType === AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE);
}
}
export { AuthMethodRegistrationSubmitChallengeResult };
//# sourceMappingURL=AuthMethodRegistrationSubmitChallengeResult.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthMethodRegistrationSubmitChallengeResult.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAYH;;AAEG;AACG,MAAO,2CAA4C,SAAQ,kBAIhE,CAAA;AACG;;;;AAIG;IACH,OAAO,eAAe,CAClB,KAAc,EAAA;QAEd,MAAM,MAAM,GAAG,IAAI,2CAA2C,CAC1D,IAAI,iCAAiC,EAAE,CAC1C,CAAC;AACF,QAAA,MAAM,CAAC,KAAK,GAAG,IAAI,0CAA0C,CACzD,2CAA2C,CAAC,eAAe,CAAC,KAAK,CAAC,CACrE,CAAC;AACF,QAAA,OAAO,MAAM,CAAC;KACjB;AAED;;;;AAIG;IACH,WAAW,GAAA;AAGP,QAAA,QACI,IAAI,CAAC,KAAK,CAAC,SAAS;AACpB,YAAA,6CAA6C,EAC/C;KACL;AAED;;;;AAIG;IACH,QAAQ,GAAA;QAGJ,QACI,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,0CAA0C,EACrE;KACL;AACJ;;;;"}

View File

@ -0,0 +1,24 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowStateBase } from '../../AuthFlowState.mjs';
import { AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* State indicating that the auth method registration flow has completed successfully.
*/
class AuthMethodRegistrationCompletedState extends AuthFlowStateBase {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = AUTH_METHOD_REGISTRATION_COMPLETED_STATE_TYPE;
}
}
export { AuthMethodRegistrationCompletedState };
//# sourceMappingURL=AuthMethodRegistrationCompletedState.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthMethodRegistrationCompletedState.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;AAEG;AACG,MAAO,oCAAqC,SAAQ,iBAAiB,CAAA;AAA3E,IAAA,WAAA,GAAA;;AACI;;AAEG;QACH,IAAS,CAAA,SAAA,GAAG,6CAA6C,CAAC;KAC7D;AAAA;;;;"}

View File

@ -0,0 +1,24 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowStateBase } from '../../AuthFlowState.mjs';
import { AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* State indicating that the auth method registration flow has failed.
*/
class AuthMethodRegistrationFailedState extends AuthFlowStateBase {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = AUTH_METHOD_REGISTRATION_FAILED_STATE_TYPE;
}
}
export { AuthMethodRegistrationFailedState };
//# sourceMappingURL=AuthMethodRegistrationFailedState.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthMethodRegistrationFailedState.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;AAEG;AACG,MAAO,iCAAkC,SAAQ,iBAAiB,CAAA;AAAxE,IAAA,WAAA,GAAA;;AACI;;AAEG;QACH,IAAS,CAAA,SAAA,GAAG,0CAA0C,CAAC;KAC1D;AAAA;;;;"}

View File

@ -0,0 +1,181 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { CustomAuthAccountData } from '../../../../get_account/auth_flow/CustomAuthAccountData.mjs';
import { JIT_VERIFICATION_REQUIRED_RESULT_TYPE, JIT_COMPLETED_RESULT_TYPE } from '../../../interaction_client/jit/result/JitActionResult.mjs';
import { UnexpectedError } from '../../../error/UnexpectedError.mjs';
import { AuthFlowActionRequiredStateBase } from '../../AuthFlowState.mjs';
import { GrantType } from '../../../../CustomAuthConstants.mjs';
import { AuthMethodRegistrationChallengeMethodResult } from '../result/AuthMethodRegistrationChallengeMethodResult.mjs';
import { AuthMethodRegistrationSubmitChallengeResult } from '../result/AuthMethodRegistrationSubmitChallengeResult.mjs';
import { AuthMethodRegistrationCompletedState } from './AuthMethodRegistrationCompletedState.mjs';
import { AUTH_METHOD_REGISTRATION_REQUIRED_STATE_TYPE, AUTH_METHOD_VERIFICATION_REQUIRED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Abstract base class for authentication method registration states.
*/
class AuthMethodRegistrationState extends AuthFlowActionRequiredStateBase {
/**
* Internal method to challenge an authentication method.
* @param authMethodDetails The authentication method details to challenge.
* @returns Promise that resolves to AuthMethodRegistrationChallengeMethodResult.
*/
async challengeAuthMethodInternal(authMethodDetails) {
try {
this.stateParameters.logger.verbose("0vi650", this.stateParameters.correlationId);
const challengeParams = {
correlationId: this.stateParameters.correlationId,
continuationToken: this.stateParameters.continuationToken ?? "",
authMethod: authMethodDetails.authMethodType,
verificationContact: authMethodDetails.verificationContact,
scopes: this.stateParameters.scopes ?? [],
username: this.stateParameters.username,
claims: this.stateParameters.claims,
};
const result = await this.stateParameters.jitClient.challengeAuthMethod(challengeParams);
this.stateParameters.logger.verbose("1ipjwn", this.stateParameters.correlationId);
if (result.type === JIT_VERIFICATION_REQUIRED_RESULT_TYPE) {
// Verification required
this.stateParameters.logger.verbose("0puifv", this.stateParameters.correlationId);
return new AuthMethodRegistrationChallengeMethodResult(new AuthMethodVerificationRequiredState({
correlationId: result.correlationId,
continuationToken: result.continuationToken,
config: this.stateParameters.config,
logger: this.stateParameters.logger,
jitClient: this.stateParameters.jitClient,
cacheClient: this.stateParameters.cacheClient,
challengeChannel: result.challengeChannel,
challengeTargetLabel: result.challengeTargetLabel,
codeLength: result.codeLength,
scopes: this.stateParameters.scopes ?? [],
username: this.stateParameters.username,
claims: this.stateParameters.claims,
}));
}
else if (result.type === JIT_COMPLETED_RESULT_TYPE) {
// Registration completed (fast-pass scenario)
this.stateParameters.logger.verbose("01b21i", this.stateParameters.correlationId);
const accountInfo = new CustomAuthAccountData(result.authenticationResult.account, this.stateParameters.config, this.stateParameters.cacheClient, this.stateParameters.logger, this.stateParameters.correlationId);
return new AuthMethodRegistrationChallengeMethodResult(new AuthMethodRegistrationCompletedState(), accountInfo);
}
else {
// Handle unexpected result type with proper typing
this.stateParameters.logger.error("16lk12", this.stateParameters.correlationId);
throw new UnexpectedError("Unexpected result type from auth challenge method");
}
}
catch (error) {
this.stateParameters.logger.errorPii("17im04", this.stateParameters.correlationId);
return AuthMethodRegistrationChallengeMethodResult.createWithError(error);
}
}
}
/**
* State indicating that authentication method registration is required.
*/
class AuthMethodRegistrationRequiredState extends AuthMethodRegistrationState {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = AUTH_METHOD_REGISTRATION_REQUIRED_STATE_TYPE;
}
/**
* Gets the available authentication methods for registration.
* @returns Array of available authentication methods.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getAuthMethods() {
return this.stateParameters.authMethods;
}
/**
* Challenges an authentication method for registration.
* @param authMethodDetails The authentication method details to challenge.
* @returns Promise that resolves to AuthMethodRegistrationChallengeMethodResult.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
async challengeAuthMethod(authMethodDetails) {
return this.challengeAuthMethodInternal(authMethodDetails);
}
}
/**
* State indicating that verification is required for the challenged authentication method.
*/
class AuthMethodVerificationRequiredState extends AuthMethodRegistrationState {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = AUTH_METHOD_VERIFICATION_REQUIRED_STATE_TYPE;
}
/**
* Gets the length of the expected verification code.
* @returns The code length.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getCodeLength() {
return this.stateParameters.codeLength;
}
/**
* Gets the channel through which the challenge was sent.
* @returns The challenge channel (e.g., "email").
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getChannel() {
return this.stateParameters.challengeChannel;
}
/**
* Gets the target label indicating where the challenge was sent.
* @returns The challenge target label (e.g., masked email address).
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getSentTo() {
return this.stateParameters.challengeTargetLabel;
}
/**
* Submits the verification challenge to complete the authentication method registration.
* @param code The verification code entered by the user.
* @returns Promise that resolves to AuthMethodRegistrationSubmitChallengeResult.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
async submitChallenge(code) {
try {
this.ensureCodeIsValid(code, this.getCodeLength());
this.stateParameters.logger.verbose("084cxu", this.stateParameters.correlationId);
const submitParams = {
correlationId: this.stateParameters.correlationId,
continuationToken: this.stateParameters.continuationToken ?? "",
scopes: this.stateParameters.scopes ?? [],
grantType: GrantType.OOB,
challenge: code,
username: this.stateParameters.username,
claims: this.stateParameters.claims,
};
const result = await this.stateParameters.jitClient.submitChallenge(submitParams);
this.stateParameters.logger.verbose("0hi8xc", this.stateParameters.correlationId);
const accountInfo = new CustomAuthAccountData(result.authenticationResult.account, this.stateParameters.config, this.stateParameters.cacheClient, this.stateParameters.logger, this.stateParameters.correlationId);
return new AuthMethodRegistrationSubmitChallengeResult(new AuthMethodRegistrationCompletedState(), accountInfo);
}
catch (error) {
this.stateParameters.logger.errorPii("0njepo", this.stateParameters.correlationId);
return AuthMethodRegistrationSubmitChallengeResult.createWithError(error);
}
}
/**
* Challenges a different authentication method for registration.
* @param authMethodDetails The authentication method details to challenge.
* @returns Promise that resolves to AuthMethodRegistrationChallengeMethodResult.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
async challengeAuthMethod(authMethodDetails) {
return this.challengeAuthMethodInternal(authMethodDetails);
}
}
export { AuthMethodRegistrationRequiredState, AuthMethodVerificationRequiredState };
//# sourceMappingURL=AuthMethodRegistrationState.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AuthMethodRegistrationState.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;AAGG;AA6BH;;AAEG;AACH,MAAe,2BAEb,SAAQ,+BAA4C,CAAA;AAClD;;;;AAIG;IACO,MAAM,2BAA2B,CACvC,iBAAoC,EAAA;QAEpC,IAAI;YACA,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,4CAAyD,CAAA,CAAA;AAI7D,YAAA,MAAM,eAAe,GAAiC;AAClD,gBAAA,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC,aAAa;AACjD,gBAAA,iBAAiB,EAAE,IAAI,CAAC,eAAe,CAAC,iBAAiB,IAAI,EAAE;gBAC/D,UAAU,EAAE,iBAAiB,CAAC,cAAc;gBAC5C,mBAAmB,EAAE,iBAAiB,CAAC,mBAAmB;AAC1D,gBAAA,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,IAAI,EAAE;AACzC,gBAAA,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ;AACvC,gBAAA,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM;aACtC,CAAC;AAEF,YAAA,MAAM,MAAM,GACR,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,mBAAmB,CACpD,eAAe,CAClB,CAAC;AAEN,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,QAA6E,EAAA,IAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA;AAIjF,YAAA,IAAI,MAAM,CAAC,IAAI,KAAK,qCAAqC,EAAE;;AAEvD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,eAAe,CAAC,aAAa,CACrC,CAAC;YAEF,OAAO,IAAI,2CAA2C,CAClD,IAAI,oCAAoC,EAAE,EAC1C,WAAW,CACd,CAAC;AACL,SAAA;AAAC,QAAA,OAAO,KAAK,EAAE;AACZ,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAChC,QAAA,EAAA,IAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA;AAGJ,YAAA,OAAO,2CAA2C,CAAC,eAAe,CAC9D,KAAK,CACR,CAAC;AACL,SAAA;KACJ;AAED;;;;;AAKG;IACH,MAAM,mBAAmB,CACrB,iBAAoC,EAAA;AAEpC,QAAA,OAAO,IAAI,CAAC,2BAA2B,CAAC,iBAAiB,CAAC,CAAC;KAC9D;AACJ;;;;"}

View File

@ -0,0 +1,42 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthActionErrorBase } from '../../AuthFlowErrorBase.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Error that occurred during MFA challenge request.
*/
class MfaRequestChallengeError extends AuthActionErrorBase {
/**
* Checks if the input for MFA challenge is incorrect.
* @returns true if the input is incorrect, false otherwise.
*/
isInvalidInput() {
return this.isInvalidInputError();
}
/**
* Checks if the error is due to the verification contact (e.g., phone number or email) being blocked. Consider contacting customer support for assistance.
* @returns true if the error is due to the verification contact being blocked, false otherwise.
*/
isVerificationContactBlocked() {
return this.isVerificationContactBlockedError();
}
}
/**
* Error that occurred during MFA challenge submission.
*/
class MfaSubmitChallengeError extends AuthActionErrorBase {
/**
* Checks if the submitted challenge code (e.g., OTP code) is incorrect.
* @returns true if the challenge code is invalid, false otherwise.
*/
isIncorrectChallenge() {
return this.isInvalidCodeError();
}
}
export { MfaRequestChallengeError, MfaSubmitChallengeError };
//# sourceMappingURL=MfaError.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MfaError.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/mfa/error_type/MfaError.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH;;AAEG;AACG,MAAO,wBAAyB,SAAQ,mBAAmB,CAAA;AAC7D;;;AAGG;IACH,cAAc,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;KACrC;AAED;;;AAGG;IACH,4BAA4B,GAAA;AACxB,QAAA,OAAO,IAAI,CAAC,iCAAiC,EAAE,CAAC;KACnD;AACJ,CAAA;AAED;;AAEG;AACG,MAAO,uBAAwB,SAAQ,mBAAmB,CAAA;AAC5D;;;AAGG;IACH,oBAAoB,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;KACpC;AACJ;;;;"}

View File

@ -0,0 +1,46 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowResultBase } from '../../AuthFlowResultBase.mjs';
import { MfaRequestChallengeError } from '../error_type/MfaError.mjs';
import { MfaFailedState } from '../state/MfaFailedState.mjs';
import { MFA_VERIFICATION_REQUIRED_STATE_TYPE, MFA_FAILED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Result of requesting an MFA challenge.
* Uses base state type to avoid circular dependencies.
*/
class MfaRequestChallengeResult extends AuthFlowResultBase {
/**
* Creates an MfaRequestChallengeResult with an error.
* @param error The error that occurred.
* @returns The MfaRequestChallengeResult with error.
*/
static createWithError(error) {
const result = new MfaRequestChallengeResult(new MfaFailedState());
result.error = new MfaRequestChallengeError(MfaRequestChallengeResult.createErrorData(error));
return result;
}
/**
* Checks if the result indicates that verification is required.
* @returns true if verification is required, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isVerificationRequired() {
return this.state.stateType === MFA_VERIFICATION_REQUIRED_STATE_TYPE;
}
/**
* Checks if the result is in a failed state.
* @returns true if the result is failed, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isFailed() {
return this.state.stateType === MFA_FAILED_STATE_TYPE;
}
}
export { MfaRequestChallengeResult };
//# sourceMappingURL=MfaRequestChallengeResult.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MfaRequestChallengeResult.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAWH;;;AAGG;AACG,MAAO,yBAA0B,SAAQ,kBAG9C,CAAA;AACG;;;;AAIG;IACH,OAAO,eAAe,CAAC,KAAc,EAAA;QACjC,MAAM,MAAM,GAAG,IAAI,yBAAyB,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC;AACnE,QAAA,MAAM,CAAC,KAAK,GAAG,IAAI,wBAAwB,CACvC,yBAAyB,CAAC,eAAe,CAAC,KAAK,CAAC,CACnD,CAAC;AACF,QAAA,OAAO,MAAM,CAAC;KACjB;AAED;;;;AAIG;IACH,sBAAsB,GAAA;AAGlB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,oCAAoC,CAAC;KACxE;AAED;;;;AAIG;IACH,QAAQ,GAAA;AAGJ,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,qBAAqB,CAAC;KACzD;AACJ;;;;"}

View File

@ -0,0 +1,45 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowResultBase } from '../../AuthFlowResultBase.mjs';
import { MfaSubmitChallengeError } from '../error_type/MfaError.mjs';
import { MfaFailedState } from '../state/MfaFailedState.mjs';
import { MFA_COMPLETED_STATE_TYPE, MFA_FAILED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Result of submitting an MFA challenge.
*/
class MfaSubmitChallengeResult extends AuthFlowResultBase {
/**
* Creates an MfaSubmitChallengeResult with an error.
* @param error The error that occurred.
* @returns The MfaSubmitChallengeResult with error.
*/
static createWithError(error) {
const result = new MfaSubmitChallengeResult(new MfaFailedState());
result.error = new MfaSubmitChallengeError(MfaSubmitChallengeResult.createErrorData(error));
return result;
}
/**
* Checks if the MFA flow is completed successfully.
* @returns true if completed, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isCompleted() {
return this.state.stateType === MFA_COMPLETED_STATE_TYPE;
}
/**
* Checks if the result is in a failed state.
* @returns true if the result is failed, false otherwise.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
isFailed() {
return this.state.stateType === MFA_FAILED_STATE_TYPE;
}
}
export { MfaSubmitChallengeResult };
//# sourceMappingURL=MfaSubmitChallengeResult.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MfaSubmitChallengeResult.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AAYH;;AAEG;AACG,MAAO,wBAAyB,SAAQ,kBAI7C,CAAA;AACG;;;;AAIG;IACH,OAAO,eAAe,CAAC,KAAc,EAAA;QACjC,MAAM,MAAM,GAAG,IAAI,wBAAwB,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC;AAClE,QAAA,MAAM,CAAC,KAAK,GAAG,IAAI,uBAAuB,CACtC,wBAAwB,CAAC,eAAe,CAAC,KAAK,CAAC,CAClD,CAAC;AACF,QAAA,OAAO,MAAM,CAAC;KACjB;AAED;;;;AAIG;IACH,WAAW,GAAA;AAGP,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,wBAAwB,CAAC;KAC5D;AAED;;;;AAIG;IACH,QAAQ,GAAA;AAGJ,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,qBAAqB,CAAC;KACzD;AACJ;;;;"}

View File

@ -0,0 +1,24 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowStateBase } from '../../AuthFlowState.mjs';
import { MFA_COMPLETED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* State indicating that the MFA flow has completed successfully.
*/
class MfaCompletedState extends AuthFlowStateBase {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = MFA_COMPLETED_STATE_TYPE;
}
}
export { MfaCompletedState };
//# sourceMappingURL=MfaCompletedState.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MfaCompletedState.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;AAEG;AACG,MAAO,iBAAkB,SAAQ,iBAAiB,CAAA;AAAxD,IAAA,WAAA,GAAA;;AACI;;AAEG;QACH,IAAS,CAAA,SAAA,GAAG,wBAAwB,CAAC;KACxC;AAAA;;;;"}

View File

@ -0,0 +1,24 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { AuthFlowStateBase } from '../../AuthFlowState.mjs';
import { MFA_FAILED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* State indicating that the MFA flow has failed.
*/
class MfaFailedState extends AuthFlowStateBase {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = MFA_FAILED_STATE_TYPE;
}
}
export { MfaFailedState };
//# sourceMappingURL=MfaFailedState.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MfaFailedState.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/mfa/state/MfaFailedState.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;AAEG;AACG,MAAO,cAAe,SAAQ,iBAAiB,CAAA;AAArD,IAAA,WAAA,GAAA;;AACI;;AAEG;QACH,IAAS,CAAA,SAAA,GAAG,qBAAqB,CAAC;KACrC;AAAA;;;;"}

View File

@ -0,0 +1,140 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { MfaSubmitChallengeResult } from '../result/MfaSubmitChallengeResult.mjs';
import { MfaRequestChallengeResult } from '../result/MfaRequestChallengeResult.mjs';
import { CustomAuthAccountData } from '../../../../get_account/auth_flow/CustomAuthAccountData.mjs';
import { MfaCompletedState } from './MfaCompletedState.mjs';
import { ensureArgumentIsNotEmptyString } from '../../../utils/ArgumentValidator.mjs';
import { AuthFlowActionRequiredStateBase } from '../../AuthFlowState.mjs';
import { MFA_AWAITING_STATE_TYPE, MFA_VERIFICATION_REQUIRED_STATE_TYPE } from '../../AuthFlowStateTypes.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class MfaState extends AuthFlowActionRequiredStateBase {
/**
* Requests an MFA challenge for a specific authentication method.
* @param authMethodId The authentication method ID to use for the challenge.
* @returns Promise that resolves to MfaRequestChallengeResult.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
async requestChallenge(authMethodId) {
try {
ensureArgumentIsNotEmptyString("authMethodId", authMethodId);
this.stateParameters.logger.verbose("1cnvk7", this.stateParameters.correlationId);
const requestParams = {
correlationId: this.stateParameters.correlationId,
continuationToken: this.stateParameters.continuationToken ?? "",
challengeType: this.stateParameters.config.customAuth.challengeTypes ?? [],
authMethodId: authMethodId,
};
const result = await this.stateParameters.mfaClient.requestChallenge(requestParams);
this.stateParameters.logger.verbose("0rb7r9", this.stateParameters.correlationId);
return new MfaRequestChallengeResult(new MfaVerificationRequiredState({
correlationId: result.correlationId,
continuationToken: result.continuationToken,
config: this.stateParameters.config,
logger: this.stateParameters.logger,
mfaClient: this.stateParameters.mfaClient,
cacheClient: this.stateParameters.cacheClient,
challengeChannel: result.challengeChannel,
challengeTargetLabel: result.challengeTargetLabel,
codeLength: result.codeLength,
selectedAuthMethodId: authMethodId,
scopes: this.stateParameters.scopes ?? [],
}));
}
catch (error) {
this.stateParameters.logger.errorPii("0bt3wx", this.stateParameters.correlationId);
return MfaRequestChallengeResult.createWithError(error);
}
}
}
/**
* State indicating that MFA is required and awaiting user action.
* This state allows the developer to pause execution before sending the code to the user's email.
*/
class MfaAwaitingState extends MfaState {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = MFA_AWAITING_STATE_TYPE;
}
/**
* Gets the available authentication methods for MFA.
* @returns Array of available authentication methods.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getAuthMethods() {
return this.stateParameters.authMethods;
}
}
/**
* State indicating that MFA verification is required.
* The challenge has been sent and the user needs to provide the code.
*/
class MfaVerificationRequiredState extends MfaState {
constructor() {
super(...arguments);
/**
* The type of the state.
*/
this.stateType = MFA_VERIFICATION_REQUIRED_STATE_TYPE;
}
/**
* Gets the length of the code that the user needs to provide.
* @returns The expected code length.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getCodeLength() {
return this.stateParameters.codeLength;
}
/**
* Gets the channel through which the challenge was sent.
* @returns The challenge channel (e.g., "email").
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getChannel() {
return this.stateParameters.challengeChannel;
}
/**
* Gets the target label indicating where the challenge was sent.
* @returns The challenge target label (e.g., masked email address).
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
getSentTo() {
return this.stateParameters.challengeTargetLabel;
}
/**
* Submits the MFA challenge (e.g., OTP code) to complete the authentication.
* @param challenge The challenge code (e.g., OTP code) entered by the user.
* @returns Promise that resolves to MfaSubmitChallengeResult.
* @warning This API is experimental. It may be changed in the future without notice. Do not use in production applications.
*/
async submitChallenge(challenge) {
try {
this.ensureCodeIsValid(challenge, this.getCodeLength());
this.stateParameters.logger.verbose("1pi02n", this.stateParameters.correlationId);
const submitParams = {
correlationId: this.stateParameters.correlationId,
continuationToken: this.stateParameters.continuationToken ?? "",
scopes: this.stateParameters.scopes ?? [],
challenge: challenge,
};
const result = await this.stateParameters.mfaClient.submitChallenge(submitParams);
this.stateParameters.logger.verbose("0ddwwn", this.stateParameters.correlationId);
const accountInfo = new CustomAuthAccountData(result.authenticationResult.account, this.stateParameters.config, this.stateParameters.cacheClient, this.stateParameters.logger, this.stateParameters.correlationId);
return new MfaSubmitChallengeResult(new MfaCompletedState(), accountInfo);
}
catch (error) {
this.stateParameters.logger.errorPii("01ok2b", this.stateParameters.correlationId);
return MfaSubmitChallengeResult.createWithError(error);
}
}
}
export { MfaAwaitingState, MfaVerificationRequiredState };
//# sourceMappingURL=MfaState.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"MfaState.mjs","sources":["../../../../../../src/custom_auth/core/auth_flow/mfa/state/MfaState.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAAA;;;AAGG;AAuBH,MAAe,QAEb,SAAQ,+BAA4C,CAAA;AAClD;;;;;AAKG;IACH,MAAM,gBAAgB,CAClB,YAAoB,EAAA;QAEpB,IAAI;AACA,YAAA,8BAA8B,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE7D,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAC/B,QAAA,EAAA,IAAA,CAAA,eAAA,CAAA,aAAA,CAAA,CAAA;AAIJ,YAAA,MAAM,aAAa,GAA8B;AAC7C,gBAAA,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC,aAAa;AACjD,gBAAA,iBAAiB,EAAE,IAAI,CAAC,eAAe,CAAC,iBAAiB,IAAI,EAAE;gBAC/D,aAAa,EACT,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,IAAI,EAAE;AAC/D,gBAAA,YAAY,EAAE,YAAY;aAC7B,CAAC;AAEF,YAAA,MAAM,MAAM,GACR,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,gBAAgB,CACjD,aAAa,CAChB,CA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OAAO,EACnC,IAAI,CAAC,eAAe,CAAC,MAAM,EAC3B,IAAI,CAAC,eAAe,CAAC,WAAW,EAChC,IAAI,CAAC,eAAe,CAAC,MAAM,EAC3B,IAAI,CAAC,eAAe,CAAC,aAAa,CACrC,CAAC;YAEF,OAAO,IAAI,wBAAwB,CAC/B,IAAI,iBAAiB,EAAE,EACvB,WAAW,CACd,CAAC;AACL,SAAA;AAAC,QAAA,OAAO,KAAK,EAAE;AACZ,YAAA,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAChC,QAAA,EAAA,IAAA,CAAA,eAAA,CAAA,aAAgD,CAAA,CAAA;AAIpD,YAAA,OAAO,wBAAwB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC1D,SAAA;KACJ;AACJ;;;;"}

View File

@ -0,0 +1,35 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { CustomAuthError } from './CustomAuthError.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Error when no required authentication method by Microsoft Entra is supported
*/
class RedirectError extends CustomAuthError {
constructor(correlationId, redirectReason) {
super("redirect", redirectReason ||
"Redirect Error, a fallback to the browser-delegated authentication is needed. Use loginPopup instead.", correlationId);
this.redirectReason = redirectReason;
Object.setPrototypeOf(this, RedirectError.prototype);
}
}
/**
* Custom Auth API error.
*/
class CustomAuthApiError extends CustomAuthError {
constructor(error, errorDescription, correlationId, errorCodes, subError, attributes, continuationToken, traceId, timestamp) {
super(error, errorDescription, correlationId, errorCodes, subError);
this.attributes = attributes;
this.continuationToken = continuationToken;
this.traceId = traceId;
this.timestamp = timestamp;
Object.setPrototypeOf(this, CustomAuthApiError.prototype);
}
}
export { CustomAuthApiError, RedirectError };
//# sourceMappingURL=CustomAuthApiError.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"CustomAuthApiError.mjs","sources":["../../../../src/custom_auth/core/error/CustomAuthApiError.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAKH;;AAEG;AACG,MAAO,aAAc,SAAQ,eAAe,CAAA;IAC9C,WAAY,CAAA,aAAsB,EAAS,cAAuB,EAAA;QAC9D,KAAK,CACD,UAAU,EACV,cAAc;YACV,uGAAuG,EAC3G,aAAa,CAChB,CAAC;QANqC,IAAc,CAAA,cAAA,GAAd,cAAc,CAAS;QAO9D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KACxD;AACJ,CAAA;AAED;;AAEG;AACG,MAAO,kBAAmB,SAAQ,eAAe,CAAA;AACnD,IAAA,WAAA,CACI,KAAa,EACb,gBAAwB,EACxB,aAAsB,EACtB,UAA0B,EAC1B,QAAiB,EACV,UAAiC,EACjC,iBAA0B,EAC1B,OAAgB,EAChB,SAAkB,EAAA;QAEzB,KAAK,CAAC,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAL7D,IAAU,CAAA,UAAA,GAAV,UAAU,CAAuB;QACjC,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAS;QAC1B,IAAO,CAAA,OAAA,GAAP,OAAO,CAAS;QAChB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAS;QAGzB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;KAC7D;AACJ;;;;"}

View File

@ -0,0 +1,22 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class CustomAuthError extends Error {
constructor(error, errorDescription, correlationId, errorCodes, subError) {
super(`${error}: ${errorDescription ?? ""}`);
this.error = error;
this.errorDescription = errorDescription;
this.correlationId = correlationId;
this.errorCodes = errorCodes;
this.subError = subError;
Object.setPrototypeOf(this, CustomAuthError.prototype);
this.errorCodes = errorCodes ?? [];
this.subError = subError ?? "";
}
}
export { CustomAuthError };
//# sourceMappingURL=CustomAuthError.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"CustomAuthError.mjs","sources":["../../../../src/custom_auth/core/error/CustomAuthError.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEG,MAAO,eAAgB,SAAQ,KAAK,CAAA;IACtC,WACW,CAAA,KAAa,EACb,gBAAyB,EACzB,aAAsB,EACtB,UAA0B,EAC1B,QAAiB,EAAA;QAExB,KAAK,CAAC,GAAG,KAAK,CAAA,EAAA,EAAK,gBAAgB,IAAI,EAAE,CAAE,CAAA,CAAC,CAAC;QANtC,IAAK,CAAA,KAAA,GAAL,KAAK,CAAQ;QACb,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAS;QACzB,IAAa,CAAA,aAAA,GAAb,aAAa,CAAS;QACtB,IAAU,CAAA,UAAA,GAAV,UAAU,CAAgB;QAC1B,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAS;QAGxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;AAEvD,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,IAAI,EAAE,CAAC;AACnC,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,EAAE,CAAC;KAClC;AACJ;;;;"}

View File

@ -0,0 +1,17 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
import { CustomAuthError } from './CustomAuthError.mjs';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
class HttpError extends CustomAuthError {
constructor(error, message, correlationId) {
super(error, message, correlationId);
Object.setPrototypeOf(this, HttpError.prototype);
}
}
export { HttpError };
//# sourceMappingURL=HttpError.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"HttpError.mjs","sources":["../../../../src/custom_auth/core/error/HttpError.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIG,MAAO,SAAU,SAAQ,eAAe,CAAA;AAC1C,IAAA,WAAA,CAAY,KAAa,EAAE,OAAe,EAAE,aAAsB,EAAA;AAC9D,QAAA,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QACrC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACpD;AACJ;;;;"}

View File

@ -0,0 +1,11 @@
/*! @azure/msal-browser v5.11.0 2026-05-19 */
'use strict';
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
const NoNetworkConnectivity = "no_network_connectivity";
const FailedSendRequest = "failed_send_request";
export { FailedSendRequest, NoNetworkConnectivity };
//# sourceMappingURL=HttpErrorCodes.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"file":"HttpErrorCodes.mjs","sources":["../../../../src/custom_auth/core/error/HttpErrorCodes.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEI,MAAM,qBAAqB,GAAG,0BAA0B;AACxD,MAAM,iBAAiB,GAAG;;;;"}

Some files were not shown because too many files have changed in this diff Show More