@azure/msal-node 2.15.0 → 2.16.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.
- package/dist/cache/NodeStorage.d.ts +3 -3
- package/dist/cache/NodeStorage.d.ts.map +1 -1
- package/dist/cache/NodeStorage.mjs +4 -4
- package/dist/cache/NodeStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.mjs +2 -2
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.d.ts +12 -0
- package/dist/cache/distributed/DistributedCachePlugin.d.ts.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +13 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
- package/dist/cache/distributed/ICacheClient.d.ts +7 -3
- package/dist/cache/distributed/ICacheClient.d.ts.map +1 -1
- package/dist/cache/distributed/IPartitionManager.d.ts +5 -1
- package/dist/cache/distributed/IPartitionManager.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.d.ts +9 -8
- package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.mjs +10 -9
- package/dist/cache/serializer/Deserializer.mjs.map +1 -1
- package/dist/cache/serializer/Serializer.d.ts +11 -7
- package/dist/cache/serializer/Serializer.d.ts.map +1 -1
- package/dist/cache/serializer/Serializer.mjs +12 -8
- package/dist/cache/serializer/Serializer.mjs.map +1 -1
- package/dist/client/ClientApplication.d.ts +3 -3
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +11 -10
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientCredentialClient.d.ts +5 -4
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +6 -5
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +19 -5
- package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts +19 -15
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +24 -20
- package/dist/client/DeviceCodeClient.mjs.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +1 -1
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
- package/dist/client/OnBehalfOfClient.d.ts +9 -9
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +10 -10
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.d.ts +3 -3
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +5 -5
- package/dist/client/PublicClientApplication.mjs.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts +5 -4
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +6 -5
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +4 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +1 -1
- package/dist/crypto/CryptoProvider.d.ts +2 -2
- package/dist/crypto/CryptoProvider.mjs +3 -3
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/NodeAuthError.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.mjs +1 -1
- package/dist/network/HttpClientWithRetries.mjs +1 -1
- package/dist/network/LoopbackClient.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/ManagedIdentityRequestParams.d.ts +2 -1
- package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -1
- package/dist/request/SignOutRequest.d.ts +1 -0
- package/dist/request/SignOutRequest.d.ts.map +1 -1
- package/dist/retry/LinearRetryPolicy.mjs +1 -1
- package/dist/utils/Constants.d.ts +1 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +3 -2
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.d.ts +12 -1
- package/dist/utils/NetworkUtils.d.ts.map +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs.map +1 -1
- package/lib/msal-node.cjs +422 -313
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/cache/NodeStorage.d.ts +3 -3
- package/lib/types/cache/NodeStorage.d.ts.map +1 -1
- package/lib/types/cache/distributed/DistributedCachePlugin.d.ts +12 -0
- package/lib/types/cache/distributed/DistributedCachePlugin.d.ts.map +1 -1
- package/lib/types/cache/distributed/ICacheClient.d.ts +7 -3
- package/lib/types/cache/distributed/ICacheClient.d.ts.map +1 -1
- package/lib/types/cache/distributed/IPartitionManager.d.ts +5 -1
- package/lib/types/cache/distributed/IPartitionManager.d.ts.map +1 -1
- package/lib/types/cache/serializer/Deserializer.d.ts +9 -8
- package/lib/types/cache/serializer/Deserializer.d.ts.map +1 -1
- package/lib/types/cache/serializer/Serializer.d.ts +11 -7
- package/lib/types/cache/serializer/Serializer.d.ts.map +1 -1
- package/lib/types/client/ClientApplication.d.ts +3 -3
- package/lib/types/client/ClientApplication.d.ts.map +1 -1
- package/lib/types/client/ClientCredentialClient.d.ts +5 -4
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
- package/lib/types/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/lib/types/client/DeviceCodeClient.d.ts +19 -15
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
- package/lib/types/client/OnBehalfOfClient.d.ts +9 -9
- package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
- package/lib/types/client/PublicClientApplication.d.ts +3 -3
- package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
- package/lib/types/client/UsernamePasswordClient.d.ts +5 -4
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts +4 -0
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/crypto/CryptoProvider.d.ts +2 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/request/ManagedIdentityRequestParams.d.ts +2 -1
- package/lib/types/request/ManagedIdentityRequestParams.d.ts.map +1 -1
- package/lib/types/request/SignOutRequest.d.ts +1 -0
- package/lib/types/request/SignOutRequest.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +1 -0
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/lib/types/utils/NetworkUtils.d.ts +12 -1
- package/lib/types/utils/NetworkUtils.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/cache/NodeStorage.ts +3 -3
- package/src/cache/TokenCache.ts +1 -1
- package/src/cache/distributed/DistributedCachePlugin.ts +12 -0
- package/src/cache/distributed/ICacheClient.ts +7 -3
- package/src/cache/distributed/IPartitionManager.ts +5 -1
- package/src/cache/serializer/Deserializer.ts +9 -8
- package/src/cache/serializer/Serializer.ts +11 -7
- package/src/client/ClientApplication.ts +10 -3
- package/src/client/ClientCredentialClient.ts +5 -4
- package/src/client/ConfidentialClientApplication.ts +21 -1
- package/src/client/DeviceCodeClient.ts +29 -20
- package/src/client/OnBehalfOfClient.ts +9 -9
- package/src/client/PublicClientApplication.ts +4 -3
- package/src/client/UsernamePasswordClient.ts +5 -4
- package/src/config/Configuration.ts +4 -0
- package/src/crypto/CryptoProvider.ts +2 -2
- package/src/index.ts +0 -1
- package/src/packageMetadata.ts +1 -1
- package/src/request/ManagedIdentityRequestParams.ts +2 -1
- package/src/request/SignOutRequest.ts +1 -0
- package/src/utils/Constants.ts +1 -0
- package/src/utils/NetworkUtils.ts +13 -4
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* OAuth2.0 Device code client
|
|
30
|
+
* @public
|
|
30
31
|
*/
|
|
31
32
|
export class DeviceCodeClient extends BaseClient {
|
|
32
33
|
constructor(configuration: ClientConfiguration) {
|
|
@@ -36,7 +37,7 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
36
37
|
/**
|
|
37
38
|
* Gets device code from device code endpoint, calls back to with device code response, and
|
|
38
39
|
* polls token endpoint to exchange device code for tokens
|
|
39
|
-
* @param request
|
|
40
|
+
* @param request - developer provided CommonDeviceCodeRequest
|
|
40
41
|
*/
|
|
41
42
|
public async acquireToken(
|
|
42
43
|
request: CommonDeviceCodeRequest
|
|
@@ -70,7 +71,7 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
70
71
|
|
|
71
72
|
/**
|
|
72
73
|
* Creates device code request and executes http GET
|
|
73
|
-
* @param request
|
|
74
|
+
* @param request - developer provided CommonDeviceCodeRequest
|
|
74
75
|
*/
|
|
75
76
|
private async getDeviceCode(
|
|
76
77
|
request: CommonDeviceCodeRequest
|
|
@@ -98,15 +99,18 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
98
99
|
endpoint,
|
|
99
100
|
queryString,
|
|
100
101
|
headers,
|
|
101
|
-
thumbprint
|
|
102
|
+
thumbprint,
|
|
103
|
+
request.correlationId
|
|
102
104
|
);
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
/**
|
|
106
108
|
* Creates query string for the device code request
|
|
107
|
-
* @param request
|
|
109
|
+
* @param request - developer provided CommonDeviceCodeRequest
|
|
108
110
|
*/
|
|
109
|
-
createExtraQueryParameters(
|
|
111
|
+
public createExtraQueryParameters(
|
|
112
|
+
request: CommonDeviceCodeRequest
|
|
113
|
+
): string {
|
|
110
114
|
const parameterBuilder = new RequestParameterBuilder();
|
|
111
115
|
|
|
112
116
|
if (request.extraQueryParameters) {
|
|
@@ -120,15 +124,18 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
120
124
|
|
|
121
125
|
/**
|
|
122
126
|
* Executes POST request to device code endpoint
|
|
123
|
-
* @param deviceCodeEndpoint
|
|
124
|
-
* @param queryString
|
|
125
|
-
* @param headers
|
|
127
|
+
* @param deviceCodeEndpoint - token endpoint
|
|
128
|
+
* @param queryString - string to be used in the body of the request
|
|
129
|
+
* @param headers - headers for the request
|
|
130
|
+
* @param thumbprint - unique request thumbprint
|
|
131
|
+
* @param correlationId - correlation id to be used in the request
|
|
126
132
|
*/
|
|
127
133
|
private async executePostRequestToDeviceCodeEndpoint(
|
|
128
134
|
deviceCodeEndpoint: string,
|
|
129
135
|
queryString: string,
|
|
130
136
|
headers: Record<string, string>,
|
|
131
|
-
thumbprint: RequestThumbprint
|
|
137
|
+
thumbprint: RequestThumbprint,
|
|
138
|
+
correlationId: string
|
|
132
139
|
): Promise<DeviceCodeResponse> {
|
|
133
140
|
const {
|
|
134
141
|
body: {
|
|
@@ -139,13 +146,14 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
139
146
|
interval,
|
|
140
147
|
message,
|
|
141
148
|
},
|
|
142
|
-
} = await this.
|
|
149
|
+
} = await this.sendPostRequest<ServerDeviceCodeResponse>(
|
|
143
150
|
thumbprint,
|
|
144
151
|
deviceCodeEndpoint,
|
|
145
152
|
{
|
|
146
153
|
body: queryString,
|
|
147
154
|
headers: headers,
|
|
148
|
-
}
|
|
155
|
+
},
|
|
156
|
+
correlationId
|
|
149
157
|
);
|
|
150
158
|
|
|
151
159
|
return {
|
|
@@ -160,6 +168,7 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
160
168
|
|
|
161
169
|
/**
|
|
162
170
|
* Create device code endpoint query parameters and returns string
|
|
171
|
+
* @param request - developer provided CommonDeviceCodeRequest
|
|
163
172
|
*/
|
|
164
173
|
private createQueryString(request: CommonDeviceCodeRequest): string {
|
|
165
174
|
const parameterBuilder: RequestParameterBuilder =
|
|
@@ -189,9 +198,10 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
189
198
|
}
|
|
190
199
|
|
|
191
200
|
/**
|
|
192
|
-
* Breaks the polling with specific conditions
|
|
193
|
-
* @param request
|
|
194
|
-
* @param
|
|
201
|
+
* Breaks the polling with specific conditions
|
|
202
|
+
* @param deviceCodeExpirationTime - expiration time for the device code request
|
|
203
|
+
* @param userSpecifiedTimeout - developer provided timeout, to be compared against deviceCodeExpirationTime
|
|
204
|
+
* @param userSpecifiedCancelFlag - boolean indicating the developer would like to cancel the request
|
|
195
205
|
*/
|
|
196
206
|
private continuePolling(
|
|
197
207
|
deviceCodeExpirationTime: number,
|
|
@@ -231,10 +241,9 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
231
241
|
}
|
|
232
242
|
|
|
233
243
|
/**
|
|
234
|
-
* Creates token request with device code response and polls token endpoint at interval set by the device code
|
|
235
|
-
*
|
|
236
|
-
* @param
|
|
237
|
-
* @param deviceCodeResponse
|
|
244
|
+
* Creates token request with device code response and polls token endpoint at interval set by the device code response
|
|
245
|
+
* @param request - developer provided CommonDeviceCodeRequest
|
|
246
|
+
* @param deviceCodeResponse - DeviceCodeResponse returned by the security token service device code endpoint
|
|
238
247
|
*/
|
|
239
248
|
private async acquireTokenWithDeviceCode(
|
|
240
249
|
request: CommonDeviceCodeRequest,
|
|
@@ -326,8 +335,8 @@ export class DeviceCodeClient extends BaseClient {
|
|
|
326
335
|
|
|
327
336
|
/**
|
|
328
337
|
* Creates query parameters and converts to string.
|
|
329
|
-
* @param request
|
|
330
|
-
* @param deviceCodeResponse
|
|
338
|
+
* @param request - developer provided CommonDeviceCodeRequest
|
|
339
|
+
* @param deviceCodeResponse - DeviceCodeResponse returned by the security token service device code endpoint
|
|
331
340
|
*/
|
|
332
341
|
private createTokenRequestBody(
|
|
333
342
|
request: CommonDeviceCodeRequest,
|
|
@@ -37,6 +37,7 @@ import { EncodingUtils } from "../utils/EncodingUtils.js";
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* On-Behalf-Of client
|
|
40
|
+
* @public
|
|
40
41
|
*/
|
|
41
42
|
export class OnBehalfOfClient extends BaseClient {
|
|
42
43
|
private scopeSet: ScopeSet;
|
|
@@ -48,7 +49,7 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* Public API to acquire tokens with on behalf of flow
|
|
51
|
-
* @param request
|
|
52
|
+
* @param request - developer provided CommonOnBehalfOfRequest
|
|
52
53
|
*/
|
|
53
54
|
public async acquireToken(
|
|
54
55
|
request: CommonOnBehalfOfRequest
|
|
@@ -86,7 +87,7 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
86
87
|
* Find accessToken based on user assertion and account info in the cache
|
|
87
88
|
* Please note we are not yet supported OBO tokens refreshed with long lived RT. User will have to send a new assertion if the current access token expires
|
|
88
89
|
* This is to prevent security issues when the assertion changes over time, however, longlived RT helps retaining the session
|
|
89
|
-
* @param request
|
|
90
|
+
* @param request - developer provided CommonOnBehalfOfRequest
|
|
90
91
|
*/
|
|
91
92
|
private async getCachedAuthenticationResult(
|
|
92
93
|
request: CommonOnBehalfOfRequest
|
|
@@ -172,7 +173,7 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
172
173
|
/**
|
|
173
174
|
* read idtoken from cache, this is a specific implementation for OBO as the requirements differ from a generic lookup in the cacheManager
|
|
174
175
|
* Certain use cases of OBO flow do not expect an idToken in the cache/or from the service
|
|
175
|
-
* @param atHomeAccountId
|
|
176
|
+
* @param atHomeAccountId - account id
|
|
176
177
|
*/
|
|
177
178
|
private readIdTokenFromCacheForOBO(
|
|
178
179
|
atHomeAccountId: string
|
|
@@ -198,9 +199,8 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
198
199
|
|
|
199
200
|
/**
|
|
200
201
|
* Fetches the cached access token based on incoming assertion
|
|
201
|
-
* @param clientId
|
|
202
|
-
* @param request
|
|
203
|
-
* @param userAssertionHash
|
|
202
|
+
* @param clientId - client id
|
|
203
|
+
* @param request - developer provided CommonOnBehalfOfRequest
|
|
204
204
|
*/
|
|
205
205
|
private readAccessTokenFromCacheForOBO(
|
|
206
206
|
clientId: string,
|
|
@@ -246,8 +246,8 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
248
|
* Make a network call to the server requesting credentials
|
|
249
|
-
* @param request
|
|
250
|
-
* @param authority
|
|
249
|
+
* @param request - developer provided CommonOnBehalfOfRequest
|
|
250
|
+
* @param authority - authority object
|
|
251
251
|
*/
|
|
252
252
|
private async executeTokenRequest(
|
|
253
253
|
request: CommonOnBehalfOfRequest,
|
|
@@ -307,7 +307,7 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
309
|
* generate a server request in accepable format
|
|
310
|
-
* @param request
|
|
310
|
+
* @param request - developer provided CommonOnBehalfOfRequest
|
|
311
311
|
*/
|
|
312
312
|
private async createTokenRequestBody(
|
|
313
313
|
request: CommonOnBehalfOfRequest
|
|
@@ -116,6 +116,7 @@ export class PublicClientApplication
|
|
|
116
116
|
const deviceCodeConfig = await this.buildOauthClientConfiguration(
|
|
117
117
|
validRequest.authority,
|
|
118
118
|
validRequest.correlationId,
|
|
119
|
+
"",
|
|
119
120
|
serverTelemetryManager,
|
|
120
121
|
undefined,
|
|
121
122
|
request.azureCloudOptions
|
|
@@ -238,7 +239,7 @@ export class PublicClientApplication
|
|
|
238
239
|
|
|
239
240
|
/**
|
|
240
241
|
* Returns a token retrieved either from the cache or by exchanging the refresh token for a fresh access token. If brokering is enabled the token request will be serviced by the broker.
|
|
241
|
-
* @param request
|
|
242
|
+
* @param request - developer provided SilentFlowRequest
|
|
242
243
|
* @returns
|
|
243
244
|
*/
|
|
244
245
|
async acquireTokenSilent(
|
|
@@ -271,7 +272,7 @@ export class PublicClientApplication
|
|
|
271
272
|
|
|
272
273
|
/**
|
|
273
274
|
* Removes cache artifacts associated with the given account
|
|
274
|
-
* @param request
|
|
275
|
+
* @param request - developer provided SignOutRequest
|
|
275
276
|
* @returns
|
|
276
277
|
*/
|
|
277
278
|
async signOut(request: SignOutRequest): Promise<void> {
|
|
@@ -307,7 +308,7 @@ export class PublicClientApplication
|
|
|
307
308
|
|
|
308
309
|
/**
|
|
309
310
|
* Attempts to retrieve the redirectUri from the loopback server. If the loopback server does not start listening for requests within the timeout this will throw.
|
|
310
|
-
* @param loopbackClient
|
|
311
|
+
* @param loopbackClient - developer provided custom loopback server implementation
|
|
311
312
|
* @returns
|
|
312
313
|
*/
|
|
313
314
|
private async waitForRedirectUri(
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
/**
|
|
27
27
|
* Oauth2.0 Password grant client
|
|
28
28
|
* Note: We are only supporting public clients for password grant and for purely testing purposes
|
|
29
|
+
* @public
|
|
29
30
|
*/
|
|
30
31
|
export class UsernamePasswordClient extends BaseClient {
|
|
31
32
|
constructor(configuration: ClientConfiguration) {
|
|
@@ -35,7 +36,7 @@ export class UsernamePasswordClient extends BaseClient {
|
|
|
35
36
|
/**
|
|
36
37
|
* API to acquire a token by passing the username and password to the service in exchage of credentials
|
|
37
38
|
* password_grant
|
|
38
|
-
* @param request
|
|
39
|
+
* @param request - CommonUsernamePasswordRequest
|
|
39
40
|
*/
|
|
40
41
|
async acquireToken(
|
|
41
42
|
request: CommonUsernamePasswordRequest
|
|
@@ -71,8 +72,8 @@ export class UsernamePasswordClient extends BaseClient {
|
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* Executes POST request to token endpoint
|
|
74
|
-
* @param authority
|
|
75
|
-
* @param request
|
|
75
|
+
* @param authority - authority object
|
|
76
|
+
* @param request - CommonUsernamePasswordRequest provided by the developer
|
|
76
77
|
*/
|
|
77
78
|
private async executeTokenRequest(
|
|
78
79
|
authority: Authority,
|
|
@@ -111,7 +112,7 @@ export class UsernamePasswordClient extends BaseClient {
|
|
|
111
112
|
|
|
112
113
|
/**
|
|
113
114
|
* Generates a map for all the params to be sent to the service
|
|
114
|
-
* @param request
|
|
115
|
+
* @param request - CommonUsernamePasswordRequest provided by the developer
|
|
115
116
|
*/
|
|
116
117
|
private async createTokenRequestBody(
|
|
117
118
|
request: CommonUsernamePasswordRequest
|
|
@@ -104,6 +104,7 @@ export type NodeSystemOptions = {
|
|
|
104
104
|
disableInternalRetries?: boolean;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
+
/** @public */
|
|
107
108
|
export type NodeTelemetryOptions = {
|
|
108
109
|
application?: ApplicationTelemetry;
|
|
109
110
|
};
|
|
@@ -126,12 +127,14 @@ export type Configuration = {
|
|
|
126
127
|
telemetry?: NodeTelemetryOptions;
|
|
127
128
|
};
|
|
128
129
|
|
|
130
|
+
/** @public */
|
|
129
131
|
export type ManagedIdentityIdParams = {
|
|
130
132
|
userAssignedClientId?: string;
|
|
131
133
|
userAssignedResourceId?: string;
|
|
132
134
|
userAssignedObjectId?: string;
|
|
133
135
|
};
|
|
134
136
|
|
|
137
|
+
/** @public */
|
|
135
138
|
export type ManagedIdentityConfiguration = {
|
|
136
139
|
managedIdentityIdParams?: ManagedIdentityIdParams;
|
|
137
140
|
system?: NodeSystemOptions;
|
|
@@ -242,6 +245,7 @@ export function buildAppConfiguration({
|
|
|
242
245
|
};
|
|
243
246
|
}
|
|
244
247
|
|
|
248
|
+
/** @internal */
|
|
245
249
|
export type ManagedIdentityNodeConfiguration = {
|
|
246
250
|
managedIdentityId: ManagedIdentityId;
|
|
247
251
|
system: Required<
|
|
@@ -34,7 +34,7 @@ export class CryptoProvider implements ICrypto {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Stringifies and base64Url encodes input public key
|
|
37
|
-
* @param inputKid
|
|
37
|
+
* @param inputKid - public key id
|
|
38
38
|
* @returns Base64Url encoded public key
|
|
39
39
|
*/
|
|
40
40
|
encodeKid(): string {
|
|
@@ -81,7 +81,7 @@ export class CryptoProvider implements ICrypto {
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Removes cryptographic keypair from key store matching the keyId passed in
|
|
84
|
-
* @param kid
|
|
84
|
+
* @param kid - public key id
|
|
85
85
|
*/
|
|
86
86
|
removeTokenBindingKey(): Promise<boolean> {
|
|
87
87
|
throw new Error("Method not implemented.");
|
package/src/index.ts
CHANGED
package/src/packageMetadata.ts
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* ManagedIdentityRequest
|
|
8
8
|
* - claims - a stringified claims request which will be used to determine whether or not the cache should be skipped
|
|
9
9
|
* - forceRefresh - forces managed identity requests to skip the cache and make network calls if true
|
|
10
|
-
* - resource - resource requested to access the protected API. It should be of the form "
|
|
10
|
+
* - resource - resource requested to access the protected API. It should be of the form "ResourceIdUri" or "ResourceIdUri/.default". For instance https://management.azure.net or, for Microsoft Graph, https://graph.microsoft.com/.default
|
|
11
|
+
* @public
|
|
11
12
|
*/
|
|
12
13
|
export type ManagedIdentityRequestParams = {
|
|
13
14
|
claims?: string;
|
package/src/utils/Constants.ts
CHANGED
|
@@ -82,6 +82,7 @@ export type ProxyStatus = (typeof ProxyStatus)[keyof typeof ProxyStatus];
|
|
|
82
82
|
* Constants used for region discovery
|
|
83
83
|
*/
|
|
84
84
|
export const REGION_ENVIRONMENT_VARIABLE = "REGION_NAME";
|
|
85
|
+
export const MSAL_FORCE_REGION = "MSAL_FORCE_REGION";
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
88
|
* Constant used for PKCE
|
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { NetworkResponse } from "@azure/msal-common/node";
|
|
7
|
+
|
|
8
|
+
export type UrlToHttpRequestOptions = {
|
|
9
|
+
protocol: string;
|
|
10
|
+
hostname: string;
|
|
11
|
+
hash: string;
|
|
12
|
+
search: string;
|
|
13
|
+
pathname: string;
|
|
14
|
+
path: string;
|
|
15
|
+
href: string;
|
|
16
|
+
port?: number;
|
|
17
|
+
auth?: string;
|
|
18
|
+
};
|
|
10
19
|
|
|
11
20
|
export class NetworkUtils {
|
|
12
21
|
static getNetworkResponse<T>(
|