{"name":"@azure/msal-node","version":"3.8.4","keywords":["js","ts","node","AAD","msal","oauth"],"author":{"url":"https://www.microsoft.com","name":"Microsoft","email":"nugetaad@microsoft.com"},"license":"MIT","_id":"@azure/msal-node@3.8.4","maintainers":[{"name":"azuread","email":"nugetaad@microsoft.com"},{"name":"neagrawa","email":"nehaagrawal30@gmail.com"},{"name":"manrath","email":"manrath@microsoft.com"}],"homepage":"https://github.com/AzureAD/microsoft-authentication-library-for-js#readme","bugs":{"url":"https://github.com/AzureAD/microsoft-authentication-library-for-js/issues"},"dist":{"shasum":"f7c082b2e2122148cc3624fae583f2643b81788e","tarball":"http://registry-npm.ywwl.com/@azure/msal-node/download/@azure/msal-node-3.8.4.tgz","fileCount":447,"integrity":"sha512-lvuAwsDpPDE/jSuVQOBMpLbXuVuLsPNRwWCyK3/6bPlBk0fGWegqoZ0qjZclMWyQ2JNvIY3vHY7hoFmFmFQcOw==","signatures":[{"sig":"MEUCIQCoN9J+6mMbB8Ha90pS5ALJIbJ0v7Cg1fFX+GUMnQlBFgIgErjF+w7M8RmHmiNir+gHgzN+N45Qbql8j3uK21er7mM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2559584,"size":446693,"noattachment":false,"key":"/@azure/msal-node/-/@azure/msal-node-3.8.4.tgz"},"main":"lib/msal-node.cjs","type":"module","_from":"file:C:\\a\\_work\\1\\azure-msal-node-3.8.4.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","$schema":"https://json.schemastore.org/package.json","engines":{"node":">=16"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"types":"./lib/types/index.d.ts","default":"./lib/msal-node.cjs"}},"./package.json":"./package.json"},"scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"npm run clean && rollup -c --strictDeprecations --bundleConfigAsCjs","clean":"shx rm -rf dist lib","prepack":"npm run build:all","lint:fix":"npm run lint -- --fix","build:all":"cd ../.. && npm run build --workspace=@azure/msal-common --workspace=@azure/msal-node","format:fix":"prettier --ignore-path .gitignore --write src test","test:watch":"jest --watch","build:watch":"rollup -c --watch --strictDeprecations --bundleConfigAsCjs","apiExtractor":"api-extractor run","format:check":"prettier --ignore-path .gitignore --check src test","test:coverage":"jest --coverage"},"_npmUser":{"name":"azuread","email":"nugetaad@microsoft.com"},"_resolved":"C:\\a\\_work\\1\\azure-msal-node-3.8.4.tgz","beachball":{"disallowedChangeTypes":["major"]},"_integrity":"sha512-lvuAwsDpPDE/jSuVQOBMpLbXuVuLsPNRwWCyK3/6bPlBk0fGWegqoZ0qjZclMWyQ2JNvIY3vHY7hoFmFmFQcOw==","repository":{"url":"git+https://github.com/AzureAD/microsoft-authentication-library-for-js.git","type":"git"},"_npmVersion":"10.8.2","description":"Microsoft Authentication Library for Node","directories":{},"_nodeVersion":"20.19.4","dependencies":{"uuid":"^8.3.0","jsonwebtoken":"^9.0.0","@azure/msal-common":"15.13.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","tslib":"^1.10.0","yargs":"^17.3.1","rollup":"^4.22.4","ts-jest":"^29.1.0","prettier":"2.8.7","jest-junit":"^16.0.0","typescript":"^4.9.5","@types/jest":"^29.5.0","@types/node":"^20.3.1","@types/uuid":"^7.0.0","rollup-msal":"file:../../shared-configs/rollup-msal","eslint-config-msal":"file:../../shared-configs/eslint-config-msal","@types/jsonwebtoken":"^9.0.1","@microsoft/api-extractor":"^7.43.4","@rollup/plugin-typescript":"^11.0.0","@rollup/plugin-node-resolve":"^15.0.1"},"_npmOperationalInternal":{"tmp":"tmp/msal-node_3.8.4_1764829529017_0.0541263966486667","host":"s3://npm-registry-packages-npm-production"},"readme":"# Microsoft Authentication Library for Node (msal-node)\n\n[![npm version](https://img.shields.io/npm/v/@azure/msal-node.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-node/)\n[![npm version](https://img.shields.io/npm/dm/@azure/msal-node.svg)](https://nodei.co/npm/@azure/msal-node/)\n[![codecov](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js/branch/dev/graph/badge.svg?flag=msal-node)](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)\n\n| <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_node.html\" target=\"_blank\">Library Reference</a> |\n| --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |\n\n1. [About](#about)\n1. [FAQ](#faq)\n1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/CHANGELOG.md)\n1. [Prerequisites](#prerequisites)\n1. [Installation](#installation)\n1. [Node Version Support](#node-version-support)\n1. [Usage](#usage)\n1. [Samples](#samples)\n1. [Build Library](#build-and-test)\n1. [Security Reporting](#security-reporting)\n1. [License](#license)\n1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)\n\n## About\n\nMSAL Node enables applications to authenticate users using [Azure AD](https://docs.microsoft.com/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).\n\n### OAuth2.0 grant types supported:\n\nThe current version supports the following ways of acquiring tokens:\n\n#### Public Client:\n\n-   [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with [PKCE](https://oauth.net/2/pkce/)\n-   [Device Code Grant](https://oauth.net/2/grant-types/device-code/)\n-   [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)\n-   [Silent Flow](https://docs.microsoft.com/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)\n-   [Username and Password flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#usernamepassword)\n\n#### Confidential Client:\n\n-   [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with a client credential\n-   [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)\n-   [Silent Flow](https://docs.microsoft.com/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)\n-   [Client Credential Grant](https://oauth.net/2/grant-types/client-credentials/)\n-   [On-behalf-of flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow)\n-   [Username and Password flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#usernamepassword)\n\nNote that the username and password flow is deprecated and support will be removed in a future release.\n\nMore details on different grant types supported by Microsoft authentication libraries in general can be found [here](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows). \n\n### Scenarios supported:\n\nThe scenarios supported with this library are:\n\n-   Desktop app that calls web APIs\n-   Web app that calls web APIs\n-   Web APIs that call web APIs\n-   Daemon apps\n\nMore details on scenarios and the authentication flows that map to each of them can be found [here](https://docs.microsoft.com/azure/active-directory/develop/authentication-flows-app-scenarios).\n\n## FAQ\n\nSee [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/faq.md).\n\n## Prerequisites\n\nBefore using `@azure/msal-node` you will need to register your app in the azure portal:\n\n-   [App registration](https://docs.microsoft.com/graph/auth-register-app-v2)\n\n## Installation\n\n### Via NPM:\n\n```javascript\nnpm install @azure/msal-node\n```\n\n## Node Version Support\n\nMSAL Node will follow the [Long Term Support (LTS) schedule of the Node.js project](https://nodejs.org/about/releases/). Our support plan is as follows.\n\nAny major MSAL Node release:\n\n-   Will support stable (even-numbered) Maintenance LTS, Active LTS, and Current versions of Node\n-   Will drop support for any previously supported Node versions that have reached end of life\n-   Will not support prerelease/preview/pending versions until they are stable\n\n| MSAL Node version | MSAL support status | Supported Node versions |\n| ----------------- | ------------------- | ----------------------- |\n| 4.x.x             | Active development  | 20, 22, 24              |\n| 3.x.x             | Active development  | 16, 18, 20, 22, 24      |\n| 2.x.x             | In maintenance      | 16, 18, 20, 22          |\n| 1.x.x             | In maintenance      | 10, 12, 14, 16, 18      |\n\n**Note:** There have been no functional changes in the MSAL Node v2 release.\n\n## Usage\n\n### MSAL basics\n\n-   [Understand difference in between Public Client and Confidential Clients](https://docs.microsoft.com/azure/active-directory/develop/msal-client-applications)\n-   [Initialize a Public Client Application](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/initialize-public-client-application.md)\n-   [Initialize a Confidential Client Application](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/initialize-confidential-client-application.md)\n-   [Configuration](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md)\n-   [Request](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/request.md)\n-   [Response](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/Response.md)\n-   [MCP Flows](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-v5/lib/msal-node/docs/mcp.md)\n\n## Samples\n\nThere are multiple [samples](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples) included in the repository that use MSAL Node to acquire tokens. These samples are currently used for manual testing, and are not meant to be a reference of best practices, therefore use judgement and do not blindly copy this code to any production applications.\n\nAAD samples:\n\n-   [auth-code](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/auth-code): Express app using OAuth2.0 authorization code flow.\n-   [auth-code-pkce](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/auth-code-pkce): Express app using OAuth2.0 authorization code flow with PKCE.\n-   [device-code](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/device-code): Command line app using OAuth 2.0 device code flow.\n-   [refresh-token](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/refresh-token): Command line app using OAuth 2.0 refresh flow.\n-   [silent-flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/silent-flow): Express app using OAuth2.0 authorization code flow to acquire a token and store in the token cache, and silent flow to use tokens in the token cache.\n-   [client-credentials](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/client-credentials): Daemon app using OAuth 2.0 client credential grant to acquire a token.\n-   [on-behalf-of](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/on-behalf-of): Web application using OAuth 2.0 auth code flow to acquire a token for a web API. The web API validates the token, and calls Microsoft Graph on behalf of the user who authenticated in the web application.\n-   [username-password](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/username-password): Web application using OAuth 2.0 resource owner password credentials (ROPC) flow to acquire a token for a web API.\n-   [ElectronTestApp](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/ElectronTestApp): Electron desktop application using OAuth 2.0 auth code with PKCE flow to acquire a token for a web API such as Microsoft Graph.\n-   [mcp-flows](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-v5/samples/msal-node-samples/mcp-flows): Express app using OAuth 2.0 authorization code flow with MCP resource isolation. See [MCP Flows documentation](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-v5/lib/msal-node/docs/mcp.md).\n-   [Hybrid Spa Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/HybridSample): Sample demonstrating how to use `enableSpaAuthorizationCode` to perform SSO for applications that leverage server-side and client-side authentication using MSAL Browser and MSAL Node.\n\nB2C samples:\n\n-   [b2c-user-flows](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/b2c-user-flows): Express app using OAuth2.0 authorization code flow.\n\nOthers:\n\n-   [msal-node-extensions](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/extensions/samples/msal-node-extensions): Uses authorization code flow to acquire tokens and the [msal-extensions](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/extensions/) library to write the MSAL in-memory token cache to disk.\n\n## Build and Test\n\n```javascript\n// Install dependencies from root of repo\nnpm install\n\n// Change to the msal-node package directory\ncd lib/msal-node\n\n// To run build for common package & node package\nnpm run build:all\n\n// To run build only for node package\nnpm run build\n\n// To run tests\nnpm run test\n```\n\n### Local Development\n\nBelow is a list of commands you will probably find useful:\n\n#### `npm run build:modules:watch`\n\nRuns the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab. The library will be rebuilt if you make edits.\n\n#### `npm run build`\n\nBundles the package to the `dist` folder.\nThe package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).\n\n#### `npm run build:all`\n\nBuilds both `msal-common` and `msal-node`\n\n#### `npm run lint`\n\nRuns eslint with Prettier\n\n#### `npm test`, `npm run test:coverage`, `npm run test:watch`\n\nRuns the test watcher (Jest) in an interactive mode.\nBy default, runs tests related to files changed since the last commit.\nGenerate code coverage by adding the flag --coverage. No additional setup needed. Jest can collect code coverage information from entire projects, including untested files.\n\n## Security Reporting\n\nIf 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.\n\n## License\n\nCopyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.\n\n## We Value and Adhere to the Microsoft Open Source Code of Conduct\n\nThis 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.\n","publish_time":1764829529209,"_cnpm_publish_time":1764829529209,"dist-tags":{"alpha":"5.0.0-alpha.0","beta":"5.0.0-beta.0","latest":"7.2.0","lts":"3.8.10"}}