@azure/msal-browser 2.18.0 → 2.19.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.
Files changed (104) hide show
  1. package/README.md +212 -212
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.d.ts +4 -0
  4. package/dist/app/ClientApplication.d.ts.map +1 -1
  5. package/dist/app/ClientApplication.js +9 -3
  6. package/dist/app/ClientApplication.js.map +1 -1
  7. package/dist/app/IPublicClientApplication.d.ts +2 -0
  8. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  9. package/dist/app/IPublicClientApplication.js +4 -1
  10. package/dist/app/IPublicClientApplication.js.map +1 -1
  11. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  12. package/dist/app/PublicClientApplication.js +5 -3
  13. package/dist/app/PublicClientApplication.js.map +1 -1
  14. package/dist/cache/AsyncMemoryStorage.d.ts +46 -0
  15. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -0
  16. package/dist/cache/AsyncMemoryStorage.js +195 -0
  17. package/dist/cache/AsyncMemoryStorage.js.map +1 -0
  18. package/dist/cache/BrowserCacheManager.d.ts +5 -1
  19. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  20. package/dist/cache/BrowserCacheManager.js +20 -1
  21. package/dist/cache/BrowserCacheManager.js.map +1 -1
  22. package/dist/cache/BrowserStorage.d.ts +1 -1
  23. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  24. package/dist/cache/BrowserStorage.js +1 -1
  25. package/dist/cache/BrowserStorage.js.map +1 -1
  26. package/dist/cache/DatabaseStorage.d.ts +25 -6
  27. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  28. package/dist/cache/DatabaseStorage.js +127 -81
  29. package/dist/cache/DatabaseStorage.js.map +1 -1
  30. package/dist/cache/IAsyncMemoryStorage.d.ts +28 -0
  31. package/dist/cache/IAsyncMemoryStorage.d.ts.map +1 -0
  32. package/dist/cache/IWindowStorage.d.ts +3 -3
  33. package/dist/cache/IWindowStorage.d.ts.map +1 -1
  34. package/dist/cache/MemoryStorage.d.ts +3 -3
  35. package/dist/cache/MemoryStorage.d.ts.map +1 -1
  36. package/dist/cache/MemoryStorage.js +1 -1
  37. package/dist/cache/MemoryStorage.js.map +1 -1
  38. package/dist/cache/TokenCache.js +1 -1
  39. package/dist/config/Configuration.js +1 -1
  40. package/dist/crypto/BrowserCrypto.d.ts +3 -1
  41. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  42. package/dist/crypto/BrowserCrypto.js +3 -2
  43. package/dist/crypto/BrowserCrypto.js.map +1 -1
  44. package/dist/crypto/CryptoOps.d.ts +11 -5
  45. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  46. package/dist/crypto/CryptoOps.js +37 -13
  47. package/dist/crypto/CryptoOps.js.map +1 -1
  48. package/dist/crypto/GuidGenerator.js +1 -1
  49. package/dist/crypto/PkceGenerator.js +1 -1
  50. package/dist/crypto/SignedHttpRequest.d.ts +6 -2
  51. package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
  52. package/dist/crypto/SignedHttpRequest.js +11 -5
  53. package/dist/crypto/SignedHttpRequest.js.map +1 -1
  54. package/dist/encode/Base64Decode.js +1 -1
  55. package/dist/encode/Base64Encode.js +1 -1
  56. package/dist/error/BrowserAuthError.d.ts +8 -0
  57. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  58. package/dist/error/BrowserAuthError.js +12 -2
  59. package/dist/error/BrowserAuthError.js.map +1 -1
  60. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  61. package/dist/event/EventHandler.js +1 -1
  62. package/dist/event/EventMessage.js +1 -1
  63. package/dist/event/EventType.js +1 -1
  64. package/dist/index.cjs.js +2259 -1735
  65. package/dist/index.cjs.js.map +1 -1
  66. package/dist/index.d.ts +3 -3
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +2 -2
  69. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  70. package/dist/interaction_client/BaseInteractionClient.js +10 -2
  71. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  72. package/dist/interaction_client/PopupClient.js +1 -1
  73. package/dist/interaction_client/RedirectClient.js +2 -2
  74. package/dist/interaction_client/RedirectClient.js.map +1 -1
  75. package/dist/interaction_client/SilentCacheClient.js +1 -1
  76. package/dist/interaction_client/SilentIframeClient.js +1 -1
  77. package/dist/interaction_client/SilentRefreshClient.js +1 -1
  78. package/dist/interaction_client/StandardInteractionClient.js +1 -1
  79. package/dist/interaction_handler/InteractionHandler.js +1 -1
  80. package/dist/interaction_handler/PopupHandler.js +1 -1
  81. package/dist/interaction_handler/RedirectHandler.js +1 -1
  82. package/dist/interaction_handler/SilentHandler.js +1 -1
  83. package/dist/navigation/NavigationClient.js +1 -1
  84. package/dist/network/FetchClient.js +1 -1
  85. package/dist/network/XhrClient.js +1 -1
  86. package/dist/packageMetadata.d.ts +1 -1
  87. package/dist/packageMetadata.js +2 -2
  88. package/dist/packageMetadata.js.map +1 -1
  89. package/dist/request/RedirectRequest.d.ts.map +1 -1
  90. package/dist/utils/BrowserConstants.d.ts +3 -0
  91. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  92. package/dist/utils/BrowserConstants.js +7 -3
  93. package/dist/utils/BrowserConstants.js.map +1 -1
  94. package/dist/utils/BrowserProtocolUtils.js +1 -1
  95. package/dist/utils/BrowserStringUtils.js +1 -1
  96. package/dist/utils/BrowserUtils.js +1 -1
  97. package/dist/utils/MathUtils.js +1 -1
  98. package/dist/utils/PopupUtils.js +1 -1
  99. package/lib/msal-browser.js +2259 -1735
  100. package/lib/msal-browser.js.map +1 -1
  101. package/lib/msal-browser.min.js +31 -31
  102. package/package.json +3 -2
  103. package/CHANGELOG.json +0 -1548
  104. package/CHANGELOG.md +0 -491
package/README.md CHANGED
@@ -1,212 +1,212 @@
1
- # Microsoft Authentication Library for JavaScript (MSAL.js) 2.0 for Browser-Based Single-Page Applications
2
-
3
- [![npm version](https://img.shields.io/npm/v/@azure/msal-browser.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-browser/)
4
- [![npm version](https://img.shields.io/npm/dm/@azure/msal-browser.svg)](https://nodei.co/npm/@azure/msal-browser/)
5
- [![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)
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_browser.html" target="_blank">Library Reference</a> |
8
- | --- | --- | --- |
9
-
10
- 1. [About](#about)
11
- 1. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md)
12
- 1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/CHANGELOG.md)
13
- 1. [Roadmap](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/roadmap.md)
14
- 1. [Prerequisites](#prerequisites)
15
- 1. [Installation](#installation)
16
- 1. [Usage](#usage)
17
- - [Migrating from Previous MSAL Versions](#migrating-from-previous-msal-versions)
18
- - [MSAL Basics](#msal-basics)
19
- - [Advanced Topics](#advanced-topics)
20
- 1. [Samples](#samples)
21
- 1. [Build and Test](#build-and-test)
22
- 1. [Authorization Code vs Implicit](#implicit-flow-vs-authorization-code-flow-with-pkce)
23
- 1. [Framework Wrappers](#framework-wrappers)
24
- 1. [Security Reporting](#security-reporting)
25
- 1. [License](#license)
26
- 1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
27
-
28
- ## About
29
-
30
- The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using [Azure AD](https://docs.microsoft.com/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).
31
-
32
- 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). If you are looking for the version of the library that uses the implicit flow, please see the [`msal-core` library](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core).
33
-
34
- This is an improvement upon the current `msal-core` library which will utilize the authorization code flow in the browser. Most features available in the old library will be available in this one, but there are nuances to the authentication flow in both. The `@azure/msal-browser` package does NOT support the implicit flow.
35
-
36
- ## FAQ
37
-
38
- See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md).
39
-
40
- ## Roadmap
41
-
42
- See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/roadmap.md).
43
-
44
- ## Prerequisites
45
-
46
- - `@azure/msal-browser` is meant to be used in [Single-Page Application scenarios](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-overview).
47
-
48
- - 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.
49
-
50
- ## Installation
51
-
52
- ### Via NPM
53
-
54
- ```javascript
55
- npm install @azure/msal-browser
56
- ```
57
-
58
- ### Via CDN
59
-
60
- <!-- CDN_LATEST -->
61
- ```html
62
- <script type="text/javascript" src="https://alcdn.msauth.net/browser/2.18.0/js/msal-browser.min.js"></script>
63
- ```
64
-
65
- See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/cdn-usage.md) for more info on how to use this package from the Microsoft CDN.
66
-
67
- ## Usage
68
-
69
- ### Migrating from Previous MSAL Versions
70
-
71
- If you have MSAL v1.x currently running in your application, you can follow the instructions [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v1-migration.md) to migrate your application to using the `@azure/msal-browser` package.
72
-
73
- ### MSAL Basics
74
-
75
- 1. [Initialization](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md)
76
- 2. [Logging in a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md)
77
- 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)
78
- 4. [Managing Token Lifetimes](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/token-lifetimes.md)
79
- 5. [Managing Accounts](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/Accounts.md)
80
- 6. [Logging Out a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/logout.md)
81
-
82
- ### Advanced Topics
83
-
84
- - [Configuration Options](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md)
85
- - [Request and Response Details](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/request-response-object.md)
86
- - [Cache Storage](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/caching.md)
87
- - [Performance Enhancements](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/performance.md)
88
- - [Instance Aware Flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/instance-aware.md)
89
-
90
- ## Samples
91
-
92
- 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.
93
-
94
- - You can run any VanillaJSTestApp2.0 sample by changing the `authConfig.js` file in the respective folder to match your app registration and running the `npm` command `npm start -- -s <sample-name> -p <port>` in the VanillaJSTestApp2.0 folder.
95
- - You can run the TypescriptTestApp2.0 sample by changing the `AuthModule.ts` file to match your app registration and running the `npm` command `npm start` in the TypescriptTestApp2.0 folder.
96
-
97
- Additionally, the `msal-angular-v2-samples` folder contains an Angular 10 sample app that uses msal-browser.
98
-
99
- - You can run the angular10-browser sample by changing the `app.module.ts` file to match your app registration and running the `npm` command `npm start` in the angular-10-browser-sample folder.
100
-
101
- Here is a complete list of samples for the MSAL.js 2.x library:
102
-
103
- | Sample | Description | How to Run |
104
- | ------ | ----------- | ---------- |
105
- | [TypeScript Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/TypescriptTestApp2.0) | A TypeScript sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
106
- | [Basic Auth Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/default) | A vanilla Javascript sample showing basic usage of the MSAL 2.0 library (`@azure/msal-browser` package) with the Microsoft Graph API. | `npm start -- -s default` |
107
- | [Multiple Resources Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/multipleResources) | A vanilla JS sample showing usage of MSAL 2.0 with authentication on page load with a redirect. | `npm start -- -s multipleResources` |
108
- | [On Page Load Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/onPageLoad) | A vanilla JS sample showing usage of MSAL 2.0 with authentication on page load with a redirect. | `npm start -- -s onPageLoad` |
109
- | [ssoSilent() Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/ssoSilent) | A vanilla JS sample showing usage of the ssoSilent API, allowing you to sign in a user silently if a context exists on the authentication server. | `npm start -- -s ssoSilent` |
110
- | [Internet Explorer 11 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/ie11-sample) | A vanilla JS sample showing usage of `@azure/msal-browser` in an application designed to run in Internet Explorer 11. | `npm start -- -s ie11-sample` |
111
- | [Angular 10 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v2-samples/angular10-browser-sample) | An Angular 10 sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
112
-
113
- More instructions to run the samples can be found in the [`README.md` file](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/Readme.md) of the VanillaJSTestApp2.0 folder.
114
-
115
- More advanced samples backed with a tutorial can be found in the [Azure Samples](https://github.com/Azure-Samples) space on GitHub:
116
-
117
- - [JavaScript SPA calling Express.js web API](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/3-Authorization-II/1-call-api)
118
- - [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)
119
- - [React & Redux SPA calling Microsoft Graph via ASP.NET Core web API using on-behalf-of flow](https://github.com/Azure-Samples/ms-identity-javascript-react-spa-dotnetcore-webapi-obo)
120
- - [Deployment tutorial for Azure App Service and Azure Storage](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/5-Deployment)
121
-
122
- We also provide samples for addin/plugin scenarios:
123
-
124
- - [Office Addin-in using MSAL.js](https://github.com/OfficeDev/PnP-OfficeAddins/blob/main/Samples/auth/Office-Add-in-Microsoft-Graph-React/)
125
- - [Teams Tab using MSAL.js](https://github.com/pnp/teams-dev-samples/tree/main/samples/tab-sso/src/nodejs)
126
- - [Chromium Extension using MSAL.js](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/ChromiumExtensionSample)
127
-
128
- ## Build and Test
129
-
130
- See the [`contributing.md`](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/contributing.md) file for more information.
131
-
132
- ### Linking local package dependencies
133
-
134
- If you are having issues with `lerna` and wish to use the local version of the `@azure/msal-common` library (to reflect changes made in both repositories) you can run do the following:
135
-
136
- ```bash
137
- // Change to the msal-browser package directory
138
- cd lib/msal-browser/
139
- // Install package dependencies
140
- npm install
141
- // Change to the msal-common package directory
142
- cd ../msal-common/
143
- // Install package dependencies
144
- npm install
145
- // Prepare the local msal-common package for linking
146
- npm link
147
- // Change back to the msal-browser package directory
148
- cd ../msal-browser/
149
- // Link to the local build of msal-common
150
- npm link @azure/msal-common
151
- ```
152
-
153
- ### Building the package
154
-
155
- To build the `@azure/msal-browser` library, you can do the following:
156
-
157
- ```bash
158
- // Change to the msal-browser package directory
159
- cd lib/msal-browser/
160
- // To run build only for browser package
161
- npm run build
162
- ```
163
-
164
- To build both the `@azure/msal-browser` library and `@azure/msal-common` libraries, you can do the following:
165
-
166
- ```bash
167
- // Change to the msal-browser package directory
168
- cd lib/msal-browser/
169
- // To run build only for browser package
170
- npm run build:all
171
- ```
172
-
173
- ### Running Tests
174
-
175
- `@azure/msal-browser` uses [mocha](https://mochajs.org/) and [chai](https://www.chaijs.com/) to run unit tests, as well as Istanbul's [nyc](https://github.com/istanbuljs/nyc) tool for code coverage.
176
-
177
- ```bash
178
- // To run tests
179
- npm test
180
- // To run tests with code coverage
181
- npm run test:coverage:only
182
- ```
183
-
184
- ## Framework Wrappers
185
-
186
- If you are using a framework such as Angular or React you may be interested in using one of our wrapper libraries:
187
-
188
- - Angular: [@azure/msal-angular v2](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular)
189
- - React: [@azure/msal-react](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-react)
190
-
191
- ## Implicit Flow vs Authorization Code Flow with PKCE
192
-
193
- MSAL.js 1.x implemented the [Implicit Grant Flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow), as defined by the OAuth 2.0 protocol and [OpenID](https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc).
194
-
195
- Our goal is that the library abstracts enough of the protocol away so that you can get plug and play authentication, but it is important to know and understand the implicit flow from a security perspective. The MSAL 1.x client for single-page applications runs in the context of a web browser which cannot manage client secrets securely. It uses the implicit flow, which optimized for single-page applications and has one less hop between client and server so tokens are returned directly to the browser. These aspects make it naturally less secure. These security concerns are mitigated per standard practices such as: use of short lived tokens (and so no refresh tokens are returned), the library requiring a registered redirect URI for the app, and library matching the request and response with a unique nonce and state parameter. You can read more about the [disadvantages of the implicit flow here](https://tools.ietf.org/html/draft-ietf-oauth-browser-based-apps-04#section-9.8.6).
196
-
197
- The MSAL library will now support the Authorization Code Flow with PKCE for Browser-Based Applications without a backend web server.
198
- We plan to continue support for the implicit flow in the `msal-core` library.
199
-
200
- You can learn further details about `@azure/msal-browser` functionality documented in our [docs folder](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser/docs) and find complete [code samples](#samples).
201
-
202
- ## Security Reporting
203
-
204
- 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.
205
-
206
- ## License
207
-
208
- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
209
-
210
- ## We Value and Adhere to the Microsoft Open Source Code of Conduct
211
-
212
- 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
+ # Microsoft Authentication Library for JavaScript (MSAL.js) 2.0 for Browser-Based Single-Page Applications
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@azure/msal-browser.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-browser/)
4
+ [![npm version](https://img.shields.io/npm/dm/@azure/msal-browser.svg)](https://nodei.co/npm/@azure/msal-browser/)
5
+ [![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)
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_browser.html" target="_blank">Library Reference</a> |
8
+ | --- | --- | --- |
9
+
10
+ 1. [About](#about)
11
+ 1. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md)
12
+ 1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/CHANGELOG.md)
13
+ 1. [Roadmap](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/roadmap.md)
14
+ 1. [Prerequisites](#prerequisites)
15
+ 1. [Installation](#installation)
16
+ 1. [Usage](#usage)
17
+ - [Migrating from Previous MSAL Versions](#migrating-from-previous-msal-versions)
18
+ - [MSAL Basics](#msal-basics)
19
+ - [Advanced Topics](#advanced-topics)
20
+ 1. [Samples](#samples)
21
+ 1. [Build and Test](#build-and-test)
22
+ 1. [Authorization Code vs Implicit](#implicit-flow-vs-authorization-code-flow-with-pkce)
23
+ 1. [Framework Wrappers](#framework-wrappers)
24
+ 1. [Security Reporting](#security-reporting)
25
+ 1. [License](#license)
26
+ 1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
27
+
28
+ ## About
29
+
30
+ The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using [Azure AD](https://docs.microsoft.com/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).
31
+
32
+ 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). If you are looking for the version of the library that uses the implicit flow, please see the [`msal-core` library](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-core).
33
+
34
+ This is an improvement upon the current `msal-core` library which will utilize the authorization code flow in the browser. Most features available in the old library will be available in this one, but there are nuances to the authentication flow in both. The `@azure/msal-browser` package does NOT support the implicit flow.
35
+
36
+ ## FAQ
37
+
38
+ See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md).
39
+
40
+ ## Roadmap
41
+
42
+ See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/roadmap.md).
43
+
44
+ ## Prerequisites
45
+
46
+ - `@azure/msal-browser` is meant to be used in [Single-Page Application scenarios](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-overview).
47
+
48
+ - 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.
49
+
50
+ ## Installation
51
+
52
+ ### Via NPM
53
+
54
+ ```javascript
55
+ npm install @azure/msal-browser
56
+ ```
57
+
58
+ ### Via CDN
59
+
60
+ <!-- CDN_LATEST -->
61
+ ```html
62
+ <script type="text/javascript" src="https://alcdn.msauth.net/browser/2.18.0/js/msal-browser.min.js"></script>
63
+ ```
64
+
65
+ See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/cdn-usage.md) for more info on how to use this package from the Microsoft CDN.
66
+
67
+ ## Usage
68
+
69
+ ### Migrating from Previous MSAL Versions
70
+
71
+ If you have MSAL v1.x currently running in your application, you can follow the instructions [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v1-migration.md) to migrate your application to using the `@azure/msal-browser` package.
72
+
73
+ ### MSAL Basics
74
+
75
+ 1. [Initialization](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/initialization.md)
76
+ 2. [Logging in a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/login-user.md)
77
+ 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)
78
+ 4. [Managing Token Lifetimes](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/token-lifetimes.md)
79
+ 5. [Managing Accounts](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/docs/Accounts.md)
80
+ 6. [Logging Out a User](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/logout.md)
81
+
82
+ ### Advanced Topics
83
+
84
+ - [Configuration Options](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md)
85
+ - [Request and Response Details](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/request-response-object.md)
86
+ - [Cache Storage](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/caching.md)
87
+ - [Performance Enhancements](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/performance.md)
88
+ - [Instance Aware Flow](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/instance-aware.md)
89
+
90
+ ## Samples
91
+
92
+ 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.
93
+
94
+ - You can run any VanillaJSTestApp2.0 sample by changing the `authConfig.js` file in the respective folder to match your app registration and running the `npm` command `npm start -- -s <sample-name> -p <port>` in the VanillaJSTestApp2.0 folder.
95
+ - You can run the TypescriptTestApp2.0 sample by changing the `AuthModule.ts` file to match your app registration and running the `npm` command `npm start` in the TypescriptTestApp2.0 folder.
96
+
97
+ Additionally, the `msal-angular-v2-samples` folder contains an Angular 10 sample app that uses msal-browser.
98
+
99
+ - You can run the angular10-browser sample by changing the `app.module.ts` file to match your app registration and running the `npm` command `npm start` in the angular-10-browser-sample folder.
100
+
101
+ Here is a complete list of samples for the MSAL.js 2.x library:
102
+
103
+ | Sample | Description | How to Run |
104
+ | ------ | ----------- | ---------- |
105
+ | [TypeScript Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/TypescriptTestApp2.0) | A TypeScript sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
106
+ | [Basic Auth Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/default) | A vanilla Javascript sample showing basic usage of the MSAL 2.0 library (`@azure/msal-browser` package) with the Microsoft Graph API. | `npm start -- -s default` |
107
+ | [Multiple Resources Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/multipleResources) | A vanilla JS sample showing usage of MSAL 2.0 with authentication on page load with a redirect. | `npm start -- -s multipleResources` |
108
+ | [On Page Load Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/onPageLoad) | A vanilla JS sample showing usage of MSAL 2.0 with authentication on page load with a redirect. | `npm start -- -s onPageLoad` |
109
+ | [ssoSilent() Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/ssoSilent) | A vanilla JS sample showing usage of the ssoSilent API, allowing you to sign in a user silently if a context exists on the authentication server. | `npm start -- -s ssoSilent` |
110
+ | [Internet Explorer 11 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/app/ie11-sample) | A vanilla JS sample showing usage of `@azure/msal-browser` in an application designed to run in Internet Explorer 11. | `npm start -- -s ie11-sample` |
111
+ | [Angular 10 Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v2-samples/angular10-browser-sample) | An Angular 10 sample showing usage of MSAL 2.0 with the Microsoft Graph API. | `npm start` |
112
+
113
+ More instructions to run the samples can be found in the [`README.md` file](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/VanillaJSTestApp2.0/Readme.md) of the VanillaJSTestApp2.0 folder.
114
+
115
+ More advanced samples backed with a tutorial can be found in the [Azure Samples](https://github.com/Azure-Samples) space on GitHub:
116
+
117
+ - [JavaScript SPA calling Express.js web API](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/3-Authorization-II/1-call-api)
118
+ - [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)
119
+ - [React & Redux SPA calling Microsoft Graph via ASP.NET Core web API using on-behalf-of flow](https://github.com/Azure-Samples/ms-identity-javascript-react-spa-dotnetcore-webapi-obo)
120
+ - [Deployment tutorial for Azure App Service and Azure Storage](https://github.com/Azure-Samples/ms-identity-javascript-tutorial/tree/main/5-Deployment)
121
+
122
+ We also provide samples for addin/plugin scenarios:
123
+
124
+ - [Office Addin-in using MSAL.js](https://github.com/OfficeDev/PnP-OfficeAddins/blob/main/Samples/auth/Office-Add-in-Microsoft-Graph-React/)
125
+ - [Teams Tab using MSAL.js](https://github.com/pnp/teams-dev-samples/tree/main/samples/tab-sso/src/nodejs)
126
+ - [Chromium Extension using MSAL.js](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-browser-samples/ChromiumExtensionSample)
127
+
128
+ ## Build and Test
129
+
130
+ See the [`contributing.md`](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/contributing.md) file for more information.
131
+
132
+ ### Linking local package dependencies
133
+
134
+ If you are having issues with `lerna` and wish to use the local version of the `@azure/msal-common` library (to reflect changes made in both repositories) you can run do the following:
135
+
136
+ ```bash
137
+ // Change to the msal-browser package directory
138
+ cd lib/msal-browser/
139
+ // Install package dependencies
140
+ npm install
141
+ // Change to the msal-common package directory
142
+ cd ../msal-common/
143
+ // Install package dependencies
144
+ npm install
145
+ // Prepare the local msal-common package for linking
146
+ npm link
147
+ // Change back to the msal-browser package directory
148
+ cd ../msal-browser/
149
+ // Link to the local build of msal-common
150
+ npm link @azure/msal-common
151
+ ```
152
+
153
+ ### Building the package
154
+
155
+ To build the `@azure/msal-browser` library, you can do the following:
156
+
157
+ ```bash
158
+ // Change to the msal-browser package directory
159
+ cd lib/msal-browser/
160
+ // To run build only for browser package
161
+ npm run build
162
+ ```
163
+
164
+ To build both the `@azure/msal-browser` library and `@azure/msal-common` libraries, you can do the following:
165
+
166
+ ```bash
167
+ // Change to the msal-browser package directory
168
+ cd lib/msal-browser/
169
+ // To run build only for browser package
170
+ npm run build:all
171
+ ```
172
+
173
+ ### Running Tests
174
+
175
+ `@azure/msal-browser` uses [mocha](https://mochajs.org/) and [chai](https://www.chaijs.com/) to run unit tests, as well as Istanbul's [nyc](https://github.com/istanbuljs/nyc) tool for code coverage.
176
+
177
+ ```bash
178
+ // To run tests
179
+ npm test
180
+ // To run tests with code coverage
181
+ npm run test:coverage:only
182
+ ```
183
+
184
+ ## Framework Wrappers
185
+
186
+ If you are using a framework such as Angular or React you may be interested in using one of our wrapper libraries:
187
+
188
+ - Angular: [@azure/msal-angular v2](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular)
189
+ - React: [@azure/msal-react](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-react)
190
+
191
+ ## Implicit Flow vs Authorization Code Flow with PKCE
192
+
193
+ MSAL.js 1.x implemented the [Implicit Grant Flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow), as defined by the OAuth 2.0 protocol and [OpenID](https://docs.microsoft.com/azure/active-directory/develop/v2-protocols-oidc).
194
+
195
+ Our goal is that the library abstracts enough of the protocol away so that you can get plug and play authentication, but it is important to know and understand the implicit flow from a security perspective. The MSAL 1.x client for single-page applications runs in the context of a web browser which cannot manage client secrets securely. It uses the implicit flow, which optimized for single-page applications and has one less hop between client and server so tokens are returned directly to the browser. These aspects make it naturally less secure. These security concerns are mitigated per standard practices such as: use of short lived tokens (and so no refresh tokens are returned), the library requiring a registered redirect URI for the app, and library matching the request and response with a unique nonce and state parameter. You can read more about the [disadvantages of the implicit flow here](https://tools.ietf.org/html/draft-ietf-oauth-browser-based-apps-04#section-9.8.6).
196
+
197
+ The MSAL library will now support the Authorization Code Flow with PKCE for Browser-Based Applications without a backend web server.
198
+ We plan to continue support for the implicit flow in the `msal-core` library.
199
+
200
+ You can learn further details about `@azure/msal-browser` functionality documented in our [docs folder](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser/docs) and find complete [code samples](#samples).
201
+
202
+ ## Security Reporting
203
+
204
+ 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.
205
+
206
+ ## License
207
+
208
+ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.
209
+
210
+ ## We Value and Adhere to the Microsoft Open Source Code of Conduct
211
+
212
+ 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
- /*! @azure/msal-browser v2.18.0 2021-10-05 */
1
+ /*! @azure/msal-browser v2.19.2 2022-08-03 */
2
2
  'use strict';
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -203,5 +203,9 @@ export declare abstract class ClientApplication {
203
203
  * @param navigationClient
204
204
  */
205
205
  setNavigationClient(navigationClient: INavigationClient): void;
206
+ /**
207
+ * Returns the configuration object
208
+ */
209
+ getConfiguration(): BrowserConfiguration;
206
210
  }
207
211
  //# sourceMappingURL=ClientApplication.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/ClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EAA0D,WAAW,EAAa,cAAc,EAAE,oBAAoB,EAAE,MAAM,EAAE,uBAAuB,EAAE,OAAO,EAAiC,MAAM,oBAAoB,CAAC;AACnO,OAAO,EAAE,mBAAmB,EAAiC,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,oBAAo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@@
1
- /*! @azure/msal-browser v2.18.0 2021-10-05 */
1
+ /*! @azure/msal-browser v2.19.2 2022-08-03 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { CryptoOps } from '../crypto/CryptoOps.js';
@@ -61,7 +61,7 @@ var ClientApplication = /** @class */ (function () {
61
61
  // Initialize redirectResponse Map
62
62
  this.redirectResponse = new Map();
63
63
  // Initialize the crypto class.
64
- this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps() : DEFAULT_CRYPTO_IMPLEMENTATION;
64
+ this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger) : DEFAULT_CRYPTO_IMPLEMENTATION;
65
65
  this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
66
66
  // Initialize the browser storage class.
67
67
  this.browserStorage = this.isBrowserEnvironment ?
@@ -290,7 +290,7 @@ var ClientApplication = /** @class */ (function () {
290
290
  var isInvalidGrantError = (e.errorCode === BrowserConstants.INVALID_GRANT_ERROR);
291
291
  if (isServerError && isInvalidGrantError && !isInteractionRequiredError) {
292
292
  _this.logger.verbose("Refresh token expired or invalid, attempting acquire token by iframe", request.correlationId);
293
- var silentIframeClient = new SilentIframeClient(_this.config, _this.browserStorage, _this.browserCrypto, _this.logger, _this.eventHandler, _this.navigationClient, ApiId.acquireTokenSilent_authCode);
293
+ var silentIframeClient = new SilentIframeClient(_this.config, _this.browserStorage, _this.browserCrypto, _this.logger, _this.eventHandler, _this.navigationClient, ApiId.acquireTokenSilent_authCode, request.correlationId);
294
294
  return silentIframeClient.acquireToken(request);
295
295
  }
296
296
  throw e;
@@ -510,6 +510,12 @@ var ClientApplication = /** @class */ (function () {
510
510
  ClientApplication.prototype.setNavigationClient = function (navigationClient) {
511
511
  this.navigationClient = navigationClient;
512
512
  };
513
+ /**
514
+ * Returns the configuration object
515
+ */
516
+ ClientApplication.prototype.getConfiguration = function () {
517
+ return this.config;
518
+ };
513
519
  return ClientApplication;
514
520
  }());
515
521