@azure/msal-common 5.0.1 → 6.1.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 +1319 -1187
- package/CHANGELOG.md +504 -452
- package/LICENSE +21 -21
- package/README.md +62 -62
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/account/AuthToken.js +1 -1
- package/dist/account/AuthToken.js.map +1 -1
- package/dist/account/CcsCredential.js +1 -1
- package/dist/account/CcsCredential.js.map +1 -1
- package/dist/account/ClientInfo.js +1 -1
- package/dist/account/ClientInfo.js.map +1 -1
- package/dist/account/TokenClaims.d.ts +1 -0
- package/dist/account/TokenClaims.d.ts.map +1 -1
- package/dist/authority/Authority.d.ts +9 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +43 -12
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +2 -2
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.js +5 -5
- package/dist/authority/AuthorityFactory.js.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +7 -0
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.js +22 -0
- package/dist/authority/AuthorityOptions.js.map +1 -0
- package/dist/authority/AuthorityType.js +1 -1
- package/dist/authority/AuthorityType.js.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
- package/dist/authority/ImdsOptions.d.ts +7 -0
- package/dist/authority/ImdsOptions.d.ts.map +1 -0
- package/dist/authority/OpenIdConfigResponse.d.ts +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.js +1 -2
- package/dist/authority/OpenIdConfigResponse.js.map +1 -1
- package/dist/authority/ProtocolMode.js +1 -1
- package/dist/authority/ProtocolMode.js.map +1 -1
- package/dist/authority/RegionDiscovery.d.ts +3 -6
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.js +19 -11
- package/dist/authority/RegionDiscovery.js.map +1 -1
- package/dist/cache/CacheManager.d.ts +15 -5
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +49 -18
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +3 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +23 -10
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
- package/dist/cache/entities/AccountEntity.js +1 -1
- package/dist/cache/entities/AccountEntity.js.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +1 -1
- package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +1 -2
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
- package/dist/cache/entities/CacheRecord.js +1 -1
- package/dist/cache/entities/CacheRecord.js.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +13 -2
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.js +25 -10
- package/dist/cache/entities/CredentialEntity.js.map +1 -1
- package/dist/cache/entities/IdTokenEntity.js +1 -1
- package/dist/cache/entities/IdTokenEntity.js.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
- package/dist/cache/entities/ThrottlingEntity.js +1 -1
- package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +1 -1
- package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +2 -0
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +1 -0
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +49 -10
- package/dist/client/AuthorizationCodeClient.js.map +1 -1
- package/dist/client/BaseClient.js +2 -2
- package/dist/client/BaseClient.js.map +1 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.js +4 -2
- package/dist/client/ClientCredentialClient.js.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.js +9 -4
- package/dist/client/DeviceCodeClient.js.map +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.js +4 -2
- package/dist/client/OnBehalfOfClient.js.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.js +20 -8
- package/dist/client/RefreshTokenClient.js.map +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.js +14 -18
- package/dist/client/SilentFlowClient.js.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.js +4 -2
- package/dist/client/UsernamePasswordClient.js.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +13 -0
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +9 -3
- package/dist/config/ClientConfiguration.js.map +1 -1
- package/dist/crypto/ICrypto.d.ts +6 -1
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.js +10 -1
- package/dist/crypto/ICrypto.js.map +1 -1
- package/dist/crypto/PopTokenGenerator.js +4 -4
- package/dist/crypto/PopTokenGenerator.js.map +1 -1
- package/dist/error/AuthError.js +1 -1
- package/dist/error/AuthError.js.map +1 -1
- package/dist/error/ClientAuthError.d.ts +8 -0
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.js +11 -1
- package/dist/error/ClientAuthError.js.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +40 -0
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.js +53 -3
- package/dist/error/ClientConfigurationError.js.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +1 -1
- package/dist/error/InteractionRequiredAuthError.js.map +1 -1
- package/dist/error/ServerError.js +1 -1
- package/dist/error/ServerError.js.map +1 -1
- package/dist/index.cjs.js +445 -115
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/logger/Logger.js +1 -1
- package/dist/logger/Logger.js.map +1 -1
- package/dist/network/INetworkModule.d.ts +1 -0
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.js +1 -1
- package/dist/network/INetworkModule.js.map +1 -1
- package/dist/network/NetworkManager.js +1 -1
- package/dist/network/NetworkManager.js.map +1 -1
- package/dist/network/RequestThumbprint.d.ts +2 -0
- package/dist/network/RequestThumbprint.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.js +4 -2
- package/dist/network/ThrottlingUtils.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts +20 -0
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
- package/dist/request/AuthenticationHeaderParser.js +64 -0
- package/dist/request/AuthenticationHeaderParser.js.map +1 -0
- package/dist/request/BaseAuthRequest.d.ts +14 -3
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +3 -0
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +2 -0
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +8 -0
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.js +16 -1
- package/dist/request/RequestParameterBuilder.js.map +1 -1
- package/dist/request/RequestValidator.js +1 -1
- package/dist/request/RequestValidator.js.map +1 -1
- package/dist/request/ScopeSet.js +1 -1
- package/dist/request/ScopeSet.js.map +1 -1
- package/dist/response/AuthenticationResult.d.ts +2 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.js +11 -8
- package/dist/response/ResponseHandler.js.map +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +3 -0
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
- package/dist/url/UrlString.js +1 -1
- package/dist/url/UrlString.js.map +1 -1
- package/dist/utils/Constants.d.ts +9 -3
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +8 -2
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/ProtocolUtils.js +1 -1
- package/dist/utils/ProtocolUtils.js.map +1 -1
- package/dist/utils/StringUtils.js +1 -1
- package/dist/utils/StringUtils.js.map +1 -1
- package/dist/utils/TimeUtils.js +1 -1
- package/dist/utils/TimeUtils.js.map +1 -1
- package/package.json +76 -76
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
package/README.md
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
# Microsoft Authentication Library for JavaScript (MSAL.js) Common Protocols Package
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@azure/msal-common/)
|
|
4
|
-
[](https://nodei.co/npm/@azure/msal-common/)
|
|
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_common.html" target="_blank">Library Reference</a> |
|
|
8
|
-
| --- | --- | --- |
|
|
9
|
-
|
|
10
|
-
1. [About](#about)
|
|
11
|
-
2. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md)
|
|
12
|
-
1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/CHANGELOG.md)
|
|
13
|
-
1. [Releases](#releases)
|
|
14
|
-
1. [Prerequisites and Usage](#prerequisites-and-usage)
|
|
15
|
-
1. [Installation](#installation)
|
|
16
|
-
1. [Security Reporting](#security-reporting)
|
|
17
|
-
1. [License](#license)
|
|
18
|
-
1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
|
|
19
|
-
|
|
20
|
-
## About
|
|
21
|
-
|
|
22
|
-
The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using [Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).
|
|
23
|
-
|
|
24
|
-
The `@azure/msal-common` package described by the code in this folder serves as a common package dependency for the `@azure/msal-browser` package (and in the future, the msal-node package). Be aware that this is an internal library, and is subject to frequent change. **It is not meant for production consumption by itself.**
|
|
25
|
-
|
|
26
|
-
## FAQ
|
|
27
|
-
|
|
28
|
-
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md).
|
|
29
|
-
|
|
30
|
-
## Releases
|
|
31
|
-
|
|
32
|
-
*Expect us to detail our major and minor releases moving forward, while leaving out our patch releases. Patch release notes can be found in our change log.*
|
|
33
|
-
|
|
34
|
-
| Date | Release | Announcement | Main features |
|
|
35
|
-
| ------| ------- | ---------| --------- |
|
|
36
|
-
| August 4, 2020 | @azure/msal-common v1.1.0 | [Release Notes](https://https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.1.0)
|
|
37
|
-
| July 20, 2020 | @azure/msal-common v1.0.0 | [Release Notes](https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.0.0) | Full release version of the `@azure/msal-common` |
|
|
38
|
-
| May 11, 2020 | @azure/msal-common v1.0.0-beta | Beta version of the `@azure/msal-common` package |
|
|
39
|
-
| January 17, 2020 | @azure/msal-common v1.0.0-alpha | No release notes yet | Alpha version of the `@azure/msal-common` package with authorization code flow for SPAs working in dev. |
|
|
40
|
-
|
|
41
|
-
## Prerequisites and Usage
|
|
42
|
-
This library is not meant for production use. Please use one of these packages specific to the platform you are developing for:
|
|
43
|
-
|
|
44
|
-
- [MSAL for Single Page Applications (SPAs)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser)
|
|
45
|
-
- [MSAL for Node.js](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node)
|
|
46
|
-
|
|
47
|
-
## Installation
|
|
48
|
-
### Via NPM:
|
|
49
|
-
|
|
50
|
-
npm install @azure/msal-common
|
|
51
|
-
|
|
52
|
-
## Security Reporting
|
|
53
|
-
|
|
54
|
-
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/en-us/security/dd252948) and subscribing to Security Advisory Alerts.
|
|
55
|
-
|
|
56
|
-
## License
|
|
57
|
-
|
|
58
|
-
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
|
|
59
|
-
|
|
60
|
-
## We Value and Adhere to the Microsoft Open Source Code of Conduct
|
|
61
|
-
|
|
62
|
-
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) Common Protocols Package
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@azure/msal-common/)
|
|
4
|
+
[](https://nodei.co/npm/@azure/msal-common/)
|
|
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_common.html" target="_blank">Library Reference</a> |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
|
|
10
|
+
1. [About](#about)
|
|
11
|
+
2. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md)
|
|
12
|
+
1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/CHANGELOG.md)
|
|
13
|
+
1. [Releases](#releases)
|
|
14
|
+
1. [Prerequisites and Usage](#prerequisites-and-usage)
|
|
15
|
+
1. [Installation](#installation)
|
|
16
|
+
1. [Security Reporting](#security-reporting)
|
|
17
|
+
1. [License](#license)
|
|
18
|
+
1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
|
|
19
|
+
|
|
20
|
+
## About
|
|
21
|
+
|
|
22
|
+
The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using [Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).
|
|
23
|
+
|
|
24
|
+
The `@azure/msal-common` package described by the code in this folder serves as a common package dependency for the `@azure/msal-browser` package (and in the future, the msal-node package). Be aware that this is an internal library, and is subject to frequent change. **It is not meant for production consumption by itself.**
|
|
25
|
+
|
|
26
|
+
## FAQ
|
|
27
|
+
|
|
28
|
+
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md).
|
|
29
|
+
|
|
30
|
+
## Releases
|
|
31
|
+
|
|
32
|
+
*Expect us to detail our major and minor releases moving forward, while leaving out our patch releases. Patch release notes can be found in our change log.*
|
|
33
|
+
|
|
34
|
+
| Date | Release | Announcement | Main features |
|
|
35
|
+
| ------| ------- | ---------| --------- |
|
|
36
|
+
| August 4, 2020 | @azure/msal-common v1.1.0 | [Release Notes](https://https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.1.0)
|
|
37
|
+
| July 20, 2020 | @azure/msal-common v1.0.0 | [Release Notes](https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.0.0) | Full release version of the `@azure/msal-common` |
|
|
38
|
+
| May 11, 2020 | @azure/msal-common v1.0.0-beta | Beta version of the `@azure/msal-common` package |
|
|
39
|
+
| January 17, 2020 | @azure/msal-common v1.0.0-alpha | No release notes yet | Alpha version of the `@azure/msal-common` package with authorization code flow for SPAs working in dev. |
|
|
40
|
+
|
|
41
|
+
## Prerequisites and Usage
|
|
42
|
+
This library is not meant for production use. Please use one of these packages specific to the platform you are developing for:
|
|
43
|
+
|
|
44
|
+
- [MSAL for Single Page Applications (SPAs)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser)
|
|
45
|
+
- [MSAL for Node.js](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node)
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
### Via NPM:
|
|
49
|
+
|
|
50
|
+
npm install @azure/msal-common
|
|
51
|
+
|
|
52
|
+
## Security Reporting
|
|
53
|
+
|
|
54
|
+
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/en-us/security/dd252948) and subscribing to Security Advisory Alerts.
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
|
|
59
|
+
|
|
60
|
+
## We Value and Adhere to the Microsoft Open Source Code of Conduct
|
|
61
|
+
|
|
62
|
+
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/dist/_virtual/_tslib.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthToken.js","sources":["../../src/account/AuthToken.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"AuthToken.js","sources":["../../src/account/AuthToken.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TokenClaims } from \"./TokenClaims\";\nimport { DecodedAuthToken } from \"./DecodedAuthToken\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ICrypto } from \"../crypto/ICrypto\";\n\n/**\n * JWT Token representation class. Parses token string and generates claims object.\n */\nexport class AuthToken {\n\n // Raw Token string\n rawToken: string;\n // Claims inside token\n claims: TokenClaims;\n constructor(rawToken: string, crypto: ICrypto) {\n if (StringUtils.isEmpty(rawToken)) {\n throw ClientAuthError.createTokenNullOrEmptyError(rawToken);\n }\n\n this.rawToken = rawToken;\n this.claims = AuthToken.extractTokenClaims(rawToken, crypto);\n }\n\n /**\n * Extract token by decoding the rawToken\n *\n * @param encodedToken\n */\n static extractTokenClaims(encodedToken: string, crypto: ICrypto): TokenClaims {\n\n const decodedToken: DecodedAuthToken = StringUtils.decodeAuthToken(encodedToken);\n\n // token will be decoded to get the username\n try {\n const base64TokenPayload = decodedToken.JWSPayload;\n\n // base64Decode() should throw an error if there is an issue\n const base64Decoded = crypto.base64Decode(base64TokenPayload);\n return JSON.parse(base64Decoded) as TokenClaims;\n } catch (err) {\n throw ClientAuthError.createTokenParsingError(err);\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAWA;;;;IASI,mBAAY,QAAgB,EAAE,MAAe;QACzC,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC/B,MAAM,eAAe,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;SAC/D;QAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KAChE;;;;;;IAOM,4BAAkB,GAAzB,UAA0B,YAAoB,EAAE,MAAe;QAE3D,IAAM,YAAY,GAAqB,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;;QAGjF,IAAI;YACA,IAAM,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC;;YAGnD,IAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAgB,CAAC;SACnD;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,eAAe,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;SACtD;KACJ;IACL,gBAAC;AAAD,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CcsCredential.js","sources":["../../src/account/CcsCredential.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"CcsCredential.js","sources":["../../src/account/CcsCredential.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type CcsCredential = {\n credential: string,\n type: CcsCredentialType\n};\n\nexport enum CcsCredentialType {\n HOME_ACCOUNT_ID = \"home_account_id\",\n UPN = \"UPN\"\n}\n"],"names":[],"mappings":";;AAAA;;;;IAUY;AAAZ,WAAY,iBAAiB;IACzB,wDAAmC,CAAA;IACnC,gCAAW,CAAA;AACf,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientInfo.js","sources":["../../src/account/ClientInfo.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"ClientInfo.js","sources":["../../src/account/ClientInfo.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { Separators, Constants } from \"../utils/Constants\";\n\n/**\n * Client info object which consists of two IDs. Need to add more info here.\n */\nexport type ClientInfo = {\n uid: string,\n utid: string\n};\n\n/**\n * Function to build a client info object from server clientInfo string\n * @param rawClientInfo\n * @param crypto\n */\nexport function buildClientInfo(rawClientInfo: string, crypto: ICrypto): ClientInfo {\n if (StringUtils.isEmpty(rawClientInfo)) {\n throw ClientAuthError.createClientInfoEmptyError();\n }\n\n try {\n const decodedClientInfo: string = crypto.base64Decode(rawClientInfo);\n return JSON.parse(decodedClientInfo) as ClientInfo;\n } catch (e) {\n throw ClientAuthError.createClientInfoDecodingError(e);\n }\n}\n\n/**\n * Function to build a client info object from cached homeAccountId string\n * @param homeAccountId \n */\nexport function buildClientInfoFromHomeAccountId(homeAccountId: string): ClientInfo {\n if (StringUtils.isEmpty(homeAccountId)) {\n throw ClientAuthError.createClientInfoDecodingError(\"Home account ID was empty.\");\n }\n const clientInfoParts: string[] = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);\n return {\n uid: clientInfoParts[0],\n utid: clientInfoParts.length < 2 ? Constants.EMPTY_STRING : clientInfoParts[1]\n };\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAkBA;;;;;SAKgB,eAAe,CAAC,aAAqB,EAAE,MAAe;IAClE,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,MAAM,eAAe,CAAC,0BAA0B,EAAE,CAAC;KACtD;IAED,IAAI;QACA,IAAM,iBAAiB,GAAW,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAe,CAAC;KACtD;IAAC,OAAO,CAAC,EAAE;QACR,MAAM,eAAe,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC;KAC1D;AACL,CAAC;AAED;;;;SAIgB,gCAAgC,CAAC,aAAqB;IAClE,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,MAAM,eAAe,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,CAAC;KACrF;IACD,IAAM,eAAe,GAAa,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;IAC3F,OAAO;QACH,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC;KACjF,CAAC;AACN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenClaims.d.ts","sourceRoot":"","sources":["../../src/account/TokenClaims.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,oBAAY,WAAW,GAAG;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,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CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,GAAG,CAAC,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAC"}
|
|
@@ -7,6 +7,7 @@ import { ICacheManager } from "../cache/interface/ICacheManager";
|
|
|
7
7
|
import { AuthorityOptions } from "./AuthorityOptions";
|
|
8
8
|
import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
|
|
9
9
|
import { RegionDiscoveryMetadata } from "./RegionDiscoveryMetadata";
|
|
10
|
+
import { AzureCloudOptions } from "../config/ClientConfiguration";
|
|
10
11
|
/**
|
|
11
12
|
* The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
|
|
12
13
|
* endpoint. It will store the pertinent config data in this object for use during token calls.
|
|
@@ -20,7 +21,8 @@ export declare class Authority {
|
|
|
20
21
|
private metadata;
|
|
21
22
|
private regionDiscovery;
|
|
22
23
|
regionDiscoveryMetadata: RegionDiscoveryMetadata;
|
|
23
|
-
|
|
24
|
+
private proxyUrl;
|
|
25
|
+
constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string);
|
|
24
26
|
get authorityType(): AuthorityType;
|
|
25
27
|
/**
|
|
26
28
|
* ProtocolMode enum representing the way endpoints are constructed.
|
|
@@ -128,6 +130,12 @@ export declare class Authority {
|
|
|
128
130
|
* Helper function to determine if this host is included in the knownAuthorities config option
|
|
129
131
|
*/
|
|
130
132
|
private isInKnownAuthorities;
|
|
133
|
+
/**
|
|
134
|
+
* helper function to populate the authority based on azureCloudOptions
|
|
135
|
+
* @param authorityString
|
|
136
|
+
* @param azureCloudOptions
|
|
137
|
+
*/
|
|
138
|
+
static generateAuthority(authorityString: string, azureCloudOptions?: AzureCloudOptions): string;
|
|
131
139
|
/**
|
|
132
140
|
* Creates cloud discovery metadata object from a given host
|
|
133
141
|
* @param host
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authority.d.ts","sourceRoot":"","sources":["../../src/authority/Authority.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAA0B,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Authority.d.ts","sourceRoot":"","sources":["../../src/authority/Authority.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAA0B,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAA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1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v6.1.0 2022-02-08 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AuthorityType } from './AuthorityType.js';
|
|
@@ -9,6 +9,7 @@ import { Constants, AuthorityMetadataSource, RegionDiscoveryOutcomes } from '../
|
|
|
9
9
|
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
10
10
|
import { ProtocolMode } from './ProtocolMode.js';
|
|
11
11
|
import { AuthorityMetadataEntity } from '../cache/entities/AuthorityMetadataEntity.js';
|
|
12
|
+
import { AzureCloudInstance } from './AuthorityOptions.js';
|
|
12
13
|
import { isCloudInstanceDiscoveryResponse } from './CloudInstanceDiscoveryResponse.js';
|
|
13
14
|
import { RegionDiscovery } from './RegionDiscovery.js';
|
|
14
15
|
|
|
@@ -21,7 +22,7 @@ import { RegionDiscovery } from './RegionDiscovery.js';
|
|
|
21
22
|
* endpoint. It will store the pertinent config data in this object for use during token calls.
|
|
22
23
|
*/
|
|
23
24
|
var Authority = /** @class */ (function () {
|
|
24
|
-
function Authority(authority, networkInterface, cacheManager, authorityOptions) {
|
|
25
|
+
function Authority(authority, networkInterface, cacheManager, authorityOptions, proxyUrl) {
|
|
25
26
|
this.canonicalAuthority = authority;
|
|
26
27
|
this._canonicalAuthority.validateAsUri();
|
|
27
28
|
this.networkInterface = networkInterface;
|
|
@@ -29,6 +30,7 @@ var Authority = /** @class */ (function () {
|
|
|
29
30
|
this.authorityOptions = authorityOptions;
|
|
30
31
|
this.regionDiscovery = new RegionDiscovery(networkInterface);
|
|
31
32
|
this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };
|
|
33
|
+
this.proxyUrl = proxyUrl || Constants.EMPTY_STRING;
|
|
32
34
|
}
|
|
33
35
|
Object.defineProperty(Authority.prototype, "authorityType", {
|
|
34
36
|
// See above for AuthorityType
|
|
@@ -164,6 +166,10 @@ var Authority = /** @class */ (function () {
|
|
|
164
166
|
*/
|
|
165
167
|
get: function () {
|
|
166
168
|
if (this.discoveryComplete()) {
|
|
169
|
+
// ROPC policies may not have end_session_endpoint set
|
|
170
|
+
if (!this.metadata.end_session_endpoint) {
|
|
171
|
+
throw ClientAuthError.createLogoutNotSupportedError();
|
|
172
|
+
}
|
|
167
173
|
var endpoint = this.replacePath(this.metadata.end_session_endpoint);
|
|
168
174
|
return this.replaceTenant(endpoint);
|
|
169
175
|
}
|
|
@@ -293,7 +299,7 @@ var Authority = /** @class */ (function () {
|
|
|
293
299
|
metadata = _b.sent();
|
|
294
300
|
if (!metadata) return [3 /*break*/, 4];
|
|
295
301
|
if (!((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.azureRegion)) return [3 /*break*/, 3];
|
|
296
|
-
return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata)];
|
|
302
|
+
return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata, this.proxyUrl)];
|
|
297
303
|
case 2:
|
|
298
304
|
autodetectedRegionName = _b.sent();
|
|
299
305
|
azureRegion = this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
|
|
@@ -356,19 +362,25 @@ var Authority = /** @class */ (function () {
|
|
|
356
362
|
*/
|
|
357
363
|
Authority.prototype.getEndpointMetadataFromNetwork = function () {
|
|
358
364
|
return __awaiter(this, void 0, void 0, function () {
|
|
359
|
-
var response;
|
|
365
|
+
var options, response;
|
|
360
366
|
return __generator(this, function (_a) {
|
|
361
367
|
switch (_a.label) {
|
|
362
368
|
case 0:
|
|
363
|
-
|
|
364
|
-
|
|
369
|
+
options = {};
|
|
370
|
+
if (this.proxyUrl) {
|
|
371
|
+
options.proxyUrl = this.proxyUrl;
|
|
372
|
+
}
|
|
373
|
+
_a.label = 1;
|
|
365
374
|
case 1:
|
|
375
|
+
_a.trys.push([1, 3, , 4]);
|
|
376
|
+
return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options)];
|
|
377
|
+
case 2:
|
|
366
378
|
response = _a.sent();
|
|
367
379
|
return [2 /*return*/, isOpenIdConfigResponse(response.body) ? response.body : null];
|
|
368
|
-
case
|
|
380
|
+
case 3:
|
|
369
381
|
_a.sent();
|
|
370
382
|
return [2 /*return*/, null];
|
|
371
|
-
case
|
|
383
|
+
case 4: return [2 /*return*/];
|
|
372
384
|
}
|
|
373
385
|
});
|
|
374
386
|
});
|
|
@@ -438,16 +450,20 @@ var Authority = /** @class */ (function () {
|
|
|
438
450
|
*/
|
|
439
451
|
Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
|
|
440
452
|
return __awaiter(this, void 0, void 0, function () {
|
|
441
|
-
var instanceDiscoveryEndpoint, match, response, metadata;
|
|
453
|
+
var instanceDiscoveryEndpoint, options, match, response, metadata;
|
|
442
454
|
return __generator(this, function (_a) {
|
|
443
455
|
switch (_a.label) {
|
|
444
456
|
case 0:
|
|
445
457
|
instanceDiscoveryEndpoint = "" + Constants.AAD_INSTANCE_DISCOVERY_ENDPT + this.canonicalAuthority + "oauth2/v2.0/authorize";
|
|
458
|
+
options = {};
|
|
459
|
+
if (this.proxyUrl) {
|
|
460
|
+
options.proxyUrl = this.proxyUrl;
|
|
461
|
+
}
|
|
446
462
|
match = null;
|
|
447
463
|
_a.label = 1;
|
|
448
464
|
case 1:
|
|
449
465
|
_a.trys.push([1, 3, , 4]);
|
|
450
|
-
return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint)];
|
|
466
|
+
return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
|
|
451
467
|
case 2:
|
|
452
468
|
response = _a.sent();
|
|
453
469
|
metadata = isCloudInstanceDiscoveryResponse(response.body) ? response.body.metadata : [];
|
|
@@ -462,7 +478,7 @@ var Authority = /** @class */ (function () {
|
|
|
462
478
|
return [2 /*return*/, null];
|
|
463
479
|
case 4:
|
|
464
480
|
if (!match) {
|
|
465
|
-
// Custom Domain scenario, host is trusted because Instance Discovery call succeeded
|
|
481
|
+
// Custom Domain scenario, host is trusted because Instance Discovery call succeeded
|
|
466
482
|
match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
|
|
467
483
|
}
|
|
468
484
|
return [2 /*return*/, match];
|
|
@@ -480,6 +496,19 @@ var Authority = /** @class */ (function () {
|
|
|
480
496
|
});
|
|
481
497
|
return matches.length > 0;
|
|
482
498
|
};
|
|
499
|
+
/**
|
|
500
|
+
* helper function to populate the authority based on azureCloudOptions
|
|
501
|
+
* @param authorityString
|
|
502
|
+
* @param azureCloudOptions
|
|
503
|
+
*/
|
|
504
|
+
Authority.generateAuthority = function (authorityString, azureCloudOptions) {
|
|
505
|
+
var authorityAzureCloudInstance;
|
|
506
|
+
if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {
|
|
507
|
+
var tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;
|
|
508
|
+
authorityAzureCloudInstance = azureCloudOptions.azureCloudInstance + "/" + tenant + "/";
|
|
509
|
+
}
|
|
510
|
+
return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;
|
|
511
|
+
};
|
|
483
512
|
/**
|
|
484
513
|
* Creates cloud discovery metadata object from a given host
|
|
485
514
|
* @param host
|
|
@@ -564,7 +593,9 @@ var Authority = /** @class */ (function () {
|
|
|
564
593
|
metadata.authorization_endpoint = Authority.buildRegionalAuthorityString(metadata.authorization_endpoint, azureRegion);
|
|
565
594
|
// TODO: Enquire on whether we should leave the query string or remove it before releasing the feature
|
|
566
595
|
metadata.token_endpoint = Authority.buildRegionalAuthorityString(metadata.token_endpoint, azureRegion, "allowestsrnonmsi=true");
|
|
567
|
-
|
|
596
|
+
if (metadata.end_session_endpoint) {
|
|
597
|
+
metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_endpoint, azureRegion);
|
|
598
|
+
}
|
|
568
599
|
return metadata;
|
|
569
600
|
};
|
|
570
601
|
return Authority;
|