@azure/msal-common 14.6.0-alpha.0 → 14.6.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 (212) hide show
  1. package/dist/account/AccountInfo.d.ts +58 -58
  2. package/dist/account/AccountInfo.mjs +59 -59
  3. package/dist/account/AuthToken.d.ts +17 -17
  4. package/dist/account/AuthToken.mjs +58 -58
  5. package/dist/account/CcsCredential.d.ts +9 -9
  6. package/dist/account/CcsCredential.mjs +8 -8
  7. package/dist/account/ClientCredentials.d.ts +14 -14
  8. package/dist/account/ClientInfo.d.ts +18 -18
  9. package/dist/account/ClientInfo.mjs +37 -37
  10. package/dist/account/TokenClaims.d.ts +83 -83
  11. package/dist/account/TokenClaims.mjs +20 -20
  12. package/dist/authority/Authority.d.ts +253 -254
  13. package/dist/authority/Authority.d.ts.map +1 -1
  14. package/dist/authority/Authority.mjs +831 -816
  15. package/dist/authority/Authority.mjs.map +1 -1
  16. package/dist/authority/AuthorityFactory.d.ts +18 -31
  17. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  18. package/dist/authority/AuthorityFactory.mjs +29 -50
  19. package/dist/authority/AuthorityFactory.mjs.map +1 -1
  20. package/dist/authority/AuthorityMetadata.d.ts +43 -503
  21. package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
  22. package/dist/authority/AuthorityMetadata.mjs +137 -603
  23. package/dist/authority/AuthorityMetadata.mjs.map +1 -1
  24. package/dist/authority/AuthorityOptions.d.ts +27 -27
  25. package/dist/authority/AuthorityOptions.mjs +18 -18
  26. package/dist/authority/AuthorityType.d.ts +10 -10
  27. package/dist/authority/AuthorityType.mjs +13 -13
  28. package/dist/authority/AzureRegion.d.ts +1 -1
  29. package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
  30. package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
  31. package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
  32. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +8 -8
  33. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
  34. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +8 -8
  35. package/dist/authority/ImdsOptions.d.ts +5 -5
  36. package/dist/authority/OIDCOptions.d.ts +8 -8
  37. package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
  38. package/dist/authority/OpenIdConfigResponse.mjs +10 -10
  39. package/dist/authority/ProtocolMode.d.ts +8 -8
  40. package/dist/authority/ProtocolMode.mjs +11 -11
  41. package/dist/authority/RegionDiscovery.d.ts +32 -32
  42. package/dist/authority/RegionDiscovery.mjs +106 -106
  43. package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
  44. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
  45. package/dist/cache/CacheManager.d.ts +508 -508
  46. package/dist/cache/CacheManager.mjs +1237 -1237
  47. package/dist/cache/entities/AccessTokenEntity.d.ts +25 -25
  48. package/dist/cache/entities/AccountEntity.d.ts +106 -106
  49. package/dist/cache/entities/AccountEntity.mjs +244 -244
  50. package/dist/cache/entities/AppMetadataEntity.d.ts +11 -39
  51. package/dist/cache/entities/AppMetadataEntity.d.ts.map +1 -1
  52. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +15 -48
  53. package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
  54. package/dist/cache/entities/CacheRecord.d.ts +14 -14
  55. package/dist/cache/entities/CacheRecord.mjs +14 -14
  56. package/dist/cache/entities/CredentialEntity.d.ts +30 -30
  57. package/dist/cache/entities/IdTokenEntity.d.ts +8 -8
  58. package/dist/cache/entities/RefreshTokenEntity.d.ts +7 -7
  59. package/dist/cache/entities/ServerTelemetryEntity.d.ts +5 -5
  60. package/dist/cache/entities/ThrottlingEntity.d.ts +7 -7
  61. package/dist/cache/interface/ICacheManager.d.ts +166 -166
  62. package/dist/cache/interface/ICachePlugin.d.ts +5 -5
  63. package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
  64. package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
  65. package/dist/cache/persistence/TokenCacheContext.mjs +25 -25
  66. package/dist/cache/utils/CacheHelpers.d.ts +94 -70
  67. package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
  68. package/dist/cache/utils/CacheHelpers.mjs +326 -252
  69. package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
  70. package/dist/cache/utils/CacheTypes.d.ts +69 -69
  71. package/dist/client/AuthorizationCodeClient.d.ts +74 -74
  72. package/dist/client/AuthorizationCodeClient.mjs +402 -402
  73. package/dist/client/BaseClient.d.ts +51 -51
  74. package/dist/client/BaseClient.d.ts.map +1 -1
  75. package/dist/client/BaseClient.mjs +101 -101
  76. package/dist/client/BaseClient.mjs.map +1 -1
  77. package/dist/client/RefreshTokenClient.d.ts +35 -35
  78. package/dist/client/RefreshTokenClient.mjs +204 -204
  79. package/dist/client/SilentFlowClient.d.ts +27 -27
  80. package/dist/client/SilentFlowClient.mjs +128 -128
  81. package/dist/config/AppTokenProvider.d.ts +38 -38
  82. package/dist/config/ClientConfiguration.d.ts +150 -150
  83. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  84. package/dist/config/ClientConfiguration.mjs +98 -96
  85. package/dist/config/ClientConfiguration.mjs.map +1 -1
  86. package/dist/constants/AADServerParamKeys.d.ts +52 -52
  87. package/dist/constants/AADServerParamKeys.mjs +56 -56
  88. package/dist/crypto/ICrypto.d.ts +58 -58
  89. package/dist/crypto/ICrypto.mjs +30 -30
  90. package/dist/crypto/IGuidGenerator.d.ts +4 -4
  91. package/dist/crypto/JoseHeader.d.ts +22 -22
  92. package/dist/crypto/JoseHeader.mjs +37 -37
  93. package/dist/crypto/PopTokenGenerator.d.ts +60 -60
  94. package/dist/crypto/PopTokenGenerator.mjs +82 -82
  95. package/dist/crypto/SignedHttpRequest.d.ts +15 -15
  96. package/dist/error/AuthError.d.ts +44 -44
  97. package/dist/error/AuthError.mjs +46 -46
  98. package/dist/error/AuthErrorCodes.d.ts +5 -5
  99. package/dist/error/AuthErrorCodes.mjs +9 -9
  100. package/dist/error/ClientAuthError.d.ts +237 -237
  101. package/dist/error/ClientAuthError.mjs +249 -249
  102. package/dist/error/ClientAuthErrorCodes.d.ts +44 -44
  103. package/dist/error/ClientAuthErrorCodes.mjs +48 -48
  104. package/dist/error/ClientConfigurationError.d.ts +128 -128
  105. package/dist/error/ClientConfigurationError.mjs +135 -135
  106. package/dist/error/ClientConfigurationErrorCodes.d.ts +22 -22
  107. package/dist/error/ClientConfigurationErrorCodes.mjs +26 -26
  108. package/dist/error/InteractionRequiredAuthError.d.ts +61 -61
  109. package/dist/error/InteractionRequiredAuthError.mjs +84 -84
  110. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +7 -7
  111. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +13 -13
  112. package/dist/error/JoseHeaderError.d.ts +15 -15
  113. package/dist/error/JoseHeaderError.mjs +22 -22
  114. package/dist/error/JoseHeaderErrorCodes.d.ts +2 -2
  115. package/dist/error/JoseHeaderErrorCodes.mjs +6 -6
  116. package/dist/error/ServerError.d.ts +7 -7
  117. package/dist/error/ServerError.mjs +14 -14
  118. package/dist/index.cjs +8081 -8611
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.ts +99 -99
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.mjs +4 -5
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/logger/Logger.d.ts +95 -95
  125. package/dist/logger/Logger.mjs +188 -188
  126. package/dist/network/INetworkModule.d.ts +29 -29
  127. package/dist/network/INetworkModule.mjs +12 -12
  128. package/dist/network/NetworkManager.d.ts +33 -33
  129. package/dist/network/NetworkManager.mjs +34 -34
  130. package/dist/network/RequestThumbprint.d.ts +18 -18
  131. package/dist/network/ThrottlingUtils.d.ts +42 -42
  132. package/dist/network/ThrottlingUtils.mjs +95 -95
  133. package/dist/packageMetadata.d.ts +2 -2
  134. package/dist/packageMetadata.d.ts.map +1 -1
  135. package/dist/packageMetadata.mjs +4 -4
  136. package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
  137. package/dist/request/AuthenticationHeaderParser.mjs +55 -55
  138. package/dist/request/BaseAuthRequest.d.ts +43 -43
  139. package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
  140. package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
  141. package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
  142. package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
  143. package/dist/request/CommonEndSessionRequest.d.ts +21 -21
  144. package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
  145. package/dist/request/CommonRefreshTokenRequest.d.ts +22 -22
  146. package/dist/request/CommonSilentFlowRequest.d.ts +27 -27
  147. package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
  148. package/dist/request/NativeRequest.d.ts +19 -19
  149. package/dist/request/NativeSignOutRequest.d.ts +5 -5
  150. package/dist/request/RequestParameterBuilder.d.ts +217 -217
  151. package/dist/request/RequestParameterBuilder.mjs +381 -381
  152. package/dist/request/RequestValidator.d.ts +33 -33
  153. package/dist/request/RequestValidator.mjs +81 -81
  154. package/dist/request/ScopeSet.d.ts +88 -88
  155. package/dist/request/ScopeSet.mjs +197 -197
  156. package/dist/request/StoreInCache.d.ts +8 -8
  157. package/dist/response/AuthenticationResult.d.ts +41 -41
  158. package/dist/response/AuthorizationCodePayload.d.ts +13 -13
  159. package/dist/response/DeviceCodeResponse.d.ts +25 -25
  160. package/dist/response/ExternalTokenResponse.d.ts +15 -15
  161. package/dist/response/IMDSBadResponse.d.ts +4 -4
  162. package/dist/response/ResponseHandler.d.ts +69 -69
  163. package/dist/response/ResponseHandler.mjs +350 -347
  164. package/dist/response/ResponseHandler.mjs.map +1 -1
  165. package/dist/response/ServerAuthorizationCodeResponse.d.ts +25 -25
  166. package/dist/response/ServerAuthorizationTokenResponse.d.ts +47 -47
  167. package/dist/telemetry/performance/IPerformanceClient.d.ts +57 -57
  168. package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
  169. package/dist/telemetry/performance/PerformanceClient.d.ts +198 -198
  170. package/dist/telemetry/performance/PerformanceClient.mjs +412 -412
  171. package/dist/telemetry/performance/PerformanceEvent.d.ts +464 -464
  172. package/dist/telemetry/performance/PerformanceEvent.mjs +253 -253
  173. package/dist/telemetry/performance/StubPerformanceClient.d.ts +24 -24
  174. package/dist/telemetry/performance/StubPerformanceClient.mjs +76 -76
  175. package/dist/telemetry/server/ServerTelemetryManager.d.ts +66 -66
  176. package/dist/telemetry/server/ServerTelemetryManager.mjs +201 -201
  177. package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
  178. package/dist/url/IUri.d.ts +12 -12
  179. package/dist/url/UrlString.d.ts +48 -48
  180. package/dist/url/UrlString.mjs +161 -161
  181. package/dist/utils/Constants.d.ts +296 -298
  182. package/dist/utils/Constants.d.ts.map +1 -1
  183. package/dist/utils/Constants.mjs +310 -313
  184. package/dist/utils/Constants.mjs.map +1 -1
  185. package/dist/utils/FunctionWrappers.d.ts +27 -27
  186. package/dist/utils/FunctionWrappers.mjs +84 -84
  187. package/dist/utils/MsalTypes.d.ts +6 -6
  188. package/dist/utils/ProtocolUtils.d.ts +42 -42
  189. package/dist/utils/ProtocolUtils.mjs +69 -69
  190. package/dist/utils/StringUtils.d.ts +40 -40
  191. package/dist/utils/StringUtils.mjs +95 -95
  192. package/dist/utils/TimeUtils.d.ts +27 -27
  193. package/dist/utils/TimeUtils.mjs +45 -45
  194. package/dist/utils/UrlUtils.d.ts +10 -10
  195. package/dist/utils/UrlUtils.mjs +44 -44
  196. package/package.json +1 -1
  197. package/src/authority/Authority.ts +69 -29
  198. package/src/authority/AuthorityFactory.ts +48 -92
  199. package/src/authority/AuthorityMetadata.ts +23 -526
  200. package/src/cache/entities/AppMetadataEntity.ts +6 -81
  201. package/src/cache/entities/AuthorityMetadataEntity.ts +2 -94
  202. package/src/cache/utils/CacheHelpers.ts +111 -0
  203. package/src/client/BaseClient.ts +10 -11
  204. package/src/config/ClientConfiguration.ts +4 -4
  205. package/src/index.ts +1 -2
  206. package/src/packageMetadata.ts +1 -1
  207. package/src/response/ResponseHandler.ts +5 -5
  208. package/src/utils/Constants.ts +0 -4
  209. package/dist/cache/entities/AppMetadataEntity.mjs +0 -73
  210. package/dist/cache/entities/AppMetadataEntity.mjs.map +0 -1
  211. package/dist/cache/entities/AuthorityMetadataEntity.mjs +0 -86
  212. package/dist/cache/entities/AuthorityMetadataEntity.mjs.map +0 -1
@@ -1,610 +1,144 @@
1
- /*! @azure/msal-common v14.6.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-common v14.6.1 2024-01-23 */
2
2
  'use strict';
3
3
  import { UrlString } from '../url/UrlString.mjs';
4
4
  import { AuthorityMetadataSource } from '../utils/Constants.mjs';
5
5
 
6
- /*
7
- * Copyright (c) Microsoft Corporation. All rights reserved.
8
- * Licensed under the MIT License.
9
- */
10
- const rawMetdataJSON = {
11
- endpointMetadata: {
12
- "https://login.microsoftonline.com/common/": {
13
- token_endpoint: "https://login.microsoftonline.com/common/oauth2/v2.0/token",
14
- token_endpoint_auth_methods_supported: [
15
- "client_secret_post",
16
- "private_key_jwt",
17
- "client_secret_basic",
18
- ],
19
- jwks_uri: "https://login.microsoftonline.com/common/discovery/v2.0/keys",
20
- response_modes_supported: ["query", "fragment", "form_post"],
21
- subject_types_supported: ["pairwise"],
22
- id_token_signing_alg_values_supported: ["RS256"],
23
- response_types_supported: [
24
- "code",
25
- "id_token",
26
- "code id_token",
27
- "id_token token",
28
- ],
29
- scopes_supported: ["openid", "profile", "email", "offline_access"],
30
- issuer: "https://login.microsoftonline.com/{tenantid}/v2.0",
31
- request_uri_parameter_supported: false,
32
- userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo",
33
- authorization_endpoint: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
34
- device_authorization_endpoint: "https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",
35
- http_logout_supported: true,
36
- frontchannel_logout_supported: true,
37
- end_session_endpoint: "https://login.microsoftonline.com/common/oauth2/v2.0/logout",
38
- claims_supported: [
39
- "sub",
40
- "iss",
41
- "cloud_instance_name",
42
- "cloud_instance_host_name",
43
- "cloud_graph_host_name",
44
- "msgraph_host",
45
- "aud",
46
- "exp",
47
- "iat",
48
- "auth_time",
49
- "acr",
50
- "nonce",
51
- "preferred_username",
52
- "name",
53
- "tid",
54
- "ver",
55
- "at_hash",
56
- "c_hash",
57
- "email",
58
- ],
59
- kerberos_endpoint: "https://login.microsoftonline.com/common/kerberos",
60
- tenant_region_scope: null,
61
- cloud_instance_name: "microsoftonline.com",
62
- cloud_graph_host_name: "graph.windows.net",
63
- msgraph_host: "graph.microsoft.com",
64
- rbac_url: "https://pas.windows.net",
65
- },
66
- "https://login.chinacloudapi.cn/common/": {
67
- token_endpoint: "https://login.chinacloudapi.cn/common/oauth2/v2.0/token",
68
- token_endpoint_auth_methods_supported: [
69
- "client_secret_post",
70
- "private_key_jwt",
71
- "client_secret_basic",
72
- ],
73
- jwks_uri: "https://login.chinacloudapi.cn/common/discovery/v2.0/keys",
74
- response_modes_supported: ["query", "fragment", "form_post"],
75
- subject_types_supported: ["pairwise"],
76
- id_token_signing_alg_values_supported: ["RS256"],
77
- response_types_supported: [
78
- "code",
79
- "id_token",
80
- "code id_token",
81
- "id_token token",
82
- ],
83
- scopes_supported: ["openid", "profile", "email", "offline_access"],
84
- issuer: "https://login.partner.microsoftonline.cn/{tenantid}/v2.0",
85
- request_uri_parameter_supported: false,
86
- userinfo_endpoint: "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",
87
- authorization_endpoint: "https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",
88
- device_authorization_endpoint: "https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",
89
- http_logout_supported: true,
90
- frontchannel_logout_supported: true,
91
- end_session_endpoint: "https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",
92
- claims_supported: [
93
- "sub",
94
- "iss",
95
- "cloud_instance_name",
96
- "cloud_instance_host_name",
97
- "cloud_graph_host_name",
98
- "msgraph_host",
99
- "aud",
100
- "exp",
101
- "iat",
102
- "auth_time",
103
- "acr",
104
- "nonce",
105
- "preferred_username",
106
- "name",
107
- "tid",
108
- "ver",
109
- "at_hash",
110
- "c_hash",
111
- "email",
112
- ],
113
- kerberos_endpoint: "https://login.chinacloudapi.cn/common/kerberos",
114
- tenant_region_scope: null,
115
- cloud_instance_name: "partner.microsoftonline.cn",
116
- cloud_graph_host_name: "graph.chinacloudapi.cn",
117
- msgraph_host: "microsoftgraph.chinacloudapi.cn",
118
- rbac_url: "https://pas.chinacloudapi.cn",
119
- },
120
- "https://login.microsoftonline.us/common/": {
121
- token_endpoint: "https://login.microsoftonline.us/common/oauth2/v2.0/token",
122
- token_endpoint_auth_methods_supported: [
123
- "client_secret_post",
124
- "private_key_jwt",
125
- "client_secret_basic",
126
- ],
127
- jwks_uri: "https://login.microsoftonline.us/common/discovery/v2.0/keys",
128
- response_modes_supported: ["query", "fragment", "form_post"],
129
- subject_types_supported: ["pairwise"],
130
- id_token_signing_alg_values_supported: ["RS256"],
131
- response_types_supported: [
132
- "code",
133
- "id_token",
134
- "code id_token",
135
- "id_token token",
136
- ],
137
- scopes_supported: ["openid", "profile", "email", "offline_access"],
138
- issuer: "https://login.microsoftonline.us/{tenantid}/v2.0",
139
- request_uri_parameter_supported: false,
140
- userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo",
141
- authorization_endpoint: "https://login.microsoftonline.us/common/oauth2/v2.0/authorize",
142
- device_authorization_endpoint: "https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",
143
- http_logout_supported: true,
144
- frontchannel_logout_supported: true,
145
- end_session_endpoint: "https://login.microsoftonline.us/common/oauth2/v2.0/logout",
146
- claims_supported: [
147
- "sub",
148
- "iss",
149
- "cloud_instance_name",
150
- "cloud_instance_host_name",
151
- "cloud_graph_host_name",
152
- "msgraph_host",
153
- "aud",
154
- "exp",
155
- "iat",
156
- "auth_time",
157
- "acr",
158
- "nonce",
159
- "preferred_username",
160
- "name",
161
- "tid",
162
- "ver",
163
- "at_hash",
164
- "c_hash",
165
- "email",
166
- ],
167
- kerberos_endpoint: "https://login.microsoftonline.us/common/kerberos",
168
- tenant_region_scope: null,
169
- cloud_instance_name: "microsoftonline.us",
170
- cloud_graph_host_name: "graph.windows.net",
171
- msgraph_host: "graph.microsoft.com",
172
- rbac_url: "https://pasff.usgovcloudapi.net",
173
- },
174
- "https://login.microsoftonline.com/consumers/": {
175
- token_endpoint: "https://login.microsoftonline.com/consumers/oauth2/v2.0/token",
176
- token_endpoint_auth_methods_supported: [
177
- "client_secret_post",
178
- "private_key_jwt",
179
- "client_secret_basic",
180
- ],
181
- jwks_uri: "https://login.microsoftonline.com/consumers/discovery/v2.0/keys",
182
- response_modes_supported: ["query", "fragment", "form_post"],
183
- subject_types_supported: ["pairwise"],
184
- id_token_signing_alg_values_supported: ["RS256"],
185
- response_types_supported: [
186
- "code",
187
- "id_token",
188
- "code id_token",
189
- "id_token token",
190
- ],
191
- scopes_supported: ["openid", "profile", "email", "offline_access"],
192
- issuer: "https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",
193
- request_uri_parameter_supported: false,
194
- userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo",
195
- authorization_endpoint: "https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",
196
- device_authorization_endpoint: "https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",
197
- http_logout_supported: true,
198
- frontchannel_logout_supported: true,
199
- end_session_endpoint: "https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",
200
- claims_supported: [
201
- "sub",
202
- "iss",
203
- "cloud_instance_name",
204
- "cloud_instance_host_name",
205
- "cloud_graph_host_name",
206
- "msgraph_host",
207
- "aud",
208
- "exp",
209
- "iat",
210
- "auth_time",
211
- "acr",
212
- "nonce",
213
- "preferred_username",
214
- "name",
215
- "tid",
216
- "ver",
217
- "at_hash",
218
- "c_hash",
219
- "email",
220
- ],
221
- kerberos_endpoint: "https://login.microsoftonline.com/consumers/kerberos",
222
- tenant_region_scope: null,
223
- cloud_instance_name: "microsoftonline.com",
224
- cloud_graph_host_name: "graph.windows.net",
225
- msgraph_host: "graph.microsoft.com",
226
- rbac_url: "https://pas.windows.net",
227
- },
228
- "https://login.chinacloudapi.cn/consumers/": {
229
- token_endpoint: "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",
230
- token_endpoint_auth_methods_supported: [
231
- "client_secret_post",
232
- "private_key_jwt",
233
- "client_secret_basic",
234
- ],
235
- jwks_uri: "https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",
236
- response_modes_supported: ["query", "fragment", "form_post"],
237
- subject_types_supported: ["pairwise"],
238
- id_token_signing_alg_values_supported: ["RS256"],
239
- response_types_supported: [
240
- "code",
241
- "id_token",
242
- "code id_token",
243
- "id_token token",
244
- ],
245
- scopes_supported: ["openid", "profile", "email", "offline_access"],
246
- issuer: "https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",
247
- request_uri_parameter_supported: false,
248
- userinfo_endpoint: "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",
249
- authorization_endpoint: "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",
250
- device_authorization_endpoint: "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",
251
- http_logout_supported: true,
252
- frontchannel_logout_supported: true,
253
- end_session_endpoint: "https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",
254
- claims_supported: [
255
- "sub",
256
- "iss",
257
- "cloud_instance_name",
258
- "cloud_instance_host_name",
259
- "cloud_graph_host_name",
260
- "msgraph_host",
261
- "aud",
262
- "exp",
263
- "iat",
264
- "auth_time",
265
- "acr",
266
- "nonce",
267
- "preferred_username",
268
- "name",
269
- "tid",
270
- "ver",
271
- "at_hash",
272
- "c_hash",
273
- "email",
274
- ],
275
- kerberos_endpoint: "https://login.chinacloudapi.cn/consumers/kerberos",
276
- tenant_region_scope: null,
277
- cloud_instance_name: "partner.microsoftonline.cn",
278
- cloud_graph_host_name: "graph.chinacloudapi.cn",
279
- msgraph_host: "microsoftgraph.chinacloudapi.cn",
280
- rbac_url: "https://pas.chinacloudapi.cn",
281
- },
282
- "https://login.microsoftonline.us/consumers/": {
283
- token_endpoint: "https://login.microsoftonline.us/consumers/oauth2/v2.0/token",
284
- token_endpoint_auth_methods_supported: [
285
- "client_secret_post",
286
- "private_key_jwt",
287
- "client_secret_basic",
288
- ],
289
- jwks_uri: "https://login.microsoftonline.us/consumers/discovery/v2.0/keys",
290
- response_modes_supported: ["query", "fragment", "form_post"],
291
- subject_types_supported: ["pairwise"],
292
- id_token_signing_alg_values_supported: ["RS256"],
293
- response_types_supported: [
294
- "code",
295
- "id_token",
296
- "code id_token",
297
- "id_token token",
298
- ],
299
- scopes_supported: ["openid", "profile", "email", "offline_access"],
300
- issuer: "https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",
301
- request_uri_parameter_supported: false,
302
- userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo",
303
- authorization_endpoint: "https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",
304
- device_authorization_endpoint: "https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",
305
- http_logout_supported: true,
306
- frontchannel_logout_supported: true,
307
- end_session_endpoint: "https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",
308
- claims_supported: [
309
- "sub",
310
- "iss",
311
- "cloud_instance_name",
312
- "cloud_instance_host_name",
313
- "cloud_graph_host_name",
314
- "msgraph_host",
315
- "aud",
316
- "exp",
317
- "iat",
318
- "auth_time",
319
- "acr",
320
- "nonce",
321
- "preferred_username",
322
- "name",
323
- "tid",
324
- "ver",
325
- "at_hash",
326
- "c_hash",
327
- "email",
328
- ],
329
- kerberos_endpoint: "https://login.microsoftonline.us/consumers/kerberos",
330
- tenant_region_scope: null,
331
- cloud_instance_name: "microsoftonline.us",
332
- cloud_graph_host_name: "graph.windows.net",
333
- msgraph_host: "graph.microsoft.com",
334
- rbac_url: "https://pasff.usgovcloudapi.net",
335
- },
336
- "https://login.microsoftonline.com/organizations/": {
337
- token_endpoint: "https://login.microsoftonline.com/organizations/oauth2/v2.0/token",
338
- token_endpoint_auth_methods_supported: [
339
- "client_secret_post",
340
- "private_key_jwt",
341
- "client_secret_basic",
342
- ],
343
- jwks_uri: "https://login.microsoftonline.com/organizations/discovery/v2.0/keys",
344
- response_modes_supported: ["query", "fragment", "form_post"],
345
- subject_types_supported: ["pairwise"],
346
- id_token_signing_alg_values_supported: ["RS256"],
347
- response_types_supported: [
348
- "code",
349
- "id_token",
350
- "code id_token",
351
- "id_token token",
352
- ],
353
- scopes_supported: ["openid", "profile", "email", "offline_access"],
354
- issuer: "https://login.microsoftonline.com/{tenantid}/v2.0",
355
- request_uri_parameter_supported: false,
356
- userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo",
357
- authorization_endpoint: "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",
358
- device_authorization_endpoint: "https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",
359
- http_logout_supported: true,
360
- frontchannel_logout_supported: true,
361
- end_session_endpoint: "https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",
362
- claims_supported: [
363
- "sub",
364
- "iss",
365
- "cloud_instance_name",
366
- "cloud_instance_host_name",
367
- "cloud_graph_host_name",
368
- "msgraph_host",
369
- "aud",
370
- "exp",
371
- "iat",
372
- "auth_time",
373
- "acr",
374
- "nonce",
375
- "preferred_username",
376
- "name",
377
- "tid",
378
- "ver",
379
- "at_hash",
380
- "c_hash",
381
- "email",
382
- ],
383
- kerberos_endpoint: "https://login.microsoftonline.com/organizations/kerberos",
384
- tenant_region_scope: null,
385
- cloud_instance_name: "microsoftonline.com",
386
- cloud_graph_host_name: "graph.windows.net",
387
- msgraph_host: "graph.microsoft.com",
388
- rbac_url: "https://pas.windows.net",
389
- },
390
- "https://login.chinacloudapi.cn/organizations/": {
391
- token_endpoint: "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",
392
- token_endpoint_auth_methods_supported: [
393
- "client_secret_post",
394
- "private_key_jwt",
395
- "client_secret_basic",
396
- ],
397
- jwks_uri: "https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",
398
- response_modes_supported: ["query", "fragment", "form_post"],
399
- subject_types_supported: ["pairwise"],
400
- id_token_signing_alg_values_supported: ["RS256"],
401
- response_types_supported: [
402
- "code",
403
- "id_token",
404
- "code id_token",
405
- "id_token token",
406
- ],
407
- scopes_supported: ["openid", "profile", "email", "offline_access"],
408
- issuer: "https://login.partner.microsoftonline.cn/{tenantid}/v2.0",
409
- request_uri_parameter_supported: false,
410
- userinfo_endpoint: "https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",
411
- authorization_endpoint: "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",
412
- device_authorization_endpoint: "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",
413
- http_logout_supported: true,
414
- frontchannel_logout_supported: true,
415
- end_session_endpoint: "https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",
416
- claims_supported: [
417
- "sub",
418
- "iss",
419
- "cloud_instance_name",
420
- "cloud_instance_host_name",
421
- "cloud_graph_host_name",
422
- "msgraph_host",
423
- "aud",
424
- "exp",
425
- "iat",
426
- "auth_time",
427
- "acr",
428
- "nonce",
429
- "preferred_username",
430
- "name",
431
- "tid",
432
- "ver",
433
- "at_hash",
434
- "c_hash",
435
- "email",
436
- ],
437
- kerberos_endpoint: "https://login.chinacloudapi.cn/organizations/kerberos",
438
- tenant_region_scope: null,
439
- cloud_instance_name: "partner.microsoftonline.cn",
440
- cloud_graph_host_name: "graph.chinacloudapi.cn",
441
- msgraph_host: "microsoftgraph.chinacloudapi.cn",
442
- rbac_url: "https://pas.chinacloudapi.cn",
443
- },
444
- "https://login.microsoftonline.us/organizations/": {
445
- token_endpoint: "https://login.microsoftonline.us/organizations/oauth2/v2.0/token",
446
- token_endpoint_auth_methods_supported: [
447
- "client_secret_post",
448
- "private_key_jwt",
449
- "client_secret_basic",
450
- ],
451
- jwks_uri: "https://login.microsoftonline.us/organizations/discovery/v2.0/keys",
452
- response_modes_supported: ["query", "fragment", "form_post"],
453
- subject_types_supported: ["pairwise"],
454
- id_token_signing_alg_values_supported: ["RS256"],
455
- response_types_supported: [
456
- "code",
457
- "id_token",
458
- "code id_token",
459
- "id_token token",
460
- ],
461
- scopes_supported: ["openid", "profile", "email", "offline_access"],
462
- issuer: "https://login.microsoftonline.us/{tenantid}/v2.0",
463
- request_uri_parameter_supported: false,
464
- userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo",
465
- authorization_endpoint: "https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",
466
- device_authorization_endpoint: "https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",
467
- http_logout_supported: true,
468
- frontchannel_logout_supported: true,
469
- end_session_endpoint: "https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",
470
- claims_supported: [
471
- "sub",
472
- "iss",
473
- "cloud_instance_name",
474
- "cloud_instance_host_name",
475
- "cloud_graph_host_name",
476
- "msgraph_host",
477
- "aud",
478
- "exp",
479
- "iat",
480
- "auth_time",
481
- "acr",
482
- "nonce",
483
- "preferred_username",
484
- "name",
485
- "tid",
486
- "ver",
487
- "at_hash",
488
- "c_hash",
489
- "email",
490
- ],
491
- kerberos_endpoint: "https://login.microsoftonline.us/organizations/kerberos",
492
- tenant_region_scope: null,
493
- cloud_instance_name: "microsoftonline.us",
494
- cloud_graph_host_name: "graph.windows.net",
495
- msgraph_host: "graph.microsoft.com",
496
- rbac_url: "https://pasff.usgovcloudapi.net",
497
- },
498
- },
499
- instanceDiscoveryMetadata: {
500
- tenant_discovery_endpoint: "https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",
501
- "api-version": "1.1",
502
- metadata: [
503
- {
504
- preferred_network: "login.microsoftonline.com",
505
- preferred_cache: "login.windows.net",
506
- aliases: [
507
- "login.microsoftonline.com",
508
- "login.windows.net",
509
- "login.microsoft.com",
510
- "sts.windows.net",
511
- ],
512
- },
513
- {
514
- preferred_network: "login.partner.microsoftonline.cn",
515
- preferred_cache: "login.partner.microsoftonline.cn",
516
- aliases: [
517
- "login.partner.microsoftonline.cn",
518
- "login.chinacloudapi.cn",
519
- ],
520
- },
521
- {
522
- preferred_network: "login.microsoftonline.de",
523
- preferred_cache: "login.microsoftonline.de",
524
- aliases: ["login.microsoftonline.de"],
525
- },
526
- {
527
- preferred_network: "login.microsoftonline.us",
528
- preferred_cache: "login.microsoftonline.us",
529
- aliases: [
530
- "login.microsoftonline.us",
531
- "login.usgovcloudapi.net",
532
- ],
533
- },
534
- {
535
- preferred_network: "login-us.microsoftonline.com",
536
- preferred_cache: "login-us.microsoftonline.com",
537
- aliases: ["login-us.microsoftonline.com"],
538
- },
539
- ],
540
- },
541
- };
542
- const EndpointMetadata = rawMetdataJSON.endpointMetadata;
543
- const InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
544
- const InstanceDiscoveryMetadataAliases = new Set();
545
- InstanceDiscoveryMetadata.metadata.forEach((metadataEntry) => {
546
- metadataEntry.aliases.forEach((alias) => {
547
- InstanceDiscoveryMetadataAliases.add(alias);
548
- });
549
- });
550
- /**
551
- * Attempts to get an aliases array from the static authority metadata sources based on the canonical authority host
552
- * @param staticAuthorityOptions
553
- * @param logger
554
- * @returns
555
- */
556
- function getAliasesFromStaticSources(staticAuthorityOptions, logger) {
557
- let staticAliases;
558
- const canonicalAuthority = staticAuthorityOptions.canonicalAuthority;
559
- if (canonicalAuthority) {
560
- const authorityHost = new UrlString(canonicalAuthority).getUrlComponents().HostNameAndPort;
561
- staticAliases =
562
- getAliasesFromMetadata(authorityHost, staticAuthorityOptions.cloudDiscoveryMetadata?.metadata, AuthorityMetadataSource.CONFIG, logger) ||
563
- getAliasesFromMetadata(authorityHost, InstanceDiscoveryMetadata.metadata, AuthorityMetadataSource.HARDCODED_VALUES, logger) ||
564
- staticAuthorityOptions.knownAuthorities;
565
- }
566
- return staticAliases || [];
567
- }
568
- /**
569
- * Returns aliases for from the raw cloud discovery metadata passed in
570
- * @param authorityHost
571
- * @param rawCloudDiscoveryMetadata
572
- * @returns
573
- */
574
- function getAliasesFromMetadata(authorityHost, cloudDiscoveryMetadata, source, logger) {
575
- logger?.trace(`getAliasesFromMetadata called with source: ${source}`);
576
- if (authorityHost && cloudDiscoveryMetadata) {
577
- const metadata = getCloudDiscoveryMetadataFromNetworkResponse(cloudDiscoveryMetadata, authorityHost);
578
- if (metadata) {
579
- logger?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${source}, returning aliases`);
580
- return metadata.aliases;
581
- }
582
- else {
583
- logger?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${source}`);
584
- }
585
- }
586
- return null;
587
- }
588
- /**
589
- * Get cloud discovery metadata for common authorities
590
- */
591
- function getCloudDiscoveryMetadataFromHardcodedValues(authorityHost) {
592
- const metadata = getCloudDiscoveryMetadataFromNetworkResponse(InstanceDiscoveryMetadata.metadata, authorityHost);
593
- return metadata;
594
- }
595
- /**
596
- * Searches instance discovery network response for the entry that contains the host in the aliases list
597
- * @param response
598
- * @param authority
599
- */
600
- function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
601
- for (let i = 0; i < response.length; i++) {
602
- const metadata = response[i];
603
- if (metadata.aliases.includes(authorityHost)) {
604
- return metadata;
605
- }
606
- }
607
- return null;
6
+ /*
7
+ * Copyright (c) Microsoft Corporation. All rights reserved.
8
+ * Licensed under the MIT License.
9
+ */
10
+ const rawMetdataJSON = {
11
+ endpointMetadata: {
12
+ "login.microsoftonline.com": {
13
+ token_endpoint: "https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",
14
+ jwks_uri: "https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",
15
+ issuer: "https://login.microsoftonline.com/{tenantid}/v2.0",
16
+ authorization_endpoint: "https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",
17
+ end_session_endpoint: "https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout",
18
+ },
19
+ "login.chinacloudapi.cn": {
20
+ token_endpoint: "https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",
21
+ jwks_uri: "https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",
22
+ issuer: "https://login.partner.microsoftonline.cn/{tenantid}/v2.0",
23
+ authorization_endpoint: "https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",
24
+ end_session_endpoint: "https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout",
25
+ },
26
+ "login.microsoftonline.us": {
27
+ token_endpoint: "https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",
28
+ jwks_uri: "https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",
29
+ issuer: "https://login.microsoftonline.us/{tenantid}/v2.0",
30
+ authorization_endpoint: "https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",
31
+ end_session_endpoint: "https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout",
32
+ },
33
+ },
34
+ instanceDiscoveryMetadata: {
35
+ tenant_discovery_endpoint: "https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",
36
+ metadata: [
37
+ {
38
+ preferred_network: "login.microsoftonline.com",
39
+ preferred_cache: "login.windows.net",
40
+ aliases: [
41
+ "login.microsoftonline.com",
42
+ "login.windows.net",
43
+ "login.microsoft.com",
44
+ "sts.windows.net",
45
+ ],
46
+ },
47
+ {
48
+ preferred_network: "login.partner.microsoftonline.cn",
49
+ preferred_cache: "login.partner.microsoftonline.cn",
50
+ aliases: [
51
+ "login.partner.microsoftonline.cn",
52
+ "login.chinacloudapi.cn",
53
+ ],
54
+ },
55
+ {
56
+ preferred_network: "login.microsoftonline.de",
57
+ preferred_cache: "login.microsoftonline.de",
58
+ aliases: ["login.microsoftonline.de"],
59
+ },
60
+ {
61
+ preferred_network: "login.microsoftonline.us",
62
+ preferred_cache: "login.microsoftonline.us",
63
+ aliases: [
64
+ "login.microsoftonline.us",
65
+ "login.usgovcloudapi.net",
66
+ ],
67
+ },
68
+ {
69
+ preferred_network: "login-us.microsoftonline.com",
70
+ preferred_cache: "login-us.microsoftonline.com",
71
+ aliases: ["login-us.microsoftonline.com"],
72
+ },
73
+ ],
74
+ },
75
+ };
76
+ const EndpointMetadata = rawMetdataJSON.endpointMetadata;
77
+ const InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
78
+ const InstanceDiscoveryMetadataAliases = new Set();
79
+ InstanceDiscoveryMetadata.metadata.forEach((metadataEntry) => {
80
+ metadataEntry.aliases.forEach((alias) => {
81
+ InstanceDiscoveryMetadataAliases.add(alias);
82
+ });
83
+ });
84
+ /**
85
+ * Attempts to get an aliases array from the static authority metadata sources based on the canonical authority host
86
+ * @param staticAuthorityOptions
87
+ * @param logger
88
+ * @returns
89
+ */
90
+ function getAliasesFromStaticSources(staticAuthorityOptions, logger) {
91
+ let staticAliases;
92
+ const canonicalAuthority = staticAuthorityOptions.canonicalAuthority;
93
+ if (canonicalAuthority) {
94
+ const authorityHost = new UrlString(canonicalAuthority).getUrlComponents().HostNameAndPort;
95
+ staticAliases =
96
+ getAliasesFromMetadata(authorityHost, staticAuthorityOptions.cloudDiscoveryMetadata?.metadata, AuthorityMetadataSource.CONFIG, logger) ||
97
+ getAliasesFromMetadata(authorityHost, InstanceDiscoveryMetadata.metadata, AuthorityMetadataSource.HARDCODED_VALUES, logger) ||
98
+ staticAuthorityOptions.knownAuthorities;
99
+ }
100
+ return staticAliases || [];
101
+ }
102
+ /**
103
+ * Returns aliases for from the raw cloud discovery metadata passed in
104
+ * @param authorityHost
105
+ * @param rawCloudDiscoveryMetadata
106
+ * @returns
107
+ */
108
+ function getAliasesFromMetadata(authorityHost, cloudDiscoveryMetadata, source, logger) {
109
+ logger?.trace(`getAliasesFromMetadata called with source: ${source}`);
110
+ if (authorityHost && cloudDiscoveryMetadata) {
111
+ const metadata = getCloudDiscoveryMetadataFromNetworkResponse(cloudDiscoveryMetadata, authorityHost);
112
+ if (metadata) {
113
+ logger?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${source}, returning aliases`);
114
+ return metadata.aliases;
115
+ }
116
+ else {
117
+ logger?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${source}`);
118
+ }
119
+ }
120
+ return null;
121
+ }
122
+ /**
123
+ * Get cloud discovery metadata for common authorities
124
+ */
125
+ function getCloudDiscoveryMetadataFromHardcodedValues(authorityHost) {
126
+ const metadata = getCloudDiscoveryMetadataFromNetworkResponse(InstanceDiscoveryMetadata.metadata, authorityHost);
127
+ return metadata;
128
+ }
129
+ /**
130
+ * Searches instance discovery network response for the entry that contains the host in the aliases list
131
+ * @param response
132
+ * @param authority
133
+ */
134
+ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
135
+ for (let i = 0; i < response.length; i++) {
136
+ const metadata = response[i];
137
+ if (metadata.aliases.includes(authorityHost)) {
138
+ return metadata;
139
+ }
140
+ }
141
+ return null;
608
142
  }
609
143
 
610
144
  export { EndpointMetadata, InstanceDiscoveryMetadata, InstanceDiscoveryMetadataAliases, getAliasesFromMetadata, getAliasesFromStaticSources, getCloudDiscoveryMetadataFromHardcodedValues, getCloudDiscoveryMetadataFromNetworkResponse, rawMetdataJSON };