@azure/msal-node 1.3.1 → 1.5.0
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 +126 -0
- package/{changelog.md → CHANGELOG.md} +304 -267
- package/LICENSE +21 -21
- package/README.md +183 -182
- package/dist/cache/NodeStorage.d.ts +5 -1
- package/dist/cache/NodeStorage.d.ts.map +1 -1
- package/dist/crypto/CryptoProvider.d.ts +4 -0
- package/dist/crypto/CryptoProvider.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/msal-node.cjs.development.js +53 -5
- package/dist/msal-node.cjs.development.js.map +1 -1
- package/dist/msal-node.cjs.production.min.js +1 -1
- package/dist/msal-node.cjs.production.min.js.map +1 -1
- package/dist/msal-node.esm.js +48 -7
- package/dist/msal-node.esm.js.map +1 -1
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/ClientCredentialRequest.d.ts +1 -1
- package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/DeviceCodeRequest.d.ts +1 -1
- package/dist/request/DeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/RefreshTokenRequest.d.ts +1 -1
- package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/SilentFlowRequest.d.ts +1 -1
- package/dist/request/SilentFlowRequest.d.ts.map +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
- package/package.json +12 -6
package/README.md
CHANGED
|
@@ -1,182 +1,183 @@
|
|
|
1
|
-
# Microsoft Authentication Library for Node (msal-node)
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@azure/msal-node/)
|
|
4
|
-
[](https://nodei.co/npm/@azure/msal-node/)
|
|
5
|
-
[](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)
|
|
6
|
-
|
|
7
|
-
| <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> |
|
|
8
|
-
| --- | --- | --- |
|
|
9
|
-
|
|
10
|
-
1. [About](#about)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## About
|
|
24
|
-
|
|
25
|
-
MSAL 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).
|
|
26
|
-
|
|
27
|
-
### OAuth2.0 grant types supported:
|
|
28
|
-
|
|
29
|
-
The current 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/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
|
|
36
|
-
- [Username and Password flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#usernamepassword)
|
|
37
|
-
|
|
38
|
-
#### Confidential Client:
|
|
39
|
-
- [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with a client credential
|
|
40
|
-
- [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)
|
|
41
|
-
- [Silent Flow](https://docs.microsoft.com/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
|
|
42
|
-
- [Client Credential Grant](https://oauth.net/2/grant-types/client-credentials/)
|
|
43
|
-
- [On-behalf-of flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow)
|
|
44
|
-
- [Username and Password flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#usernamepassword)
|
|
45
|
-
|
|
46
|
-
**[Coming Soon]** In the future we plan to add support for:
|
|
47
|
-
- [Integrated Windows Authentication flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#integrated-windows-authentication)
|
|
48
|
-
|
|
49
|
-
More 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).
|
|
50
|
-
|
|
51
|
-
### Scenarios supported:
|
|
52
|
-
|
|
53
|
-
The scenarios supported with this library are:
|
|
54
|
-
- Desktop app that calls web APIs
|
|
55
|
-
- Web app that calls web APIs
|
|
56
|
-
- Web APIs that call web APIs
|
|
57
|
-
- Daemon apps
|
|
58
|
-
|
|
59
|
-
More 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).
|
|
60
|
-
|
|
61
|
-
## FAQ
|
|
62
|
-
|
|
63
|
-
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/faq.md).
|
|
64
|
-
|
|
65
|
-
## Prerequisites
|
|
66
|
-
|
|
67
|
-
Before using `@azure/msal-node` you will need to register your app in the azure portal:
|
|
68
|
-
|
|
69
|
-
- [App registration](https://docs.microsoft.com/graph/auth-register-app-v2)
|
|
70
|
-
|
|
71
|
-
## Installation
|
|
72
|
-
|
|
73
|
-
### Via NPM:
|
|
74
|
-
```javascript
|
|
75
|
-
npm install @azure/msal-node
|
|
76
|
-
```
|
|
77
|
-
## Node Version Support
|
|
78
|
-
MSAL 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.
|
|
79
|
-
|
|
80
|
-
Any major MSAL Node release:
|
|
81
|
-
- Will support stable (even-numbered) Maintenance LTS, Active LTS, and Current versions of Node
|
|
82
|
-
- Will drop support for any previously supported Node versions that have reached end of life
|
|
83
|
-
- Will not support prerelease/preview/pending versions until they are stable
|
|
84
|
-
|
|
85
|
-
| MSAL Node version | MSAL support status | Supported Node versions |
|
|
86
|
-
|-------------------|-------------------------|-------------------------|
|
|
87
|
-
| 1.x.x | Active development | 10, 12, 14, 16 |
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## Usage
|
|
91
|
-
|
|
92
|
-
### MSAL basics
|
|
93
|
-
- [Understand difference in between Public Client and Confidential Clients](https://docs.microsoft.com/azure/active-directory/develop/msal-client-applications)
|
|
94
|
-
- [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)
|
|
95
|
-
- [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)
|
|
96
|
-
- [Configuration](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md)
|
|
97
|
-
- [Request](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/request.md)
|
|
98
|
-
- [Response](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/Response.md)
|
|
99
|
-
|
|
100
|
-
## Samples
|
|
101
|
-
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.
|
|
102
|
-
|
|
103
|
-
AAD samples:
|
|
104
|
-
|
|
105
|
-
- [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.
|
|
106
|
-
- [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.
|
|
107
|
-
- [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.
|
|
108
|
-
- [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.
|
|
109
|
-
- [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.
|
|
110
|
-
- [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.
|
|
111
|
-
- [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.
|
|
112
|
-
- [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.
|
|
113
|
-
- [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.
|
|
114
|
-
- [ExpressTestApp](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/ExpressTestApp): Express.js MVC web application using OAuth 2.0 auth code with PKCE flow to acquire a token for a web API such as Microsoft Graph.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- [b2c-auth-code
|
|
120
|
-
- [b2c-
|
|
121
|
-
- [
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
- Navigate to `microsoft-authentication-library-for-js/lib/msal-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
1
|
+
# Microsoft Authentication Library for Node (msal-node)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@azure/msal-node/)
|
|
4
|
+
[](https://nodei.co/npm/@azure/msal-node/)
|
|
5
|
+
[](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)
|
|
6
|
+
|
|
7
|
+
| <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> |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
|
|
10
|
+
1. [About](#about)
|
|
11
|
+
1. [FAQ](#faq)
|
|
12
|
+
1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/CHANGELOG.md)
|
|
13
|
+
1. [Prerequisites](#prerequisites)
|
|
14
|
+
1. [Installation](#installation)
|
|
15
|
+
1. [Node Version Support](#node-version-support)
|
|
16
|
+
1. [Usage](#usage)
|
|
17
|
+
1. [Samples](#samples)
|
|
18
|
+
1. [Build Library](#build-and-test)
|
|
19
|
+
1. [Security Reporting](#security-reporting)
|
|
20
|
+
1. [License](#license)
|
|
21
|
+
1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
|
|
22
|
+
|
|
23
|
+
## About
|
|
24
|
+
|
|
25
|
+
MSAL 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).
|
|
26
|
+
|
|
27
|
+
### OAuth2.0 grant types supported:
|
|
28
|
+
|
|
29
|
+
The current 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/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
|
|
36
|
+
- [Username and Password flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#usernamepassword)
|
|
37
|
+
|
|
38
|
+
#### Confidential Client:
|
|
39
|
+
- [Authorization Code Grant](https://oauth.net/2/grant-types/authorization-code/) with a client credential
|
|
40
|
+
- [Refresh Token Grant](https://oauth.net/2/grant-types/refresh-token/)
|
|
41
|
+
- [Silent Flow](https://docs.microsoft.com/azure/active-directory/develop/msal-acquire-cache-tokens#acquiring-tokens-silently-from-the-cache)
|
|
42
|
+
- [Client Credential Grant](https://oauth.net/2/grant-types/client-credentials/)
|
|
43
|
+
- [On-behalf-of flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow)
|
|
44
|
+
- [Username and Password flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#usernamepassword)
|
|
45
|
+
|
|
46
|
+
**[Coming Soon]** In the future we plan to add support for:
|
|
47
|
+
- [Integrated Windows Authentication flow](https://docs.microsoft.com/azure/active-directory/develop/msal-authentication-flows#integrated-windows-authentication)
|
|
48
|
+
|
|
49
|
+
More 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).
|
|
50
|
+
|
|
51
|
+
### Scenarios supported:
|
|
52
|
+
|
|
53
|
+
The scenarios supported with this library are:
|
|
54
|
+
- Desktop app that calls web APIs
|
|
55
|
+
- Web app that calls web APIs
|
|
56
|
+
- Web APIs that call web APIs
|
|
57
|
+
- Daemon apps
|
|
58
|
+
|
|
59
|
+
More 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).
|
|
60
|
+
|
|
61
|
+
## FAQ
|
|
62
|
+
|
|
63
|
+
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/faq.md).
|
|
64
|
+
|
|
65
|
+
## Prerequisites
|
|
66
|
+
|
|
67
|
+
Before using `@azure/msal-node` you will need to register your app in the azure portal:
|
|
68
|
+
|
|
69
|
+
- [App registration](https://docs.microsoft.com/graph/auth-register-app-v2)
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
### Via NPM:
|
|
74
|
+
```javascript
|
|
75
|
+
npm install @azure/msal-node
|
|
76
|
+
```
|
|
77
|
+
## Node Version Support
|
|
78
|
+
MSAL 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.
|
|
79
|
+
|
|
80
|
+
Any major MSAL Node release:
|
|
81
|
+
- Will support stable (even-numbered) Maintenance LTS, Active LTS, and Current versions of Node
|
|
82
|
+
- Will drop support for any previously supported Node versions that have reached end of life
|
|
83
|
+
- Will not support prerelease/preview/pending versions until they are stable
|
|
84
|
+
|
|
85
|
+
| MSAL Node version | MSAL support status | Supported Node versions |
|
|
86
|
+
|-------------------|-------------------------|-------------------------|
|
|
87
|
+
| 1.x.x | Active development | 10, 12, 14, 16 |
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## Usage
|
|
91
|
+
|
|
92
|
+
### MSAL basics
|
|
93
|
+
- [Understand difference in between Public Client and Confidential Clients](https://docs.microsoft.com/azure/active-directory/develop/msal-client-applications)
|
|
94
|
+
- [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)
|
|
95
|
+
- [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)
|
|
96
|
+
- [Configuration](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/configuration.md)
|
|
97
|
+
- [Request](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/request.md)
|
|
98
|
+
- [Response](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/Response.md)
|
|
99
|
+
|
|
100
|
+
## Samples
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
AAD samples:
|
|
104
|
+
|
|
105
|
+
- [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.
|
|
106
|
+
- [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.
|
|
107
|
+
- [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.
|
|
108
|
+
- [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.
|
|
109
|
+
- [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.
|
|
110
|
+
- [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.
|
|
111
|
+
- [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.
|
|
112
|
+
- [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.
|
|
113
|
+
- [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.
|
|
114
|
+
- [ExpressTestApp](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/ExpressTestApp): Express.js MVC web application using OAuth 2.0 auth code with PKCE flow to acquire a token for a web API such as Microsoft Graph.
|
|
115
|
+
- [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.
|
|
116
|
+
|
|
117
|
+
B2C samples:
|
|
118
|
+
|
|
119
|
+
- [b2c-auth-code](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/b2c-auth-code): Express app using OAuth2.0 authorization code flow.
|
|
120
|
+
- [b2c-auth-code-pkce](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/b2c-auth-code-pkce): Express app using OAuth2.0 authorization code flow with PKCE.
|
|
121
|
+
- [b2c-silent-flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples/b2c-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.
|
|
122
|
+
- [ms-identity-b2c-javascript-nodejs-management](https://github.com/Azure-Samples/ms-identity-b2c-javascript-nodejs-management/tree/main/Chapter2): Command line app using OAuth 2.0 client credentials flow for performing user management operations on an Azure AD / Azure AD B2C tenant
|
|
123
|
+
|
|
124
|
+
Others:
|
|
125
|
+
|
|
126
|
+
- [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.
|
|
127
|
+
|
|
128
|
+
## Build and Test
|
|
129
|
+
|
|
130
|
+
- If you don't have [lerna](https://github.com/lerna/lerna) installed, run `npm install -g lerna`
|
|
131
|
+
- Run `lerna bootstrap` from anywhere within `microsoft-authentication-library-for-js.git`.
|
|
132
|
+
- Navigate to `microsoft-authentication-library-for-js/lib/msal-common` and run `npm run build`
|
|
133
|
+
- Navigate to `microsoft-authentication-library-for-js/lib/msal-node` and run `npm run build`
|
|
134
|
+
|
|
135
|
+
```javascript
|
|
136
|
+
// to link msal-node and msal-common packages
|
|
137
|
+
lerna bootstrap
|
|
138
|
+
|
|
139
|
+
// Change to the msal-node package directory
|
|
140
|
+
cd lib/msal-common/
|
|
141
|
+
|
|
142
|
+
// To run build only for node package
|
|
143
|
+
npm run build
|
|
144
|
+
|
|
145
|
+
// Change to the msal-node package directory
|
|
146
|
+
cd lib/msal-node/
|
|
147
|
+
|
|
148
|
+
// To run build only for node package
|
|
149
|
+
npm run build
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Local Development
|
|
153
|
+
Below is a list of commands you will probably find useful:
|
|
154
|
+
|
|
155
|
+
#### `npm run build:modules:watch`
|
|
156
|
+
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.
|
|
157
|
+
|
|
158
|
+
#### `npm run build`
|
|
159
|
+
Bundles the package to the `dist` folder.
|
|
160
|
+
The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module).
|
|
161
|
+
|
|
162
|
+
#### `lerna bootstrap`
|
|
163
|
+
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.
|
|
164
|
+
|
|
165
|
+
#### `npm run lint`
|
|
166
|
+
Runs eslint with Prettier
|
|
167
|
+
|
|
168
|
+
#### `npm test`, `npm run test:coverage`, `npm run test:watch`
|
|
169
|
+
Runs the test watcher (Jest) in an interactive mode.
|
|
170
|
+
By default, runs tests related to files changed since the last commit.
|
|
171
|
+
Generate code coverage by adding the flag --coverage. No additional setup needed. Jest can collect code coverage information from entire projects, including untested files.
|
|
172
|
+
|
|
173
|
+
## Security Reporting
|
|
174
|
+
|
|
175
|
+
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.
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
|
|
180
|
+
|
|
181
|
+
## We Value and Adhere to the Microsoft Open Source Code of Conduct
|
|
182
|
+
|
|
183
|
+
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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ServerTelemetryEntity, ThrottlingEntity, CacheManager, Logger, ValidCacheType, ICrypto, AuthorityMetadataEntity } from "@azure/msal-common";
|
|
1
|
+
import { AccountEntity, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ServerTelemetryEntity, ThrottlingEntity, CacheManager, Logger, ValidCacheType, ICrypto, AuthorityMetadataEntity, ValidCredentialType } from "@azure/msal-common";
|
|
2
2
|
import { InMemoryCache, JsonCache, CacheKVStore } from "./serializer/SerializerTypes";
|
|
3
3
|
/**
|
|
4
4
|
* This class implements Storage for node, reading cache from user specified storage location or an extension library
|
|
@@ -173,5 +173,9 @@ export declare class NodeStorage extends CacheManager {
|
|
|
173
173
|
* @param inMemoryCache - itemised cache read from the JSON
|
|
174
174
|
*/
|
|
175
175
|
static generateJsonCache(inMemoryCache: InMemoryCache): JsonCache;
|
|
176
|
+
/**
|
|
177
|
+
* Updates a credential's cache key if the current cache key is outdated
|
|
178
|
+
*/
|
|
179
|
+
updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;
|
|
176
180
|
}
|
|
177
181
|
//# sourceMappingURL=NodeStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeStorage.d.ts","sourceRoot":"","sources":["../src/cache/NodeStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,cAAc,EACd,OAAO,EACP,uBAAuB,
|
|
1
|
+
{"version":3,"file":"NodeStorage.d.ts","sourceRoot":"","sources":["../src/cache/NodeStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAA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AAI,MAAM,EAAE;IAQnB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa;IAM1D;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS;IAIjE;;OAEG;IACH,wBAAwB,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,GAAG,MAAM;CAiB7F"}
|
|
@@ -43,5 +43,9 @@ export declare class CryptoProvider implements ICrypto {
|
|
|
43
43
|
* Signs the given object as a jwt payload with private key retrieved by given kid - currently not implemented for node
|
|
44
44
|
*/
|
|
45
45
|
signJwt(): Promise<string>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the SHA-256 hash of an input string
|
|
48
|
+
*/
|
|
49
|
+
hashString(): Promise<string>;
|
|
46
50
|
}
|
|
47
51
|
//# sourceMappingURL=CryptoProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoProvider.d.ts","sourceRoot":"","sources":["../src/crypto/CryptoProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKxD;;;;GAIG;AACH,qBAAa,cAAe,YAAW,OAAO;IAC1C,OAAO,CAAC,aAAa,CAAgB;;IAOrC;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC;IAIvC;;OAEG;IACH,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzC;;;OAGG;IACH,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzC;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CryptoProvider.d.ts","sourceRoot":"","sources":["../src/crypto/CryptoProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKxD;;;;GAIG;AACH,qBAAa,cAAe,YAAW,OAAO;IAC1C,OAAO,CAAC,aAAa,CAAgB;;IAOrC;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,iBAAiB,IAAI,OAAO,CAAC,SAAS,CAAC;IAIvC;;OAEG;IACH,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIzC;;;OAGG;IACH,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzC;;OAEG;IACH,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;CAGhC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,5 +22,6 @@ export type { OnBehalfOfRequest } from "./request/OnBehalfOfRequest";
|
|
|
22
22
|
export type { UsernamePasswordRequest } from "./request/UsernamePasswordRequest";
|
|
23
23
|
export type { RefreshTokenRequest } from "./request/RefreshTokenRequest";
|
|
24
24
|
export type { SilentFlowRequest } from "./request/SilentFlowRequest";
|
|
25
|
-
export { PromptValue, ResponseMode, AuthenticationResult, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage,
|
|
25
|
+
export { PromptValue, ResponseMode, AuthenticationResult, AccountInfo, ValidCacheType, AuthError, AuthErrorMessage, ClientAuthError, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkRequestOptions, NetworkResponse, Logger, LogLevel, ProtocolMode, ICachePlugin, TokenCacheContext, ISerializableTokenCache } from "@azure/msal-common";
|
|
26
|
+
export { version } from "./packageMetadata";
|
|
26
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChI,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAGtO,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,YAAY,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC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AE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAGtO,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,YAAY,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AACnF,YAAY,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,YAAY,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAEH,WAAW,EACX,YAAY,EAEZ,oBAAoB,EAEpB,WAAW,EACX,cAAc,EAEd,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,+BAA+B,EAC/B,4BAA4B,EAC5B,mCAAmC,EACnC,WAAW,EAEX,cAAc,EACd,qBAAqB,EACrB,eAAe,EAEf,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -111,7 +111,11 @@ class HttpClient {
|
|
|
111
111
|
const request = {
|
|
112
112
|
method: HttpMethod.GET,
|
|
113
113
|
url: url,
|
|
114
|
+
|
|
115
|
+
/* istanbul ignore next */
|
|
114
116
|
headers: options && options.headers,
|
|
117
|
+
|
|
118
|
+
/* istanbul ignore next */
|
|
115
119
|
validateStatus: () => true
|
|
116
120
|
};
|
|
117
121
|
const response = await axios(request);
|
|
@@ -132,9 +136,15 @@ class HttpClient {
|
|
|
132
136
|
const request = {
|
|
133
137
|
method: HttpMethod.POST,
|
|
134
138
|
url: url,
|
|
139
|
+
|
|
140
|
+
/* istanbul ignore next */
|
|
135
141
|
data: options && options.body || "",
|
|
136
142
|
timeout: cancellationToken,
|
|
143
|
+
|
|
144
|
+
/* istanbul ignore next */
|
|
137
145
|
headers: options && options.headers,
|
|
146
|
+
|
|
147
|
+
/* istanbul ignore next */
|
|
138
148
|
validateStatus: () => true
|
|
139
149
|
};
|
|
140
150
|
const response = await axios(request);
|
|
@@ -450,6 +460,14 @@ class CryptoProvider {
|
|
|
450
460
|
signJwt() {
|
|
451
461
|
throw new Error("Method not implemented.");
|
|
452
462
|
}
|
|
463
|
+
/**
|
|
464
|
+
* Returns the SHA-256 hash of an input string
|
|
465
|
+
*/
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
hashString() {
|
|
469
|
+
throw new Error("Method not implemented.");
|
|
470
|
+
}
|
|
453
471
|
|
|
454
472
|
}
|
|
455
473
|
|
|
@@ -1227,6 +1245,29 @@ class NodeStorage extends msalCommon.CacheManager {
|
|
|
1227
1245
|
static generateJsonCache(inMemoryCache) {
|
|
1228
1246
|
return Serializer.serializeAllCache(inMemoryCache);
|
|
1229
1247
|
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Updates a credential's cache key if the current cache key is outdated
|
|
1250
|
+
*/
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
updateCredentialCacheKey(currentCacheKey, credential) {
|
|
1254
|
+
const updatedCacheKey = credential.generateCredentialKey();
|
|
1255
|
+
|
|
1256
|
+
if (currentCacheKey !== updatedCacheKey) {
|
|
1257
|
+
const cacheItem = this.getItem(currentCacheKey);
|
|
1258
|
+
|
|
1259
|
+
if (cacheItem) {
|
|
1260
|
+
this.removeItem(currentCacheKey);
|
|
1261
|
+
this.setItem(updatedCacheKey, cacheItem);
|
|
1262
|
+
this.logger.verbose(`Updated an outdated ${credential.credentialType} cache key`);
|
|
1263
|
+
return updatedCacheKey;
|
|
1264
|
+
} else {
|
|
1265
|
+
this.logger.error(`Attempted to update an outdated ${credential.credentialType} cache key but no item matching the outdated key was found in storage`);
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
return currentCacheKey;
|
|
1270
|
+
}
|
|
1230
1271
|
|
|
1231
1272
|
}
|
|
1232
1273
|
|
|
@@ -1512,7 +1553,7 @@ class TokenCache {
|
|
|
1512
1553
|
|
|
1513
1554
|
/* eslint-disable header/header */
|
|
1514
1555
|
const name = "@azure/msal-node";
|
|
1515
|
-
const version = "1.
|
|
1556
|
+
const version = "1.5.0";
|
|
1516
1557
|
|
|
1517
1558
|
/*
|
|
1518
1559
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1960,13 +2001,13 @@ class ClientAssertion {
|
|
|
1960
2001
|
const issuedAt = msalCommon.TimeUtils.nowSeconds();
|
|
1961
2002
|
this.expirationTime = issuedAt + 600;
|
|
1962
2003
|
const header = {
|
|
1963
|
-
|
|
1964
|
-
|
|
2004
|
+
alg: JwtConstants.RSA_256,
|
|
2005
|
+
x5t: EncodingUtils.base64EncodeUrl(this.thumbprint, "hex")
|
|
1965
2006
|
};
|
|
1966
2007
|
|
|
1967
2008
|
if (this.publicCertificate) {
|
|
1968
2009
|
Object.assign(header, {
|
|
1969
|
-
|
|
2010
|
+
x5c: this.publicCertificate
|
|
1970
2011
|
});
|
|
1971
2012
|
}
|
|
1972
2013
|
|
|
@@ -1979,7 +2020,7 @@ class ClientAssertion {
|
|
|
1979
2020
|
[JwtConstants.JWT_ID]: cryptoProvider.createNewGuid()
|
|
1980
2021
|
};
|
|
1981
2022
|
this.jwt = jsonwebtoken.sign(payload, this.privateKey, {
|
|
1982
|
-
header
|
|
2023
|
+
header
|
|
1983
2024
|
});
|
|
1984
2025
|
return this.jwt;
|
|
1985
2026
|
}
|
|
@@ -2192,6 +2233,12 @@ Object.defineProperty(exports, 'InteractionRequiredAuthError', {
|
|
|
2192
2233
|
return msalCommon.InteractionRequiredAuthError;
|
|
2193
2234
|
}
|
|
2194
2235
|
});
|
|
2236
|
+
Object.defineProperty(exports, 'InteractionRequiredAuthErrorMessage', {
|
|
2237
|
+
enumerable: true,
|
|
2238
|
+
get: function () {
|
|
2239
|
+
return msalCommon.InteractionRequiredAuthErrorMessage;
|
|
2240
|
+
}
|
|
2241
|
+
});
|
|
2195
2242
|
Object.defineProperty(exports, 'LogLevel', {
|
|
2196
2243
|
enumerable: true,
|
|
2197
2244
|
get: function () {
|
|
@@ -2242,4 +2289,5 @@ exports.NodeStorage = NodeStorage;
|
|
|
2242
2289
|
exports.PublicClientApplication = PublicClientApplication;
|
|
2243
2290
|
exports.TokenCache = TokenCache;
|
|
2244
2291
|
exports.buildAppConfiguration = buildAppConfiguration;
|
|
2292
|
+
exports.version = version;
|
|
2245
2293
|
//# sourceMappingURL=msal-node.cjs.development.js.map
|