@azure/msal-node 1.0.0-alpha.8 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,275 @@
1
1
  {
2
2
  "name": "@azure/msal-node",
3
3
  "entries": [
4
+ {
5
+ "date": "Mon, 07 Dec 2020 22:19:03 GMT",
6
+ "tag": "@azure/msal-node_v1.0.0-beta.2",
7
+ "version": "1.0.0-beta.2",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "comment": "Expose idTokenClaims on AccountInfo (#2554)",
12
+ "author": "janutter@microsoft.com",
13
+ "commit": "cb2165aad7995d904ec49ade565d907dc314ce16",
14
+ "package": "@azure/msal-node"
15
+ },
16
+ {
17
+ "comment": "Add null to API response signatures (#2602)",
18
+ "author": "thomas.norling@microsoft.com",
19
+ "commit": "ebf18c6daead16f8cfd2afb3b63cbd59fc63046a",
20
+ "package": "@azure/msal-node"
21
+ },
22
+ {
23
+ "comment": "Enforce triple equals in eslint",
24
+ "author": "janutter@microsoft.com",
25
+ "commit": "5975eb4077a2b4372683e68af4d748b0808134ab",
26
+ "package": "@azure/msal-node"
27
+ },
28
+ {
29
+ "comment": "Log messages contain package name and version (#2589)",
30
+ "author": "thomas.norling@microsoft.com",
31
+ "commit": "4568c16bd425e242cdb799ec59b3508654cc2e45",
32
+ "package": "@azure/msal-node"
33
+ },
34
+ {
35
+ "comment": "Update request types (#2512)",
36
+ "author": "thomas.norling@microsoft.com",
37
+ "commit": "5b891222d674eb5664af9187f319a61b50341f55",
38
+ "package": "@azure/msal-node"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Wed, 11 Nov 2020 23:33:20 GMT",
45
+ "tag": "@azure/msal-node_v1.0.0-beta.1",
46
+ "version": "1.0.0-beta.1",
47
+ "comments": {
48
+ "none": [
49
+ {
50
+ "comment": "Documentation update for new account retrieval APIs (#2585)",
51
+ "author": "hemoral@microsoft.com",
52
+ "commit": "cb782967cc8f07581488de71c4509fa12a702774",
53
+ "package": "@azure/msal-node"
54
+ }
55
+ ],
56
+ "prerelease": [
57
+ {
58
+ "comment": "Add support for SubjectName/Issuer authentication (#2471).",
59
+ "author": "jamckenn@microsoft.com",
60
+ "commit": "4e889b3f8e28b8fd46c0e63d0f142fb61b442510",
61
+ "package": "@azure/msal-node"
62
+ }
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "date": "Tue, 10 Nov 2020 01:48:44 GMT",
68
+ "tag": "@azure/msal-node_v1.0.0-alpha.16",
69
+ "version": "1.0.0-alpha.16",
70
+ "comments": {
71
+ "prerelease": [
72
+ {
73
+ "comment": "Enhance lookup for IdTokens/AppMetadata (#2530)",
74
+ "author": "sameera.gajjarapu@microsoft.com",
75
+ "commit": "e51446295f8c857f1abc7f6874a4c7fde157699e",
76
+ "package": "@azure/msal-node"
77
+ }
78
+ ]
79
+ }
80
+ },
81
+ {
82
+ "date": "Sat, 07 Nov 2020 01:50:14 GMT",
83
+ "tag": "@azure/msal-node_v1.0.0-alpha.15",
84
+ "version": "1.0.0-alpha.15",
85
+ "comments": {
86
+ "prerelease": [
87
+ {
88
+ "comment": "Fixing a bug and adding `localAccountId` in AccountInfo interface (#2516)",
89
+ "author": "sameera.gajjarapu@microsoft.com",
90
+ "commit": "98f43038608fe66a256dabfff0810476e9e6b3ab",
91
+ "package": "@azure/msal-node"
92
+ },
93
+ {
94
+ "comment": "Filtered lookup of IdTokens, AppMetadata; Error handling in Node Storage (#2530)",
95
+ "author": "sameera.gajjarapu@microsoft.com",
96
+ "commit": "354dd86449d792b7369fb240c5e2cfd70ca73488",
97
+ "package": "@azure/msal-node"
98
+ },
99
+ {
100
+ "comment": "Implement Password Grant Flow (#2204)",
101
+ "author": "sameera.gajjarapu@microsoft.com",
102
+ "commit": "baf6d157e7bbeae439526aee13eb08962974925b",
103
+ "package": "@azure/msal-node"
104
+ }
105
+ ],
106
+ "none": [
107
+ {
108
+ "comment": "Build Pipeline Changes (#2406)",
109
+ "author": "thomas.norling@microsoft.com",
110
+ "commit": "af8459c0d53a4dc2bf495017608c0bb03004d006",
111
+ "package": "@azure/msal-node"
112
+ }
113
+ ]
114
+ }
115
+ },
116
+ {
117
+ "date": "Mon, 02 Nov 2020 23:33:39 GMT",
118
+ "tag": "@azure/msal-node_v1.0.0-alpha.14",
119
+ "version": "1.0.0-alpha.14",
120
+ "comments": {
121
+ "prerelease": [
122
+ {
123
+ "comment": "Add getLogger and setLogger to msal-node (#2520)",
124
+ "author": "joarroyo@microsoft.com",
125
+ "commit": "6fff8c1ed4d3dab2a74ff4b44a159645a6c2f535",
126
+ "package": "@azure/msal-node"
127
+ },
128
+ {
129
+ "comment": "Remove `debug` from the `msal-node` library (#2496)",
130
+ "author": "sameera.gajjarapu@microsoft.com",
131
+ "commit": "e354c26ae74632943109fb9101319acf6c6a691c",
132
+ "package": "@azure/msal-node"
133
+ }
134
+ ]
135
+ }
136
+ },
137
+ {
138
+ "date": "Mon, 26 Oct 2020 21:00:29 GMT",
139
+ "tag": "@azure/msal-node_v1.0.0-alpha.13",
140
+ "version": "1.0.0-alpha.13",
141
+ "comments": {
142
+ "prerelease": [
143
+ {
144
+ "comment": "msal-browser and msal-node cache Interfaces to msal-common updated (#2415)",
145
+ "author": "sameera.gajjarapu@microsoft.com",
146
+ "commit": "9d4c4a18de10eb3d918810dc10766fbd5547165d",
147
+ "package": "@azure/msal-node"
148
+ },
149
+ {
150
+ "comment": "Export Node Cache Serializer for use in end-to-end testing framework (#2414)",
151
+ "author": "hemoral@microsoft.com",
152
+ "commit": "ba3fad77b2f6ea5034c423aa44096c5698cbcb3d",
153
+ "package": "@azure/msal-node"
154
+ }
155
+ ],
156
+ "none": [
157
+ {
158
+ "comment": "Update samples path",
159
+ "author": "sameera.gajjarapu@microsoft.com",
160
+ "commit": "971ff811cb00a3d97b8ceff32999cd80d3d5a7ac",
161
+ "package": "@azure/msal-node"
162
+ }
163
+ ]
164
+ }
165
+ },
166
+ {
167
+ "date": "Tue, 20 Oct 2020 23:47:28 GMT",
168
+ "tag": "@azure/msal-node_v1.0.0-alpha.12",
169
+ "version": "1.0.0-alpha.12",
170
+ "comments": {
171
+ "prerelease": [
172
+ {
173
+ "comment": "Adds support for any OIDC-compliant authority (#2389).",
174
+ "author": "jamckenn@microsoft.com",
175
+ "commit": "2b6b9ec9033a8b829393e44c3feb7b19b163d2cd",
176
+ "package": "@azure/msal-node"
177
+ }
178
+ ],
179
+ "none": [
180
+ {
181
+ "comment": "Updated eslint rules (#2345)",
182
+ "author": "janutter@microsoft.com",
183
+ "commit": "64a4f9e868e63346dfd711dec717abe7fd14d949",
184
+ "package": "@azure/msal-node"
185
+ }
186
+ ]
187
+ }
188
+ },
189
+ {
190
+ "date": "Thu, 15 Oct 2020 00:49:18 GMT",
191
+ "tag": "@azure/msal-node_v1.0.0-alpha.11",
192
+ "version": "1.0.0-alpha.11",
193
+ "comments": {
194
+ "prerelease": [
195
+ {
196
+ "comment": "Export all \"Request\" types in msal-node",
197
+ "author": "sameera.gajjarapu@microsoft.com",
198
+ "commit": "145602c7ced2c9f77a249f0abdca76f3358bd7db",
199
+ "package": "@azure/msal-node"
200
+ }
201
+ ]
202
+ }
203
+ },
204
+ {
205
+ "date": "Wed, 14 Oct 2020 23:45:07 GMT",
206
+ "tag": "@azure/msal-node_v1.0.0-alpha.10",
207
+ "version": "1.0.0-alpha.10",
208
+ "comments": {
209
+ "prerelease": [
210
+ {
211
+ "comment": "Docs update for msal-node release",
212
+ "author": "sameera.gajjarapu@microsoft.com",
213
+ "commit": "20718209d5d567c02223a7f1b220b4aa40ad6817",
214
+ "package": "@azure/msal-node"
215
+ },
216
+ {
217
+ "comment": "Export error types for msal-node",
218
+ "author": "sameera.gajjarapu@microsoft.com",
219
+ "commit": "7a493ee25d80a31cbfa21f04aa952a9ac3528dfb",
220
+ "package": "@azure/msal-node"
221
+ },
222
+ {
223
+ "comment": "Add uuid as dependency in msal-node package.json so it is installed with the library",
224
+ "author": "hectormgdev@gmail.com",
225
+ "commit": "cedeefacc09b755fc2edf59440ef7c60c4b872f8",
226
+ "package": "@azure/msal-node"
227
+ },
228
+ {
229
+ "comment": "Update TokenCache interface (#2348)",
230
+ "author": "sameera.gajjarapu@microsoft.com",
231
+ "commit": "26723689e35918c59bd6ce58ba8cb886118676c6",
232
+ "package": "@azure/msal-node"
233
+ }
234
+ ]
235
+ }
236
+ },
237
+ {
238
+ "date": "Fri, 02 Oct 2020 17:42:35 GMT",
239
+ "tag": "@azure/msal-node_v1.0.0-alpha.9",
240
+ "version": "1.0.0-alpha.9",
241
+ "comments": {
242
+ "prerelease": [
243
+ {
244
+ "comment": "Dummy implementation of access token proof-of-possession",
245
+ "author": "prkanher@microsoft.com",
246
+ "commit": "3cffbc99730532bbd0b35f2e3a9df17f032c0675",
247
+ "package": "@azure/msal-node"
248
+ }
249
+ ]
250
+ }
251
+ },
252
+ {
253
+ "date": "Wed, 30 Sep 2020 17:58:33 GMT",
254
+ "tag": "@azure/msal-node_v1.0.0-alpha.8",
255
+ "version": "1.0.0-alpha.8",
256
+ "comments": {
257
+ "none": [
258
+ {
259
+ "comment": "Updating the pre-release version(#2342)",
260
+ "author": "sameera.gajjarapu@microsoft.com",
261
+ "commit": "bc3f324edd6cf83937c31f73d3aefc6dbaf5f748",
262
+ "package": "@azure/msal-node"
263
+ },
264
+ {
265
+ "comment": "Update changelog versions for msal-node and extensions (#2336)",
266
+ "author": "hemoral@microsoft.com",
267
+ "commit": "323875a725e0d5049ff6742a9ca5160c2d4b7d0d",
268
+ "package": "@azure/msal-node"
269
+ }
270
+ ]
271
+ }
272
+ },
4
273
  {
5
274
  "date": "Wed, 23 Sep 2020 21:13:48 GMT",
6
275
  "tag": "@azure/msal-node_v1.0.0-alpha.7",
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Microsoft
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Microsoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,153 +1,153 @@
1
- # Microsoft Authentication Library for Node (msal-node)
2
-
3
- [![npm version](https://img.shields.io/npm/v/@azure/msal-node.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-node/)[![npm version](https://img.shields.io/npm/dm/@azure/msal-node.svg)](https://nodei.co/npm/@azure/msal-node/)[![Coverage Status](https://coveralls.io/repos/github/AzureAD/microsoft-authentication-library-for-js/badge.svg?branch=dev)](https://coveralls.io/github/AzureAD/microsoft-authentication-library-for-js?branch=dev)
4
-
5
- | <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/msal-node/" target="_blank">Library Reference</a> |
6
- | --- | --- | --- |
7
-
8
- Currently `msal-node` is under development, please track the project progress [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/projects/4). This documentation is also in progress and will be changing as we release our `alpha` patches. **We do not recommend using this in a production environment yet**.
9
-
10
- 1. [About](#about)
11
- 2. [FAQ](#faq)
12
- 3. [Releases](#releases)
13
- 4. [Prerequisites](#prerequisites)
14
- 5. [Installation](#installation)
15
- 6. [Usage](#usage)
16
- 7. [Samples](#samples)
17
- 8. [Build Library](#build-and-test)
18
- 9. [Security Reporting](#security-reporting)
19
- 10. [License](#license)
20
- 11. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
21
-
22
- ## About
23
-
24
- MSAL Node enables applications to authenticate users using [Azure AD](https://docs.microsoft.com/en-us/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/en-us/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).
25
-
26
-
27
- ### OAuth2.0 grant types supported:
28
-
29
- The current alpha version supports the following ways of acquiring tokens:
30
-
31
- #### Public Client:
32
- - [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with [PKCE](https://oauth.net/2/pkce/)
33
- - [Device Code Grant](https://oauth.net/2/grant-types/device-code/)
34
- - [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)
35
- - [Silent Flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
36
-
37
- #### Confidential Client:
38
- - [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with a client credential
39
- - [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)
40
- - [Silent Flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
41
- - [Client Credential Grant](https://oauth.net/2/grant-types/client-credentials/)
42
- - [On-behalf-of flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow)
43
-
44
- **[Coming Soon]** In the future we plan to add support for:
45
- - [Integrated Windows Authentication flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#integrated-windows-authentication)
46
- - [Username and Password flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword)
47
-
48
- More details on different grant types supported by Microsoft authentication libraries in general can be found [here](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows).
49
-
50
- ### Scenarios supported:
51
-
52
- The scenarios supported with this library are:
53
- - Desktop app that calls web APIs
54
- - Web app that calls web APIs
55
- - Web APIs that call web APIs
56
- - Daemon apps
57
-
58
- More details on scenarios and the authentication flows that map to each of them can be found [here](https://docs.microsoft.com/en-us/azure/active-directory/develop/authentication-flows-app-scenarios).
59
-
60
- ## FAQ
61
-
62
- See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/faq.md).
63
-
64
- ## Prerequisites
65
-
66
- Before using `@azure/msal-node` you will need to register your app in the azure portal:
67
-
68
- - [App registration](https://docs.microsoft.com/en-us/graph/auth-register-app-v2)
69
-
70
- ## Installation
71
-
72
- ### Via NPM:
73
- ```javascript
74
- npm install @azure/msal-node
75
- ```
76
- ## Usage
77
-
78
- ### MSAL basics
79
- - [Understand difference in between Public Client and Confidential Clients](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-client-applications)
80
- - [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)
81
- - [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)
82
- - [Configuration](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md)
83
- - [Request](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/request.md)
84
- - [Response](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/response.md)
85
-
86
- ## Samples
87
- There are multiple [samples](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/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.
88
-
89
- - [auth-code](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-node-samples/auth-code): Express app using OAuth2.0 authorization code flow.
90
- - [device-code](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-node-samples/device-code): Command line app using OAuth 2.0 device code flow.
91
- - [refresh-token](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-node-samples/refresh-token): Command line app using OAuth 2.0 refresh flow.
92
- - [silent-flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/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.
93
- - [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.
94
- - [on-behalf-of](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/on-behalf-of): Web application uses 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.
95
- - [msal-node-extensions](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-extensions): Uses authorization code flow to acquire tokens then the [msal-extensions](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/extensions/msal-node-extensions) library to write the MSAL in-memory token cache to disk.
96
-
97
- ## Build and Test
98
-
99
- - If you don't have [lerna](https://github.com/lerna/lerna) installed, run `npm install -g lerna`
100
- - Run `lerna bootstrap` from anywhere within `microsoft-authentication-library-for-js.git`.
101
- - Navigate to `microsoft-authentication-library-for-js/lib/msal-common` and run `npm run build`
102
- - Navigate to `microsoft-authentication-library-for-js/lib/msal-node` and run `npm run build`
103
-
104
- ```javascript
105
- // to link msal-node and msal-common packages
106
- lerna bootstrap
107
-
108
- // Change to the msal-node package directory
109
- cd lib/msal-common/
110
-
111
- // To run build only for node package
112
- npm run build
113
-
114
- // Change to the msal-node package directory
115
- cd lib/msal-node/
116
-
117
- // To run build only for node package
118
- npm run build
119
- ```
120
-
121
- ### Local Development
122
- Below is a list of commands you will probably find useful:
123
-
124
- #### `npm run build:modules:watch`
125
- Runs 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.
126
-
127
- #### `npm run build`
128
- Bundles the package to the `dist` folder.
129
- The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).
130
-
131
- #### `lerna bootstrap`
132
- If you are running the project in development/watch mode, or have made changes in `msal-common` and need them reflecting across the project, please run `lerna bootstrap` to link all the symbols. Please note that `npm install` will unlink all the code, hence it is advised to run `lerna bootstrap` post installation.
133
-
134
- #### `npm run lint`
135
- Runs eslint with Prettier
136
-
137
- #### `npm test`, `npm run test:coverage`, `npm run test:watch`
138
- Runs the test watcher (Jest) in an interactive mode.
139
- By default, runs tests related to files changed since the last commit.
140
- Generate code coverage by adding the flag --coverage. No additional setup needed. Jest can collect code coverage information from entire projects, including untested files.
141
-
142
- ## Security Reporting
143
-
144
- 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.
145
-
146
- ## License
147
-
148
- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
149
-
150
- ## We Value and Adhere to the Microsoft Open Source Code of Conduct
151
-
152
- 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.
153
-
1
+ # Microsoft Authentication Library for Node (msal-node)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@azure/msal-node.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-node/)[![npm version](https://img.shields.io/npm/dm/@azure/msal-node.svg)](https://nodei.co/npm/@azure/msal-node/)[![Coverage Status](https://coveralls.io/repos/github/AzureAD/microsoft-authentication-library-for-js/badge.svg?branch=dev)](https://coveralls.io/github/AzureAD/microsoft-authentication-library-for-js?branch=dev)
4
+
5
+ | <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/msal-node/" target="_blank">Library Reference</a> |
6
+ | --- | --- | --- |
7
+
8
+ Currently `msal-node` is under development, please track the project progress [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/projects/4). This documentation is also in progress and will be changing as we release our `alpha` patches. **We do not recommend using this in a production environment yet**.
9
+
10
+ 1. [About](#about)
11
+ 2. [FAQ](#faq)
12
+ 3. [Releases](#releases)
13
+ 4. [Prerequisites](#prerequisites)
14
+ 5. [Installation](#installation)
15
+ 6. [Usage](#usage)
16
+ 7. [Samples](#samples)
17
+ 8. [Build Library](#build-and-test)
18
+ 9. [Security Reporting](#security-reporting)
19
+ 10. [License](#license)
20
+ 11. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
21
+
22
+ ## About
23
+
24
+ MSAL Node enables applications to authenticate users using [Azure AD](https://docs.microsoft.com/en-us/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/en-us/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).
25
+
26
+
27
+ ### OAuth2.0 grant types supported:
28
+
29
+ The current alpha version supports the following ways of acquiring tokens:
30
+
31
+ #### Public Client:
32
+ - [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with [PKCE](https://oauth.net/2/pkce/)
33
+ - [Device Code Grant](https://oauth.net/2/grant-types/device-code/)
34
+ - [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)
35
+ - [Silent Flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
36
+
37
+ #### Confidential Client:
38
+ - [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with a client credential
39
+ - [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)
40
+ - [Silent Flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
41
+ - [Client Credential Grant](https://oauth.net/2/grant-types/client-credentials/)
42
+ - [On-behalf-of flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow)
43
+
44
+ **[Coming Soon]** In the future we plan to add support for:
45
+ - [Integrated Windows Authentication flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#integrated-windows-authentication)
46
+ - [Username and Password flow](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows#usernamepassword)
47
+
48
+ More details on different grant types supported by Microsoft authentication libraries in general can be found [here](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows).
49
+
50
+ ### Scenarios supported:
51
+
52
+ The scenarios supported with this library are:
53
+ - Desktop app that calls web APIs
54
+ - Web app that calls web APIs
55
+ - Web APIs that call web APIs
56
+ - Daemon apps
57
+
58
+ More details on scenarios and the authentication flows that map to each of them can be found [here](https://docs.microsoft.com/en-us/azure/active-directory/develop/authentication-flows-app-scenarios).
59
+
60
+ ## FAQ
61
+
62
+ See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/faq.md).
63
+
64
+ ## Prerequisites
65
+
66
+ Before using `@azure/msal-node` you will need to register your app in the azure portal:
67
+
68
+ - [App registration](https://docs.microsoft.com/en-us/graph/auth-register-app-v2)
69
+
70
+ ## Installation
71
+
72
+ ### Via NPM:
73
+ ```javascript
74
+ npm install @azure/msal-node
75
+ ```
76
+ ## Usage
77
+
78
+ ### MSAL basics
79
+ - [Understand difference in between Public Client and Confidential Clients](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-client-applications)
80
+ - [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)
81
+ - [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)
82
+ - [Configuration](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md)
83
+ - [Request](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/request.md)
84
+ - [Response](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/response.md)
85
+
86
+ ## Samples
87
+ There 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.
88
+
89
+ - [auth-code](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/standalone-samples/auth-code): Express app using OAuth2.0 authorization code flow.
90
+ - [device-code](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/standalone-samples/device-code): Command line app using OAuth 2.0 device code flow.
91
+ - [refresh-token](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/standalone-samples/refresh-token): Command line app using OAuth 2.0 refresh flow.
92
+ - [silent-flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/standalone-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.
93
+ - [client-credentials](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/standalone-samples/client-credentials): Daemon app using Oauth 2.0 client credential grant to acquire a token.
94
+ - [on-behalf-of](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/standalone-samples/on-behalf-of): Web application uses 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.
95
+ - [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.
96
+
97
+ ## Build and Test
98
+
99
+ - If you don't have [lerna](https://github.com/lerna/lerna) installed, run `npm install -g lerna`
100
+ - Run `lerna bootstrap` from anywhere within `microsoft-authentication-library-for-js.git`.
101
+ - Navigate to `microsoft-authentication-library-for-js/lib/msal-common` and run `npm run build`
102
+ - Navigate to `microsoft-authentication-library-for-js/lib/msal-node` and run `npm run build`
103
+
104
+ ```javascript
105
+ // to link msal-node and msal-common packages
106
+ lerna bootstrap
107
+
108
+ // Change to the msal-node package directory
109
+ cd lib/msal-common/
110
+
111
+ // To run build only for node package
112
+ npm run build
113
+
114
+ // Change to the msal-node package directory
115
+ cd lib/msal-node/
116
+
117
+ // To run build only for node package
118
+ npm run build
119
+ ```
120
+
121
+ ### Local Development
122
+ Below is a list of commands you will probably find useful:
123
+
124
+ #### `npm run build:modules:watch`
125
+ Runs 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.
126
+
127
+ #### `npm run build`
128
+ Bundles the package to the `dist` folder.
129
+ The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).
130
+
131
+ #### `lerna bootstrap`
132
+ If you are running the project in development/watch mode, or have made changes in `msal-common` and need them reflecting across the project, please run `lerna bootstrap` to link all the symbols. Please note that `npm install` will unlink all the code, hence it is advised to run `lerna bootstrap` post installation.
133
+
134
+ #### `npm run lint`
135
+ Runs eslint with Prettier
136
+
137
+ #### `npm test`, `npm run test:coverage`, `npm run test:watch`
138
+ Runs the test watcher (Jest) in an interactive mode.
139
+ By default, runs tests related to files changed since the last commit.
140
+ Generate code coverage by adding the flag --coverage. No additional setup needed. Jest can collect code coverage information from entire projects, including untested files.
141
+
142
+ ## Security Reporting
143
+
144
+ 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.
145
+
146
+ ## License
147
+
148
+ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
149
+
150
+ ## We Value and Adhere to the Microsoft Open Source Code of Conduct
151
+
152
+ 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.
153
+