@azure/msal-angular 3.0.0 → 3.0.1

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 (86) hide show
  1. package/IMsalService.d.ts +15 -0
  2. package/README.md +166 -158
  3. package/constants.d.ts +5 -0
  4. package/esm2020/IMsalService.mjs +6 -0
  5. package/esm2020/azure-msal-angular.mjs +5 -0
  6. package/esm2020/constants.mjs +10 -0
  7. package/esm2020/msal.broadcast.config.mjs +6 -0
  8. package/esm2020/msal.broadcast.service.mjs +57 -0
  9. package/esm2020/msal.guard.config.mjs +6 -0
  10. package/esm2020/msal.guard.mjs +218 -0
  11. package/esm2020/msal.interceptor.config.mjs +6 -0
  12. package/esm2020/msal.interceptor.mjs +270 -0
  13. package/esm2020/msal.module.mjs +46 -0
  14. package/esm2020/msal.navigation.client.mjs +51 -0
  15. package/esm2020/msal.redirect.component.mjs +31 -0
  16. package/esm2020/msal.service.mjs +81 -0
  17. package/esm2020/packageMetadata.mjs +4 -0
  18. package/esm2020/public-api.mjs +18 -0
  19. package/fesm2015/azure-msal-angular.mjs +745 -0
  20. package/fesm2015/azure-msal-angular.mjs.map +1 -0
  21. package/fesm2020/azure-msal-angular.mjs +741 -0
  22. package/fesm2020/azure-msal-angular.mjs.map +1 -0
  23. package/index.d.ts +5 -0
  24. package/msal.broadcast.config.d.ts +3 -0
  25. package/msal.broadcast.service.d.ts +17 -0
  26. package/msal.guard.config.d.ts +9 -0
  27. package/msal.guard.d.ts +43 -0
  28. package/msal.interceptor.config.d.ts +17 -0
  29. package/msal.interceptor.d.ts +63 -0
  30. package/msal.module.d.ts +13 -0
  31. package/msal.navigation.client.d.ts +19 -0
  32. package/msal.redirect.component.d.ts +15 -0
  33. package/msal.service.d.ts +31 -0
  34. package/package.json +28 -55
  35. package/packageMetadata.d.ts +2 -0
  36. package/{src/public-api.ts → public-api.d.ts} +3 -21
  37. package/.beachballrc +0 -3
  38. package/.editorconfig +0 -16
  39. package/CHANGELOG.json +0 -1418
  40. package/CHANGELOG.md +0 -520
  41. package/FAQ.md +0 -175
  42. package/angular.json +0 -51
  43. package/docs/angular-universal.md +0 -60
  44. package/docs/configuration.md +0 -525
  45. package/docs/errors.md +0 -89
  46. package/docs/events.md +0 -262
  47. package/docs/initialization.md +0 -206
  48. package/docs/known-issues.md +0 -19
  49. package/docs/logging.md +0 -47
  50. package/docs/msal-guard.md +0 -208
  51. package/docs/msal-interceptor.md +0 -160
  52. package/docs/multi-tenant.md +0 -90
  53. package/docs/performance.md +0 -50
  54. package/docs/public-apis.md +0 -29
  55. package/docs/redirects.md +0 -214
  56. package/docs/security.md +0 -4
  57. package/docs/ssosilent.md +0 -84
  58. package/docs/v0-v1-upgrade-guide.md +0 -61
  59. package/docs/v1-v2-upgrade-guide.md +0 -70
  60. package/docs/v2-v3-upgrade-guide.md +0 -41
  61. package/karma.conf.js +0 -43
  62. package/ng-package.json +0 -7
  63. package/src/IMsalService.ts +0 -31
  64. package/src/constants.ts +0 -20
  65. package/src/msal.broadcast.config.ts +0 -8
  66. package/src/msal.broadcast.service.spec.ts +0 -456
  67. package/src/msal.broadcast.service.ts +0 -74
  68. package/src/msal.guard.config.ts +0 -27
  69. package/src/msal.guard.spec.ts +0 -525
  70. package/src/msal.guard.ts +0 -290
  71. package/src/msal.interceptor.config.ts +0 -44
  72. package/src/msal.interceptor.spec.ts +0 -1125
  73. package/src/msal.interceptor.ts +0 -390
  74. package/src/msal.module.ts +0 -51
  75. package/src/msal.navigation.client.spec.ts +0 -95
  76. package/src/msal.navigation.client.ts +0 -57
  77. package/src/msal.redirect.component.spec.ts +0 -63
  78. package/src/msal.redirect.component.ts +0 -26
  79. package/src/msal.service.spec.ts +0 -452
  80. package/src/msal.service.ts +0 -97
  81. package/src/packageMetadata.ts +0 -3
  82. package/src/test.ts +0 -19
  83. package/tsconfig.json +0 -25
  84. package/tsconfig.lib.json +0 -27
  85. package/tsconfig.lib.prod.json +0 -10
  86. package/tsconfig.spec.json +0 -17
@@ -0,0 +1,15 @@
1
+ import { EndSessionRequest, AuthorizationUrlRequest, AuthenticationResult, PopupRequest, RedirectRequest, SilentRequest, Logger } from '@azure/msal-browser';
2
+ import { Observable } from 'rxjs';
3
+ export interface IMsalService {
4
+ initialize(): Observable<void>;
5
+ acquireTokenPopup(request: PopupRequest): Observable<AuthenticationResult>;
6
+ acquireTokenRedirect(request: RedirectRequest): Observable<void>;
7
+ acquireTokenSilent(silentRequest: SilentRequest): Observable<AuthenticationResult>;
8
+ handleRedirectObservable(): Observable<AuthenticationResult | null>;
9
+ loginPopup(request?: PopupRequest): Observable<AuthenticationResult>;
10
+ loginRedirect(request?: RedirectRequest): Observable<void>;
11
+ logout(logoutRequest?: EndSessionRequest): Observable<void>;
12
+ ssoSilent(request: AuthorizationUrlRequest): Observable<AuthenticationResult>;
13
+ getLogger(): Logger;
14
+ setLogger(logger: Logger): void;
15
+ }
package/README.md CHANGED
@@ -1,158 +1,166 @@
1
- # Microsoft Authentication Library for Angular
2
-
3
- ![npm (scoped)](https://img.shields.io/npm/v/@azure/msal-angular)
4
- ![npm](https://img.shields.io/npm/dw/@azure/msal-angular)
5
- [![codecov](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js/branch/dev/graph/badge.svg?flag=msal-angular)](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)
6
-
7
- | <a href="https://docs.microsoft.com/azure/active-directory/develop/tutorial-v2-angular-auth-code" 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_angular.html" target="_blank">Library Reference</a> | [Support](README.md#community-help-and-support) | <a href="https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples" target="blank">Samples</a>
8
- | --- | --- | --- | --- | --- |
9
-
10
- 1. [About](#about)
11
- 1. [Guides](#guides)
12
- 1. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/FAQ.md)
13
- 1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/CHANGELOG.md)
14
- 1. [Version Support](#version-support)
15
- 1. [Prerequisites](#prerequisites)
16
- 1. [Installation](#installation)
17
- 1. [Usage](#usage)
18
- 1. [Samples](#samples)
19
- 1. [Build and running tests](#build-and-running-tests)
20
- 1. [Versioning](#versioning)
21
- 1. [Community Help and Support](#community-help-and-support)
22
- 1. [Contribute](#contribute)
23
- 1. [Security Reporting](#security-reporting)
24
- 1. [License](#license)
25
- 1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
26
-
27
- ## About
28
-
29
- MSAL for Angular enables Angular web 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).
30
-
31
- The `@azure/msal-angular` package described by the code in this folder wraps the [`@azure/msal-browser` package](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser) and uses it as a peer dependency to enable authentication in Angular Web 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 description provided by [@azure/msal-browser](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser#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 Angular v1 library](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/lib/msal-angular).
32
-
33
- The current `@azure/msal-angular` library improves upon the previous version and utilizes the authorization code flow. Most features available in the old library will be available in this one, but there are nuances to the authentication flow in both. The latest `@azure/msal-angular` package does NOT support the implicit flow.
34
-
35
- ## Guides
36
-
37
- - [Upgrade Guide (v2-v3)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/v2-v3-upgrade-guide.md)
38
- - [Upgrade Guide (v1-v2)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/v1-v2-upgrade-guide.md)
39
- - [Upgrade Guide (v0-v1)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/v0-v1-upgrade-guide.md)
40
- - [Configuration](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/configuration.md)
41
-
42
- ## Version Support
43
-
44
- At a minimum, `@azure/msal-angular` will follow the [support schedule of the main Angular project](https://angular.io/guide/releases#support-policy-and-schedule). We may continue to support certain versions of Angular that are not under Active or LTS support from the main Angular project on a version-by-version basis, as defined below.
45
-
46
- | MSAL Angular version | MSAL support status | Supported Angular versions |
47
- |----------------------|-------------------------|----------------------------|
48
- | MSAL Angular v3-alpha | Active development | 15, 16 |
49
- | MSAL Angular v2 | In maintenance | 9, 10, 11, 12, 13, 14 |
50
- | MSAL Angular v1 | In maintenance | 6, 7, 8, 9 |
51
- | MSAL Angular v0 | Out of support | 4, 5 |
52
-
53
- ## Prerequisites
54
-
55
- Before using `@azure/msal-angular`, [register an application in Azure AD](https://docs.microsoft.com/azure/active-directory/develop/quickstart-register-app) to get your `clientId`.
56
-
57
- ## Installation
58
-
59
- The `@azure/msal-angular` package is available on NPM:
60
- ```
61
- npm install @azure/msal-browser @azure/msal-angular@latest
62
- ```
63
-
64
- ## Usage
65
-
66
- MSAL Angular Basics
67
- 1. [Initialization](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/initialization.md)
68
- 1. [Public APIs](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/public-apis.md)
69
- 1. [Using redirects](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/redirects.md)
70
- 1. [Using the MsalGuard](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/msal-guard.md)
71
- 1. [Using the MsalInterceptor](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/msal-interceptor.md)
72
- 1. [Known issues](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/known-issues.md)
73
-
74
- Advanced Topics
75
- 1. [Logging](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/logging.md)
76
- 1. [Multi-Tenant](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/multi-tenant.md)
77
- 1. [Security](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/security.md)
78
- 1. [Events](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/events.md)
79
- 1. [Angular Universal and SSR](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/angular-universal.md)
80
- 1. [Performance](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/performance.md)
81
-
82
- Documentation specifically for MSAL Angular v2 can be found [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/lib/msal-angular/docs/v2-docs/).
83
- Documentation specifically for MSAL Angular v1 can be found [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/lib/msal-angular/docs/v1-docs/).
84
-
85
- ## Samples
86
-
87
- ### MSAL Angular v3 Samples
88
- * [Angular v15](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular15-sample-app)
89
- * [Angular v16](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular16-sample-app)
90
- * [Angular v16 B2C Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular-b2c-sample-app)
91
-
92
- ### MSAL Angular v2 Samples
93
- * [Angular v9](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular9-v2-sample-app)
94
- * [Angular v10](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular10-sample-app)
95
- * [Angular v11](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular11-sample-app)
96
- * [Angular v12](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular12-sample-app)
97
- * [Angular v13 RxJS v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular13-rxjs6-sample-app)
98
- * [Angular v13 RxJS v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular13-rxjs7-sample-app)
99
- * [Angular v14 RxJS v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular14-rxjs6-sample-app)
100
- * [Angular v14 RxJS v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular14-rxjs7-sample-app)
101
- * [Angular v14 B2C Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular-b2c-sample-app)
102
-
103
- See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/README.md) for specific features demonstrated by our MSAL Angular v2 samples.
104
-
105
- ### Advanced MSAL Angular v2 Samples
106
- * [Angular SPA with ASP.NET Core web API](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/3-Authorization-II/1-call-api)
107
- * [Angular SPA with APS.NET Core web API using App Roles and RBAC](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/5-AccessControl/1-call-api-roles)
108
- * [Angular SPA calling Microsoft Graph via ASP.NET Core web API using on-behalf-of flow](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/6-AdvancedScenarios/1-call-api-obo)
109
- * [Multi-tenant tutorial using MSAL Angular v2](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/6-AdvancedScenarios/2-call-api-mt)
110
- * [Deployment tutorial using Azure App Service and Azure Storage](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/4-Deployment)
111
-
112
- ### MSAL Angular v1 Samples
113
- * [Angular v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular6-sample-app)
114
- * [Angular v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular7-sample-app)
115
- * [Angular v8](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular8-sample-app)
116
- * [Angular v9](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular9-sample-app)
117
-
118
- ## Build and running tests
119
-
120
- If you want to build the library and run all the unit tests, you can do the following.
121
-
122
- First navigate to the root directory of the library(msal-angular) and install the dependencies:
123
-
124
- npm install
125
-
126
- Then use the following command to build the library and run all the unit tests:
127
-
128
- npm run build
129
-
130
- npm run test
131
-
132
- ## Versioning
133
-
134
- This library controls how users sign-in and access services. We recommend you always take the latest version of our library in your app when possible. We use [semantic versioning](http://semver.org) so you can control the risk associated with updating your app. As an example, always downloading the latest minor version number (e.g. x._y_.x) ensures you get the latest security and feature enhanements but our API surface remains the same. You can always see the latest version and release notes under the Releases tab of GitHub.
135
-
136
- ## Community Help and Support
137
-
138
- - [Msal Browser FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md) for access to our frequently asked questions
139
- - [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) using tag "msal".
140
- We highly recommend you ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
141
- - [GitHub Issues](https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/templates/edit) for reporting a bug or feature requests
142
- - [User Voice page](https://feedback.azure.com/forums/169401-azure-active-directory) to provide recommendations and/or feedback
143
-
144
- ## Contribute
145
-
146
- We enthusiastically welcome contributions and feedback. Please read the [contributing guide](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/contributing.md) before you begin.
147
-
148
- ## Security Reporting
149
-
150
- 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.
151
-
152
- ## License
153
-
154
- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License").
155
-
156
- ## We Value and Adhere to the Microsoft Open Source Code of Conduct
157
-
158
- 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 Angular
2
+
3
+ ![npm (scoped)](https://img.shields.io/npm/v/@azure/msal-angular)
4
+ ![npm](https://img.shields.io/npm/dw/@azure/msal-angular)
5
+ [![codecov](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js/branch/dev/graph/badge.svg?flag=msal-angular)](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)
6
+
7
+ | <a href="https://docs.microsoft.com/azure/active-directory/develop/tutorial-v2-angular-auth-code" 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_angular.html" target="_blank">Library Reference</a> | [Support](README.md#community-help-and-support) | <a href="https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples" target="blank">Samples</a> |
8
+ | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
9
+
10
+ 1. [About](#about)
11
+ 1. [Guides](#guides)
12
+ 1. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/FAQ.md)
13
+ 1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/CHANGELOG.md)
14
+ 1. [Version Support](#version-support)
15
+ 1. [Prerequisites](#prerequisites)
16
+ 1. [Installation](#installation)
17
+ 1. [Usage](#usage)
18
+ 1. [Samples](#samples)
19
+ 1. [Build and running tests](#build-and-running-tests)
20
+ 1. [Versioning](#versioning)
21
+ 1. [Community Help and Support](#community-help-and-support)
22
+ 1. [Contribute](#contribute)
23
+ 1. [Security Reporting](#security-reporting)
24
+ 1. [License](#license)
25
+ 1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
26
+
27
+ ## About
28
+
29
+ MSAL for Angular enables Angular web 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).
30
+
31
+ The `@azure/msal-angular` package described by the code in this folder wraps the [`@azure/msal-browser` package](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser) and uses it as a peer dependency to enable authentication in Angular Web 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 description provided by [@azure/msal-browser](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser#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 Angular v1 library](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/lib/msal-angular).
32
+
33
+ The current `@azure/msal-angular` library improves upon the previous version and utilizes the authorization code flow. Most features available in the old library will be available in this one, but there are nuances to the authentication flow in both. The latest `@azure/msal-angular` package does NOT support the implicit flow.
34
+
35
+ ## Guides
36
+
37
+ - [Upgrade Guide (v2-v3)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/v2-v3-upgrade-guide.md)
38
+ - [Upgrade Guide (v1-v2)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/v1-v2-upgrade-guide.md)
39
+ - [Upgrade Guide (v0-v1)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/v0-v1-upgrade-guide.md)
40
+ - [Configuration](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/configuration.md)
41
+
42
+ ## Version Support
43
+
44
+ At a minimum, `@azure/msal-angular` will follow the [support schedule of the main Angular project](https://angular.io/guide/releases#support-policy-and-schedule). We may continue to support certain versions of Angular that are not under Active or LTS support from the main Angular project on a version-by-version basis, as defined below.
45
+
46
+ | MSAL Angular version | MSAL support status | Supported Angular versions |
47
+ | -------------------- | ------------------- | -------------------------- |
48
+ | MSAL Angular v3 | Active development | 15, 16 |
49
+ | MSAL Angular v2 | In maintenance | 9, 10, 11, 12, 13, 14 |
50
+ | MSAL Angular v1 | In maintenance | 6, 7, 8, 9 |
51
+ | MSAL Angular v0 | Out of support | 4, 5 |
52
+
53
+ ## Prerequisites
54
+
55
+ Before using `@azure/msal-angular`, [register an application in Azure AD](https://docs.microsoft.com/azure/active-directory/develop/quickstart-register-app) to get your `clientId`.
56
+
57
+ ## Installation
58
+
59
+ The `@azure/msal-angular` package is available on NPM:
60
+
61
+ ```
62
+ npm install @azure/msal-browser @azure/msal-angular@latest
63
+ ```
64
+
65
+ ## Usage
66
+
67
+ MSAL Angular Basics
68
+
69
+ 1. [Initialization](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/initialization.md)
70
+ 1. [Public APIs](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/public-apis.md)
71
+ 1. [Using redirects](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/redirects.md)
72
+ 1. [Using the MsalGuard](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/msal-guard.md)
73
+ 1. [Using the MsalInterceptor](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/msal-interceptor.md)
74
+ 1. [Known issues](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/known-issues.md)
75
+
76
+ Advanced Topics
77
+
78
+ 1. [Logging](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/logging.md)
79
+ 1. [Multi-Tenant](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/multi-tenant.md)
80
+ 1. [Security](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/security.md)
81
+ 1. [Events](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/events.md)
82
+ 1. [Angular Universal and SSR](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/angular-universal.md)
83
+ 1. [Performance](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular/docs/performance.md)
84
+
85
+ Documentation specifically for MSAL Angular v2 can be found [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/lib/msal-angular/docs/v2-docs/).
86
+ Documentation specifically for MSAL Angular v1 can be found [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/lib/msal-angular/docs/v1-docs/).
87
+
88
+ ## Samples
89
+
90
+ ### MSAL Angular v3 Samples
91
+
92
+ - [Angular v15](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular15-sample-app)
93
+ - [Angular v16](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular16-sample-app)
94
+ - [Angular v16 B2C Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular-b2c-sample-app)
95
+ - [Angular Standalone Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-angular-v3-samples/angular-standalone-sample)
96
+
97
+ ### MSAL Angular v2 Samples
98
+
99
+ - [Angular v9](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular9-v2-sample-app)
100
+ - [Angular v10](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular10-sample-app)
101
+ - [Angular v11](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular11-sample-app)
102
+ - [Angular v12](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular12-sample-app)
103
+ - [Angular v13 RxJS v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular13-rxjs6-sample-app)
104
+ - [Angular v13 RxJS v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular13-rxjs7-sample-app)
105
+ - [Angular v14 RxJS v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular14-rxjs6-sample-app)
106
+ - [Angular v14 RxJS v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular14-rxjs7-sample-app)
107
+ - [Angular v14 B2C Sample](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/angular-b2c-sample-app)
108
+
109
+ See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-lts/samples/msal-angular-v2-samples/README.md) for specific features demonstrated by our MSAL Angular v2 samples.
110
+
111
+ ### Advanced MSAL Angular v2 Samples
112
+
113
+ - [Angular SPA with ASP.NET Core web API](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/3-Authorization-II/1-call-api)
114
+ - [Angular SPA with APS.NET Core web API using App Roles and RBAC](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/5-AccessControl/1-call-api-roles)
115
+ - [Angular SPA calling Microsoft Graph via ASP.NET Core web API using on-behalf-of flow](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/6-AdvancedScenarios/1-call-api-obo)
116
+ - [Multi-tenant tutorial using MSAL Angular v2](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/6-AdvancedScenarios/2-call-api-mt)
117
+ - [Deployment tutorial using Azure App Service and Azure Storage](https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/tree/main/4-Deployment)
118
+
119
+ ### MSAL Angular v1 Samples
120
+
121
+ - [Angular v6](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular6-sample-app)
122
+ - [Angular v7](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular7-sample-app)
123
+ - [Angular v8](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular8-sample-app)
124
+ - [Angular v9](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/msal-angular-v1/samples/msal-angular-samples/angular9-sample-app)
125
+
126
+ ## Build and running tests
127
+
128
+ If you want to build the library and run all the unit tests, you can do the following.
129
+
130
+ First navigate to the root directory of the library(msal-angular) and install the dependencies:
131
+
132
+ npm install
133
+
134
+ Then use the following command to build the library and run all the unit tests:
135
+
136
+ npm run build
137
+
138
+ npm run test
139
+
140
+ ## Versioning
141
+
142
+ This library controls how users sign-in and access services. We recommend you always take the latest version of our library in your app when possible. We use [semantic versioning](http://semver.org) so you can control the risk associated with updating your app. As an example, always downloading the latest minor version number (e.g. x._y_.x) ensures you get the latest security and feature enhanements but our API surface remains the same. You can always see the latest version and release notes under the Releases tab of GitHub.
143
+
144
+ ## Community Help and Support
145
+
146
+ - [Msal Browser FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/FAQ.md) for access to our frequently asked questions
147
+ - [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) using tag "msal".
148
+ We highly recommend you ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
149
+ - [GitHub Issues](https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/templates/edit) for reporting a bug or feature requests
150
+ - [User Voice page](https://feedback.azure.com/forums/169401-azure-active-directory) to provide recommendations and/or feedback
151
+
152
+ ## Contribute
153
+
154
+ We enthusiastically welcome contributions and feedback. Please read the [contributing guide](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/contributing.md) before you begin.
155
+
156
+ ## Security Reporting
157
+
158
+ 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.
159
+
160
+ ## License
161
+
162
+ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License").
163
+
164
+ ## We Value and Adhere to the Microsoft Open Source Code of Conduct
165
+
166
+ 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.
package/constants.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export declare const MSAL_INSTANCE: InjectionToken<string>;
3
+ export declare const MSAL_GUARD_CONFIG: InjectionToken<string>;
4
+ export declare const MSAL_INTERCEPTOR_CONFIG: InjectionToken<string>;
5
+ export declare const MSAL_BROADCAST_CONFIG: InjectionToken<string>;
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSU1zYWxTZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL0lNc2FsU2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0ciLCJzb3VyY2VzQ29udGVudCI6WyIvKlxyXG4gKiBDb3B5cmlnaHQgKGMpIE1pY3Jvc29mdCBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC5cclxuICogTGljZW5zZWQgdW5kZXIgdGhlIE1JVCBMaWNlbnNlLlxyXG4gKi9cclxuXHJcbmltcG9ydCB7XHJcbiAgRW5kU2Vzc2lvblJlcXVlc3QsXHJcbiAgQXV0aG9yaXphdGlvblVybFJlcXVlc3Q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c3Q6IEF1dGhvcml6YXRpb25VcmxSZXF1ZXN0KTogT2JzZXJ2YWJsZTxBdXRoZW50aWNhdGlvblJlc3VsdD47XHJcbiAgZ2V0TG9nZ2VyKCk6IExvZ2dlcjtcclxuICBzZXRMb2dnZXIobG9nZ2VyOiBMb2dnZXIpOiB2b2lkO1xyXG59XHJcbiJdfQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp1cmUtbXNhbC1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2F6dXJlLW1zYWwtYW5ndWxhci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { InjectionToken } from '@angular/core';
6
+ export const MSAL_INSTANCE = new InjectionToken('MSAL_INSTANCE');
7
+ export const MSAL_GUARD_CONFIG = new InjectionToken('MSAL_GUARD_CONFIG');
8
+ export const MSAL_INTERCEPTOR_CONFIG = new InjectionToken('MSAL_INTERCEPTOR_CONFIG');
9
+ export const MSAL_BROADCAST_CONFIG = new InjectionToken('MSAL_BROADCAST_CONFIG');
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Nv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JTlRFUkNFUFRPUl9DT05GSUcnXHJcbik7XHJcblxyXG5leHBvcnQgY29uc3QgTVNBTF9CUk9BRENBU1RfQ09ORklHID0gbmV3IEluamVjdGlvblRva2VuPHN0cmluZz4oXHJcbiAgJ01TQUxfQlJPQURDQVNUX0NPTkZJRydcclxuKTtcclxuIl19
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5icm9hZGNhc3QuY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL21zYWwuYnJvYWRjYXN0LmNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0ciLCJzb3VyY2VzQ29udGVudCI6WyIvKlxyXG4gKiBDb3B5cmlnaHQgKGMpIE1pY3Jvc29mdCBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC5cclxuICogTGljZW5zZWQgdW5kZXIgdGhlIE1JVCBMaWNlbnNlLlxyXG4gKi9cclxuXHJcbmV4cG9ydCB0eXBlIE1zYWxCcm9hZGNhc3RDb25maWd1cmF0aW9uID0ge1xyXG4gIGV2ZW50c1RvUmVwbGF5OiBudW1iZXI7XHJcbn07XHJcbiJdfQ==
@@ -0,0 +1,57 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { Inject, Injectable, Optional } from '@angular/core';
6
+ import { EventMessageUtils, InteractionStatus, } from '@azure/msal-browser';
7
+ import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';
8
+ import { MSAL_BROADCAST_CONFIG, MSAL_INSTANCE } from './constants';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "./msal.service";
11
+ export class MsalBroadcastService {
12
+ constructor(msalInstance, authService, msalBroadcastConfig) {
13
+ this.msalInstance = msalInstance;
14
+ this.authService = authService;
15
+ this.msalBroadcastConfig = msalBroadcastConfig;
16
+ // Make _msalSubject a ReplaySubject if configured to replay past events
17
+ if (this.msalBroadcastConfig &&
18
+ this.msalBroadcastConfig.eventsToReplay > 0) {
19
+ this.authService
20
+ .getLogger()
21
+ .verbose(`BroadcastService - eventsToReplay set on BroadcastConfig, replaying the last ${this.msalBroadcastConfig.eventsToReplay} events`);
22
+ this._msalSubject = new ReplaySubject(this.msalBroadcastConfig.eventsToReplay);
23
+ }
24
+ else {
25
+ // Defaults to _msalSubject being a Subject
26
+ this._msalSubject = new Subject();
27
+ }
28
+ this.msalSubject$ = this._msalSubject.asObservable();
29
+ // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription
30
+ this._inProgress = new BehaviorSubject(InteractionStatus.Startup);
31
+ this.inProgress$ = this._inProgress.asObservable();
32
+ this.msalInstance.addEventCallback((message) => {
33
+ this._msalSubject.next(message);
34
+ const status = EventMessageUtils.getInteractionStatusFromEvent(message, this._inProgress.value);
35
+ if (status !== null) {
36
+ this.authService
37
+ .getLogger()
38
+ .verbose(`BroadcastService - ${message.eventType} results in setting inProgress from ${this._inProgress.value} to ${status}`);
39
+ this._inProgress.next(status);
40
+ }
41
+ });
42
+ }
43
+ }
44
+ MsalBroadcastService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MsalBroadcastService, deps: [{ token: MSAL_INSTANCE }, { token: i1.MsalService }, { token: MSAL_BROADCAST_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
45
+ MsalBroadcastService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MsalBroadcastService });
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: MsalBroadcastService, decorators: [{
47
+ type: Injectable
48
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
49
+ type: Inject,
50
+ args: [MSAL_INSTANCE]
51
+ }] }, { type: i1.MsalService }, { type: undefined, decorators: [{
52
+ type: Optional
53
+ }, {
54
+ type: Inject,
55
+ args: [MSAL_BROADCAST_CONFIG]
56
+ }] }]; } });
57
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5icm9hZGNhc3Quc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tc2FsLmJyb2FkY2FzdC5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVILE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUM3RCxPQUFPLEVBRUwsaUJBQWlCLEVBRWpCLGlCQUFpQixHQUNsQixNQUFNLHFCQUFxQixDQUFDO0FBQzdCLE9BQU8sRUFBRSxlQUFlLEVBQWMsYUFBYSxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUczRSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsYUFBYSxFQUFFLE1BQU0sYUFBYSxDQUFDOzs7QUFHbkUsTUFBTSxPQUFPLG9CQUFvQjtJQU0vQixZQUNpQyxZQUFzQyxFQUM3RCxXQUF3QixFQUd4QixtQkFBZ0Q7UUFKekIsaUJBQVksR0FBWixZQUFZLENBQTBCO1FBQzdELGdCQUFXLEdBQVgsV0FBVyxDQUFhO1FBR3hCLHdCQUFtQixHQUFuQixtQkFBbUIsQ0FBNkI7UUFFeEQsd0VBQXdFO1FBQ3hFLElBQ0UsSUFBSSxDQUFDLG1CQUFtQjtZQUN4QixJQUFJLENBQUMsbUJBQW1CLENBQUMsY0FBYyxHQUFHLENBQUMsRUFDM0M7WUFDQSxJQUFJLENBQUMs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ZXNzLmFzT2JzZXJ2YWJsZSgpO1xyXG5cclxuICAgIHRoaXMubXNhbEluc3RhbmNlLmFkZEV2ZW50Q2FsbGJhY2soKG1lc3NhZ2U6IEV2ZW50TWVzc2FnZSkgPT4ge1xyXG4gICAgICB0aGlzLl9tc2FsU3ViamVjdC5uZXh0KG1lc3NhZ2UpO1xyXG4gICAgICBjb25zdCBzdGF0dXMgPSBFdmVudE1lc3NhZ2VVdGlscy5nZXRJbnRlcmFjdGlvblN0YXR1c0Zyb21FdmVudChcclxuICAgICAgICBtZXNzYWdlLFxyXG4gICAgICAgIHRoaXMuX2luUHJvZ3Jlc3MudmFsdWVcclxuICAgICAgKTtcclxuICAgICAgaWYgKHN0YXR1cyAhPT0gbnVsbCkge1xyXG4gICAgICAgIHRoaXMuYXV0aFNlcnZpY2VcclxuICAgICAgICAgIC5nZXRMb2dnZXIoKVxyXG4gICAgICAgICAgLnZlcmJvc2UoXHJcbiAgICAgICAgICAgIGBCcm9hZGNhc3RTZXJ2aWNlIC0gJHttZXNzYWdlLmV2ZW50VHlwZX0gcmVzdWx0cyBpbiBzZXR0aW5nIGluUHJvZ3Jlc3MgZnJvbSAke3RoaXMuX2luUHJvZ3Jlc3MudmFsdWV9IHRvICR7c3RhdHVzfWBcclxuICAgICAgICAgICk7XHJcbiAgICAgICAgdGhpcy5faW5Qcm9ncmVzcy5uZXh0KHN0YXR1cyk7XHJcbiAgICAgIH1cclxuICAgIH0pO1xyXG4gIH1cclxufVxyXG4iXX0=
@@ -0,0 +1,6 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXNhbC5ndWFyZC5jb25maWcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbXNhbC5ndWFyZC5jb25maWcudHMiXSwibmFtZXMiOltdLCJtY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