@azure/msal-node 3.3.0 → 3.4.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.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
- package/dist/cache/serializer/Deserializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/client/ClientApplication.d.ts +3 -3
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +16 -17
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +16 -16
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +5 -3
- package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +24 -24
- 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/MachineLearning.mjs +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +19 -19
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +3 -2
- package/dist/client/PublicClientApplication.mjs.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +21 -21
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +8 -8
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- 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 +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +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/ILoopbackClient.d.ts +2 -2
- package/dist/network/ILoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.d.ts +2 -2
- package/dist/network/LoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.mjs +3 -2
- package/dist/network/LoopbackClient.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.d.ts +12 -0
- package/dist/protocol/Authorize.d.ts.map +1 -0
- package/dist/protocol/Authorize.mjs +43 -0
- package/dist/protocol/Authorize.mjs.map +1 -0
- package/dist/retry/LinearRetryPolicy.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/lib/msal-node.cjs +863 -933
- package/lib/msal-node.cjs.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.map +1 -1
- package/lib/types/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
- package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -1
- package/lib/types/client/PublicClientApplication.d.ts.map +1 -1
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/lib/types/index.d.ts +5 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/network/ILoopbackClient.d.ts +2 -2
- package/lib/types/network/ILoopbackClient.d.ts.map +1 -1
- package/lib/types/network/LoopbackClient.d.ts +2 -2
- package/lib/types/network/LoopbackClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/protocol/Authorize.d.ts +12 -0
- package/lib/types/protocol/Authorize.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/client/ClientApplication.ts +44 -44
- package/src/client/ClientCredentialClient.ts +32 -14
- package/src/client/ConfidentialClientApplication.ts +15 -7
- package/src/client/DeviceCodeClient.ts +46 -24
- package/src/client/OnBehalfOfClient.ts +38 -17
- package/src/client/PublicClientApplication.ts +9 -5
- package/src/client/UsernamePasswordClient.ts +41 -19
- package/src/config/ManagedIdentityRequestParameters.ts +17 -7
- package/src/index.ts +5 -2
- package/src/network/ILoopbackClient.ts +2 -2
- package/src/network/LoopbackClient.ts +43 -46
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +69 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Authority,
|
|
8
|
+
AuthorizeProtocol,
|
|
9
|
+
CommonAuthorizationUrlRequest,
|
|
10
|
+
Logger,
|
|
11
|
+
OAuthResponseType,
|
|
12
|
+
ProtocolMode,
|
|
13
|
+
RequestParameterBuilder,
|
|
14
|
+
} from "@azure/msal-common/node";
|
|
15
|
+
import { NodeConfiguration } from "../config/Configuration.js";
|
|
16
|
+
import { Constants as NodeConstants } from "../utils/Constants.js";
|
|
17
|
+
import { version } from "../packageMetadata.js";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Constructs the full /authorize URL with request parameters
|
|
21
|
+
* @param config
|
|
22
|
+
* @param authority
|
|
23
|
+
* @param request
|
|
24
|
+
* @param logger
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export function getAuthCodeRequestUrl(
|
|
28
|
+
config: NodeConfiguration,
|
|
29
|
+
authority: Authority,
|
|
30
|
+
request: CommonAuthorizationUrlRequest,
|
|
31
|
+
logger: Logger
|
|
32
|
+
): string {
|
|
33
|
+
const parameters = AuthorizeProtocol.getStandardAuthorizeRequestParameters(
|
|
34
|
+
{
|
|
35
|
+
...config.auth,
|
|
36
|
+
authority: authority,
|
|
37
|
+
redirectUri: request.redirectUri || "",
|
|
38
|
+
},
|
|
39
|
+
request,
|
|
40
|
+
logger
|
|
41
|
+
);
|
|
42
|
+
RequestParameterBuilder.addLibraryInfo(parameters, {
|
|
43
|
+
sku: NodeConstants.MSAL_SKU,
|
|
44
|
+
version: version,
|
|
45
|
+
cpu: process.arch || "",
|
|
46
|
+
os: process.platform || "",
|
|
47
|
+
});
|
|
48
|
+
if (config.auth.protocolMode !== ProtocolMode.OIDC) {
|
|
49
|
+
RequestParameterBuilder.addApplicationTelemetry(
|
|
50
|
+
parameters,
|
|
51
|
+
config.telemetry.application
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
RequestParameterBuilder.addResponseType(parameters, OAuthResponseType.CODE);
|
|
55
|
+
if (request.codeChallenge && request.codeChallengeMethod) {
|
|
56
|
+
RequestParameterBuilder.addCodeChallengeParams(
|
|
57
|
+
parameters,
|
|
58
|
+
request.codeChallenge,
|
|
59
|
+
request.codeChallengeMethod
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
RequestParameterBuilder.addExtraQueryParameters(
|
|
64
|
+
parameters,
|
|
65
|
+
request.extraQueryParameters || {}
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return AuthorizeProtocol.getAuthorizeUrl(authority, parameters);
|
|
69
|
+
}
|