@azure/msal-node 5.0.0-alpha.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/NodeStorage.mjs +1 -1
- package/dist/cache/NodeStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
- package/dist/cache/serializer/Deserializer.mjs +1 -1
- package/dist/cache/serializer/Deserializer.mjs.map +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/cache/serializer/Serializer.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +42 -0
- package/dist/client/BaseClient.d.ts.map +1 -0
- package/dist/client/BaseClient.mjs +68 -0
- package/dist/client/BaseClient.mjs.map +1 -0
- package/dist/client/ClientApplication.mjs +1 -1
- package/dist/client/ClientApplication.mjs.map +1 -1
- package/dist/client/ClientAssertion.mjs +1 -1
- package/dist/client/ClientAssertion.mjs.map +1 -1
- package/dist/client/ClientCredentialClient.d.ts +2 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +4 -3
- package/dist/client/ClientCredentialClient.mjs.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +1 -1
- package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts +2 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +6 -5
- package/dist/client/DeviceCodeClient.mjs.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +1 -1
- package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentityClient.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.d.ts +54 -0
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +55 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +82 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +81 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +55 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.d.ts +44 -22
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +44 -22
- package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
- package/dist/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs +66 -1
- package/dist/client/ManagedIdentitySources/MachineLearning.mjs.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +57 -23
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -1
- package/dist/client/OnBehalfOfClient.d.ts +2 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +4 -3
- package/dist/client/OnBehalfOfClient.mjs.map +1 -1
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +21 -5
- package/dist/client/PublicClientApplication.mjs.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts +2 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +4 -3
- package/dist/client/UsernamePasswordClient.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +0 -6
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +3 -5
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityId.mjs.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +3 -3
- package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/CryptoProvider.mjs.map +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/GuidGenerator.mjs.map +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/HashUtils.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs +1 -1
- package/dist/error/ManagedIdentityError.mjs.map +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
- package/dist/error/NodeAuthError.d.ts +8 -0
- package/dist/error/NodeAuthError.d.ts.map +1 -1
- package/dist/error/NodeAuthError.mjs +11 -1
- package/dist/error/NodeAuthError.mjs.map +1 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.d.ts +54 -14
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +140 -262
- package/dist/network/HttpClient.mjs.map +1 -1
- package/dist/network/HttpClientWithRetries.mjs +1 -1
- package/dist/network/HttpClientWithRetries.mjs.map +1 -1
- package/dist/network/LoopbackClient.mjs +1 -1
- package/dist/network/LoopbackClient.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +2 -2
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts +12 -10
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts +6 -24
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/ClientCredentialRequest.d.ts +3 -6
- package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +10 -7
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +13 -10
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +8 -7
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +6 -8
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/dist/request/DeviceCodeRequest.d.ts +6 -6
- package/dist/request/DeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/InteractiveRequest.d.ts +19 -8
- package/dist/request/InteractiveRequest.d.ts.map +1 -1
- package/dist/request/ManagedIdentityRequest.d.ts +6 -2
- package/dist/request/ManagedIdentityRequest.d.ts.map +1 -1
- package/dist/request/ManagedIdentityRequestParams.d.ts +9 -3
- package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts +7 -6
- package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/RefreshTokenRequest.d.ts +9 -7
- package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/SilentFlowRequest.d.ts +6 -7
- package/dist/request/SilentFlowRequest.d.ts.map +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts +9 -8
- package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
- package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs +1 -1
- package/dist/retry/DefaultManagedIdentityRetryPolicy.mjs.map +1 -1
- package/dist/retry/ExponentialRetryStrategy.mjs +1 -1
- package/dist/retry/ExponentialRetryStrategy.mjs.map +1 -1
- package/dist/retry/ImdsRetryPolicy.mjs +1 -1
- package/dist/retry/ImdsRetryPolicy.mjs.map +1 -1
- package/dist/retry/LinearRetryStrategy.mjs +1 -1
- package/dist/retry/LinearRetryStrategy.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +2 -9
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +4 -12
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/EncodingUtils.mjs +1 -1
- package/dist/utils/EncodingUtils.mjs.map +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs.map +1 -1
- package/lib/msal-node.cjs +5788 -5371
- package/lib/msal-node.cjs.map +1 -1
- package/lib/types/client/BaseClient.d.ts +42 -0
- package/lib/types/client/BaseClient.d.ts.map +1 -0
- package/lib/types/client/ClientCredentialClient.d.ts +2 -1
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -1
- package/lib/types/client/DeviceCodeClient.d.ts +2 -1
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts +54 -0
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +81 -0
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +93 -2
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +54 -0
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts +44 -22
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts +65 -0
- package/lib/types/client/ManagedIdentitySources/MachineLearning.d.ts.map +1 -1
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +56 -22
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/lib/types/client/OnBehalfOfClient.d.ts +2 -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 +2 -1
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts +0 -6
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/error/NodeAuthError.d.ts +8 -0
- package/lib/types/error/NodeAuthError.d.ts.map +1 -1
- package/lib/types/index.d.ts +0 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/network/HttpClient.d.ts +54 -14
- package/lib/types/network/HttpClient.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/request/AuthorizationCodeRequest.d.ts +12 -10
- package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/lib/types/request/AuthorizationUrlRequest.d.ts +6 -24
- package/lib/types/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/lib/types/request/ClientCredentialRequest.d.ts +3 -6
- package/lib/types/request/ClientCredentialRequest.d.ts.map +1 -1
- package/lib/types/request/CommonClientCredentialRequest.d.ts +10 -7
- package/lib/types/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/lib/types/request/CommonDeviceCodeRequest.d.ts +13 -10
- package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts +8 -7
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts +6 -8
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/lib/types/request/DeviceCodeRequest.d.ts +6 -6
- package/lib/types/request/DeviceCodeRequest.d.ts.map +1 -1
- package/lib/types/request/InteractiveRequest.d.ts +19 -8
- package/lib/types/request/InteractiveRequest.d.ts.map +1 -1
- package/lib/types/request/ManagedIdentityRequest.d.ts +6 -2
- package/lib/types/request/ManagedIdentityRequest.d.ts.map +1 -1
- package/lib/types/request/ManagedIdentityRequestParams.d.ts +9 -3
- package/lib/types/request/ManagedIdentityRequestParams.d.ts.map +1 -1
- package/lib/types/request/OnBehalfOfRequest.d.ts +7 -6
- package/lib/types/request/OnBehalfOfRequest.d.ts.map +1 -1
- package/lib/types/request/RefreshTokenRequest.d.ts +9 -7
- package/lib/types/request/RefreshTokenRequest.d.ts.map +1 -1
- package/lib/types/request/SilentFlowRequest.d.ts +6 -7
- package/lib/types/request/SilentFlowRequest.d.ts.map +1 -1
- package/lib/types/request/UsernamePasswordRequest.d.ts +9 -8
- package/lib/types/request/UsernamePasswordRequest.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +2 -9
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/package.json +88 -88
- package/src/client/BaseClient.ts +158 -0
- package/src/client/ClientCredentialClient.ts +2 -3
- package/src/client/DeviceCodeClient.ts +4 -5
- package/src/client/ManagedIdentitySources/AppService.ts +54 -0
- package/src/client/ManagedIdentitySources/AzureArc.ts +81 -0
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +92 -2
- package/src/client/ManagedIdentitySources/CloudShell.ts +54 -0
- package/src/client/ManagedIdentitySources/Imds.ts +43 -21
- package/src/client/ManagedIdentitySources/MachineLearning.ts +65 -0
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +56 -22
- package/src/client/OnBehalfOfClient.ts +2 -3
- package/src/client/PublicClientApplication.ts +22 -4
- package/src/client/UsernamePasswordClient.ts +2 -3
- package/src/config/Configuration.ts +2 -14
- package/src/config/ManagedIdentityRequestParameters.ts +2 -2
- package/src/error/NodeAuthError.ts +14 -0
- package/src/index.ts +0 -8
- package/src/network/HttpClient.ts +166 -372
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +1 -1
- package/src/request/AuthorizationCodeRequest.ts +12 -10
- package/src/request/AuthorizationUrlRequest.ts +6 -24
- package/src/request/ClientCredentialRequest.ts +3 -6
- package/src/request/CommonClientCredentialRequest.ts +13 -7
- package/src/request/CommonDeviceCodeRequest.ts +13 -14
- package/src/request/CommonOnBehalfOfRequest.ts +11 -7
- package/src/request/CommonUsernamePasswordRequest.ts +6 -8
- package/src/request/DeviceCodeRequest.ts +6 -6
- package/src/request/InteractiveRequest.ts +19 -11
- package/src/request/ManagedIdentityRequest.ts +6 -2
- package/src/request/ManagedIdentityRequestParams.ts +9 -3
- package/src/request/OnBehalfOfRequest.ts +7 -6
- package/src/request/RefreshTokenRequest.ts +9 -7
- package/src/request/SilentFlowRequest.ts +6 -7
- package/src/request/UsernamePasswordRequest.ts +9 -8
- package/src/utils/Constants.ts +2 -11
- package/dist/utils/NetworkUtils.mjs +0 -43
- package/dist/utils/NetworkUtils.mjs.map +0 -1
|
@@ -26,19 +26,26 @@ const DEFAULT_IMDS_ENDPOINT: string = `http://169.254.169.254${IMDS_TOKEN_PATH}`
|
|
|
26
26
|
const IMDS_API_VERSION: string = "2018-02-01";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
+
* Managed Identity source implementation for Azure Instance Metadata Service (IMDS).
|
|
30
|
+
*
|
|
31
|
+
* IMDS is available on Azure Virtual Machines and Virtual Machine Scale Sets and provides
|
|
32
|
+
* a REST endpoint to obtain OAuth tokens for managed identities. This implementation
|
|
33
|
+
* handles both system-assigned and user-assigned managed identities.
|
|
34
|
+
*
|
|
29
35
|
* Original source of code: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/src/ImdsManagedIdentitySource.cs
|
|
30
36
|
*/
|
|
31
37
|
export class Imds extends BaseManagedIdentitySource {
|
|
32
38
|
private identityEndpoint: string;
|
|
33
39
|
|
|
34
40
|
/**
|
|
35
|
-
* Constructs an Imds instance.
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
41
|
+
* Constructs an Imds instance with the specified configuration.
|
|
42
|
+
*
|
|
43
|
+
* @param logger - Logger instance for recording debug information and errors
|
|
44
|
+
* @param nodeStorage - NodeStorage instance used for token caching operations
|
|
45
|
+
* @param networkClient - Network client implementation for making HTTP requests to IMDS
|
|
46
|
+
* @param cryptoProvider - CryptoProvider for generating correlation IDs and other cryptographic operations
|
|
47
|
+
* @param disableInternalRetries - When true, disables the built-in retry logic for IMDS requests
|
|
48
|
+
* @param identityEndpoint - The complete IMDS endpoint URL including the token path
|
|
42
49
|
*/
|
|
43
50
|
constructor(
|
|
44
51
|
logger: Logger,
|
|
@@ -60,16 +67,20 @@ export class Imds extends BaseManagedIdentitySource {
|
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
70
|
+
* Creates an Imds instance with the appropriate endpoint configuration.
|
|
71
|
+
*
|
|
72
|
+
* This method checks for the presence of the AZURE_POD_IDENTITY_AUTHORITY_HOST environment
|
|
73
|
+
* variable, which is used in Azure Kubernetes Service (AKS) environments with Azure AD
|
|
74
|
+
* Pod Identity. If found, it uses that endpoint; otherwise, it falls back to the standard
|
|
75
|
+
* IMDS endpoint (169.254.169.254).
|
|
76
|
+
*
|
|
77
|
+
* @param logger - Logger instance for recording endpoint discovery and validation
|
|
78
|
+
* @param nodeStorage - NodeStorage instance for token caching
|
|
79
|
+
* @param networkClient - Network client for HTTP requests
|
|
80
|
+
* @param cryptoProvider - CryptoProvider for cryptographic operations
|
|
81
|
+
* @param disableInternalRetries - Whether to disable built-in retry logic
|
|
66
82
|
*
|
|
67
|
-
* @
|
|
68
|
-
* @param nodeStorage - NodeStorage instance for caching.
|
|
69
|
-
* @param networkClient - Network client for HTTP requests.
|
|
70
|
-
* @param cryptoProvider - CryptoProvider for cryptographic operations.
|
|
71
|
-
* @param disableInternalRetries - Whether to disable internal retry logic.
|
|
72
|
-
* @returns An instance of Imds configured with the appropriate endpoint.
|
|
83
|
+
* @returns A configured Imds instance ready to make token requests
|
|
73
84
|
*/
|
|
74
85
|
public static tryCreate(
|
|
75
86
|
logger: Logger,
|
|
@@ -127,12 +138,23 @@ export class Imds extends BaseManagedIdentitySource {
|
|
|
127
138
|
}
|
|
128
139
|
|
|
129
140
|
/**
|
|
130
|
-
* Creates a
|
|
131
|
-
*
|
|
141
|
+
* Creates a properly configured HTTP request for acquiring an access token from IMDS.
|
|
142
|
+
*
|
|
143
|
+
* This method builds a complete request object with all necessary headers, query parameters,
|
|
144
|
+
* and retry policies required by the Azure Instance Metadata Service.
|
|
145
|
+
*
|
|
146
|
+
* Key request components:
|
|
147
|
+
* - HTTP GET method to the IMDS token endpoint
|
|
148
|
+
* - Metadata header set to "true" (required by IMDS)
|
|
149
|
+
* - API version parameter (currently "2018-02-01")
|
|
150
|
+
* - Resource parameter specifying the target audience
|
|
151
|
+
* - Identity-specific parameters for user-assigned managed identities
|
|
152
|
+
* - IMDS-specific retry policy
|
|
153
|
+
*
|
|
154
|
+
* @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
|
|
155
|
+
* @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
|
|
132
156
|
*
|
|
133
|
-
* @
|
|
134
|
-
* @param managedIdentityId - The managed identity ID (system-assigned or user-assigned).
|
|
135
|
-
* @returns A ManagedIdentityRequestParameters object configured for IMDS.
|
|
157
|
+
* @returns A configured ManagedIdentityRequestParameters object ready for network execution
|
|
136
158
|
*/
|
|
137
159
|
public createRequest(
|
|
138
160
|
resource: string,
|
|
@@ -25,10 +25,28 @@ const MACHINE_LEARNING_MSI_API_VERSION: string = "2017-09-01";
|
|
|
25
25
|
|
|
26
26
|
export const MANAGED_IDENTITY_MACHINE_LEARNING_UNSUPPORTED_ID_TYPE_ERROR = `Only client id is supported for user-assigned managed identity in ${ManagedIdentitySourceNames.MACHINE_LEARNING}.`; // referenced in unit test
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Machine Learning Managed Identity Source implementation for Azure Machine Learning environments.
|
|
30
|
+
*
|
|
31
|
+
* This class handles managed identity authentication specifically for Azure Machine Learning services.
|
|
32
|
+
* It supports both system-assigned and user-assigned managed identities, using the MSI_ENDPOINT
|
|
33
|
+
* and MSI_SECRET environment variables that are automatically provided in Azure ML environments.
|
|
34
|
+
*/
|
|
28
35
|
export class MachineLearning extends BaseManagedIdentitySource {
|
|
29
36
|
private msiEndpoint: string;
|
|
30
37
|
private secret: string;
|
|
31
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new MachineLearning managed identity source instance.
|
|
41
|
+
*
|
|
42
|
+
* @param logger - Logger instance for diagnostic information
|
|
43
|
+
* @param nodeStorage - Node storage implementation for caching
|
|
44
|
+
* @param networkClient - Network client for making HTTP requests
|
|
45
|
+
* @param cryptoProvider - Cryptographic operations provider
|
|
46
|
+
* @param disableInternalRetries - Whether to disable automatic request retries
|
|
47
|
+
* @param msiEndpoint - The MSI endpoint URL from environment variables
|
|
48
|
+
* @param secret - The MSI secret from environment variables
|
|
49
|
+
*/
|
|
32
50
|
constructor(
|
|
33
51
|
logger: Logger,
|
|
34
52
|
nodeStorage: NodeStorage,
|
|
@@ -50,6 +68,16 @@ export class MachineLearning extends BaseManagedIdentitySource {
|
|
|
50
68
|
this.secret = secret;
|
|
51
69
|
}
|
|
52
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves the required environment variables for Azure Machine Learning managed identity.
|
|
73
|
+
*
|
|
74
|
+
* This method checks for the presence of MSI_ENDPOINT and MSI_SECRET environment variables
|
|
75
|
+
* that are automatically set by the Azure Machine Learning platform when managed identity
|
|
76
|
+
* is enabled for the compute instance or cluster.
|
|
77
|
+
*
|
|
78
|
+
* @returns An array containing [msiEndpoint, secret] where either value may be undefined
|
|
79
|
+
* if the corresponding environment variable is not set
|
|
80
|
+
*/
|
|
53
81
|
public static getEnvironmentVariables(): Array<string | undefined> {
|
|
54
82
|
const msiEndpoint: string | undefined =
|
|
55
83
|
process.env[ManagedIdentityEnvironmentVariableNames.MSI_ENDPOINT];
|
|
@@ -60,6 +88,23 @@ export class MachineLearning extends BaseManagedIdentitySource {
|
|
|
60
88
|
return [msiEndpoint, secret];
|
|
61
89
|
}
|
|
62
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Attempts to create a MachineLearning managed identity source.
|
|
93
|
+
*
|
|
94
|
+
* This method validates the Azure Machine Learning environment by checking for the required
|
|
95
|
+
* MSI_ENDPOINT and MSI_SECRET environment variables. If both are present and valid,
|
|
96
|
+
* it creates and returns a MachineLearning instance. If either is missing or invalid,
|
|
97
|
+
* it returns null, indicating that this managed identity source is not available
|
|
98
|
+
* in the current environment.
|
|
99
|
+
*
|
|
100
|
+
* @param logger - Logger instance for diagnostic information
|
|
101
|
+
* @param nodeStorage - Node storage implementation for caching
|
|
102
|
+
* @param networkClient - Network client for making HTTP requests
|
|
103
|
+
* @param cryptoProvider - Cryptographic operations provider
|
|
104
|
+
* @param disableInternalRetries - Whether to disable automatic request retries
|
|
105
|
+
*
|
|
106
|
+
* @returns A new MachineLearning instance if the environment is valid, null otherwise
|
|
107
|
+
*/
|
|
63
108
|
public static tryCreate(
|
|
64
109
|
logger: Logger,
|
|
65
110
|
nodeStorage: NodeStorage,
|
|
@@ -102,6 +147,26 @@ export class MachineLearning extends BaseManagedIdentitySource {
|
|
|
102
147
|
);
|
|
103
148
|
}
|
|
104
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Creates a managed identity token request for Azure Machine Learning environments.
|
|
152
|
+
*
|
|
153
|
+
* This method constructs the HTTP request parameters needed to acquire an access token
|
|
154
|
+
* from the Azure Machine Learning managed identity endpoint. It handles both system-assigned
|
|
155
|
+
* and user-assigned managed identities with specific logic for each type:
|
|
156
|
+
*
|
|
157
|
+
* - System-assigned: Uses the DEFAULT_IDENTITY_CLIENT_ID environment variable
|
|
158
|
+
* - User-assigned: Only supports client ID-based identification (not object ID or resource ID)
|
|
159
|
+
*
|
|
160
|
+
* The request uses the 2017-09-01 API version and includes the required secret header
|
|
161
|
+
* for authentication with the MSI endpoint.
|
|
162
|
+
*
|
|
163
|
+
* @param resource - The target resource/scope for which to request an access token (e.g., "https://graph.microsoft.com/.default")
|
|
164
|
+
* @param managedIdentityId - The managed identity configuration specifying whether to use system-assigned or user-assigned identity
|
|
165
|
+
*
|
|
166
|
+
* @returns A configured ManagedIdentityRequestParameters object ready for network execution
|
|
167
|
+
*
|
|
168
|
+
* @throws Error if an unsupported managed identity ID type is specified (only client ID is supported for user-assigned)
|
|
169
|
+
*/
|
|
105
170
|
public createRequest(
|
|
106
171
|
resource: string,
|
|
107
172
|
managedIdentityId: ManagedIdentityId
|
|
@@ -28,14 +28,19 @@ export class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
28
28
|
private identityHeader: string;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Constructs a new ServiceFabric managed identity source.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
31
|
+
* Constructs a new ServiceFabric managed identity source for acquiring tokens from Azure Service Fabric clusters.
|
|
32
|
+
*
|
|
33
|
+
* Service Fabric managed identity allows applications running in Service Fabric clusters to authenticate
|
|
34
|
+
* without storing credentials in code. This source handles token acquisition using the Service Fabric
|
|
35
|
+
* Managed Identity Token Service (MITS).
|
|
36
|
+
*
|
|
37
|
+
* @param logger - Logger instance for logging authentication events and debugging information
|
|
38
|
+
* @param nodeStorage - NodeStorage instance for caching tokens and other authentication artifacts
|
|
39
|
+
* @param networkClient - Network client for making HTTP requests to the Service Fabric identity endpoint
|
|
40
|
+
* @param cryptoProvider - Crypto provider for cryptographic operations like token validation
|
|
41
|
+
* @param disableInternalRetries - Whether to disable internal retry logic for failed requests
|
|
42
|
+
* @param identityEndpoint - The Service Fabric managed identity endpoint URL
|
|
43
|
+
* @param identityHeader - The Service Fabric managed identity secret header value
|
|
39
44
|
*/
|
|
40
45
|
constructor(
|
|
41
46
|
logger: Logger,
|
|
@@ -59,8 +64,16 @@ export class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
/**
|
|
62
|
-
* Retrieves the environment variables required for Service Fabric managed identity.
|
|
63
|
-
*
|
|
67
|
+
* Retrieves the environment variables required for Service Fabric managed identity authentication.
|
|
68
|
+
*
|
|
69
|
+
* Service Fabric managed identity requires three specific environment variables to be set by the
|
|
70
|
+
* Service Fabric runtime:
|
|
71
|
+
* - IDENTITY_ENDPOINT: The endpoint URL for the Managed Identity Token Service (MITS)
|
|
72
|
+
* - IDENTITY_HEADER: A secret value used for authentication with the MITS
|
|
73
|
+
* - IDENTITY_SERVER_THUMBPRINT: The thumbprint of the MITS server certificate for secure communication
|
|
74
|
+
*
|
|
75
|
+
* @returns An array containing the identity endpoint, identity header, and identity server thumbprint values.
|
|
76
|
+
* Elements will be undefined if the corresponding environment variables are not set.
|
|
64
77
|
*/
|
|
65
78
|
public static getEnvironmentVariables(): Array<string | undefined> {
|
|
66
79
|
const identityEndpoint: string | undefined =
|
|
@@ -81,14 +94,23 @@ export class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
81
94
|
}
|
|
82
95
|
|
|
83
96
|
/**
|
|
84
|
-
* Attempts to create a ServiceFabric managed identity source if
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
97
|
+
* Attempts to create a ServiceFabric managed identity source if the runtime environment supports it.
|
|
98
|
+
*
|
|
99
|
+
* Checks for the presence of all required Service Fabric environment variables
|
|
100
|
+
* and validates the endpoint URL format. It will only create a ServiceFabric instance if the application
|
|
101
|
+
* is running in a properly configured Service Fabric cluster with managed identity enabled.
|
|
102
|
+
*
|
|
103
|
+
* Note: User-assigned managed identities must be configured at the cluster level, not at runtime.
|
|
104
|
+
* This method will log a warning if a user-assigned identity is requested.
|
|
105
|
+
*
|
|
106
|
+
* @param logger - Logger instance for logging creation events and validation results
|
|
107
|
+
* @param nodeStorage - NodeStorage instance for caching tokens and authentication artifacts
|
|
108
|
+
* @param networkClient - Network client for making HTTP requests to the identity endpoint
|
|
109
|
+
* @param cryptoProvider - Crypto provider for cryptographic operations
|
|
110
|
+
* @param disableInternalRetries - Whether to disable internal retry logic for failed requests
|
|
111
|
+
* @param managedIdentityId - Managed identity identifier specifying system-assigned or user-assigned identity
|
|
112
|
+
*
|
|
113
|
+
* @returns A ServiceFabric instance if all environment variables are valid and present, otherwise null
|
|
92
114
|
*/
|
|
93
115
|
public static tryCreate(
|
|
94
116
|
logger: Logger,
|
|
@@ -143,10 +165,22 @@ export class ServiceFabric extends BaseManagedIdentitySource {
|
|
|
143
165
|
}
|
|
144
166
|
|
|
145
167
|
/**
|
|
146
|
-
* Creates
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
168
|
+
* Creates HTTP request parameters for acquiring an access token from the Service Fabric Managed Identity Token Service (MITS).
|
|
169
|
+
*
|
|
170
|
+
* This method constructs a properly formatted HTTP GET request that includes:
|
|
171
|
+
* - The secret header for authentication with MITS
|
|
172
|
+
* - API version parameter for the Service Fabric MSI endpoint
|
|
173
|
+
* - Resource parameter specifying the target Azure service
|
|
174
|
+
* - Optional identity parameters for user-assigned managed identities
|
|
175
|
+
*
|
|
176
|
+
* The request follows the Service Fabric managed identity protocol and uses the 2019-07-01-preview API version.
|
|
177
|
+
* For user-assigned identities, the appropriate query parameter (client_id, object_id, or resource_id) is added
|
|
178
|
+
* based on the identity type.
|
|
179
|
+
*
|
|
180
|
+
* @param resource - The Azure resource URI for which the access token is requested (e.g., "https://vault.azure.net/")
|
|
181
|
+
* @param managedIdentityId - The managed identity configuration specifying system-assigned or user-assigned identity details
|
|
182
|
+
*
|
|
183
|
+
* @returns A configured ManagedIdentityRequestParameters object ready for network execution
|
|
150
184
|
*/
|
|
151
185
|
public createRequest(
|
|
152
186
|
resource: string,
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
AuthenticationResult,
|
|
12
12
|
Authority,
|
|
13
13
|
AuthToken,
|
|
14
|
-
BaseClient,
|
|
15
14
|
ClientAuthErrorCodes,
|
|
16
15
|
ClientConfiguration,
|
|
17
16
|
createClientAuthError,
|
|
@@ -28,10 +27,10 @@ import {
|
|
|
28
27
|
ClientAssertion,
|
|
29
28
|
getClientAssertion,
|
|
30
29
|
UrlUtils,
|
|
31
|
-
StubPerformanceClient,
|
|
32
30
|
} from "@azure/msal-common/node";
|
|
33
31
|
import { EncodingUtils } from "../utils/EncodingUtils.js";
|
|
34
32
|
import { CommonOnBehalfOfRequest } from "../request/CommonOnBehalfOfRequest.js";
|
|
33
|
+
import { BaseClient } from "./BaseClient.js";
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* On-Behalf-Of client
|
|
@@ -42,7 +41,7 @@ export class OnBehalfOfClient extends BaseClient {
|
|
|
42
41
|
private userAssertionHash: string;
|
|
43
42
|
|
|
44
43
|
constructor(configuration: ClientConfiguration) {
|
|
45
|
-
super(configuration
|
|
44
|
+
super(configuration);
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
/**
|
|
@@ -161,12 +161,12 @@ export class PublicClientApplication
|
|
|
161
161
|
...remainingProperties,
|
|
162
162
|
clientId: this.config.auth.clientId,
|
|
163
163
|
scopes: request.scopes || CommonConstants.OIDC_DEFAULT_SCOPES,
|
|
164
|
-
redirectUri:
|
|
164
|
+
redirectUri: request.redirectUri || "",
|
|
165
165
|
authority: request.authority || this.config.auth.authority,
|
|
166
166
|
correlationId: correlationId,
|
|
167
167
|
extraParameters: {
|
|
168
168
|
...remainingProperties.extraQueryParameters,
|
|
169
|
-
...remainingProperties.
|
|
169
|
+
...remainingProperties.extraParameters,
|
|
170
170
|
[AADServerParamKeys.X_CLIENT_EXTRA_SKU]: this.skus,
|
|
171
171
|
},
|
|
172
172
|
accountId: remainingProperties.account?.nativeAccountId,
|
|
@@ -177,6 +177,15 @@ export class PublicClientApplication
|
|
|
177
177
|
);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
if (request.redirectUri) {
|
|
181
|
+
// If it's not a broker fallback scenario, we throw an error
|
|
182
|
+
if (!this.config.broker.nativeBrokerPlugin) {
|
|
183
|
+
throw NodeAuthError.createRedirectUriNotSupportedError();
|
|
184
|
+
}
|
|
185
|
+
// If a redirect URI is provided for a broker flow but MSAL runtime startup failed, we fall back to the browser flow and will ignore the redirect URI provided for the broker flow
|
|
186
|
+
request.redirectUri = "";
|
|
187
|
+
}
|
|
188
|
+
|
|
180
189
|
const { verifier, challenge } =
|
|
181
190
|
await this.cryptoProvider.generatePkceCodes();
|
|
182
191
|
|
|
@@ -257,11 +266,12 @@ export class PublicClientApplication
|
|
|
257
266
|
...request,
|
|
258
267
|
clientId: this.config.auth.clientId,
|
|
259
268
|
scopes: request.scopes || CommonConstants.OIDC_DEFAULT_SCOPES,
|
|
260
|
-
redirectUri:
|
|
269
|
+
redirectUri: request.redirectUri || "",
|
|
261
270
|
authority: request.authority || this.config.auth.authority,
|
|
262
271
|
correlationId: correlationId,
|
|
263
272
|
extraParameters: {
|
|
264
|
-
...request.
|
|
273
|
+
...request.extraQueryParameters,
|
|
274
|
+
...request.extraParameters,
|
|
265
275
|
[AADServerParamKeys.X_CLIENT_EXTRA_SKU]: this.skus,
|
|
266
276
|
},
|
|
267
277
|
accountId: request.account.nativeAccountId,
|
|
@@ -270,6 +280,14 @@ export class PublicClientApplication
|
|
|
270
280
|
return this.nativeBrokerPlugin.acquireTokenSilent(brokerRequest);
|
|
271
281
|
}
|
|
272
282
|
|
|
283
|
+
if (request.redirectUri) {
|
|
284
|
+
// If it's not a broker fallback scenario, we throw an error
|
|
285
|
+
if (!this.config.broker.nativeBrokerPlugin) {
|
|
286
|
+
throw NodeAuthError.createRedirectUriNotSupportedError();
|
|
287
|
+
}
|
|
288
|
+
request.redirectUri = "";
|
|
289
|
+
}
|
|
290
|
+
|
|
273
291
|
return super.acquireTokenSilent(request);
|
|
274
292
|
}
|
|
275
293
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import {
|
|
7
7
|
AuthenticationResult,
|
|
8
8
|
Authority,
|
|
9
|
-
BaseClient,
|
|
10
9
|
CcsCredentialType,
|
|
11
10
|
ClientAssertion,
|
|
12
11
|
ClientConfiguration,
|
|
@@ -21,9 +20,9 @@ import {
|
|
|
21
20
|
UrlString,
|
|
22
21
|
UrlUtils,
|
|
23
22
|
getClientAssertion,
|
|
24
|
-
StubPerformanceClient,
|
|
25
23
|
} from "@azure/msal-common/node";
|
|
26
24
|
import { CommonUsernamePasswordRequest } from "../request/CommonUsernamePasswordRequest.js";
|
|
25
|
+
import { BaseClient } from "./BaseClient.js";
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* Oauth2.0 Password grant client
|
|
@@ -33,7 +32,7 @@ import { CommonUsernamePasswordRequest } from "../request/CommonUsernamePassword
|
|
|
33
32
|
*/
|
|
34
33
|
export class UsernamePasswordClient extends BaseClient {
|
|
35
34
|
constructor(configuration: ClientConfiguration) {
|
|
36
|
-
super(configuration
|
|
35
|
+
super(configuration);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
/**
|
|
@@ -17,8 +17,6 @@ import {
|
|
|
17
17
|
Constants,
|
|
18
18
|
} from "@azure/msal-common/node";
|
|
19
19
|
import { HttpClient } from "../network/HttpClient.js";
|
|
20
|
-
import http from "http";
|
|
21
|
-
import https from "https";
|
|
22
20
|
import { ManagedIdentityId } from "./ManagedIdentityId.js";
|
|
23
21
|
import { NodeAuthError } from "../error/NodeAuthError.js";
|
|
24
22
|
|
|
@@ -85,8 +83,6 @@ export type BrokerOptions = {
|
|
|
85
83
|
export type NodeSystemOptions = {
|
|
86
84
|
loggerOptions?: LoggerOptions;
|
|
87
85
|
networkClient?: INetworkModule;
|
|
88
|
-
proxyUrl?: string;
|
|
89
|
-
customAgentOptions?: http.AgentOptions | https.AgentOptions;
|
|
90
86
|
disableInternalRetries?: boolean;
|
|
91
87
|
protocolMode?: ProtocolMode;
|
|
92
88
|
};
|
|
@@ -160,8 +156,6 @@ const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {
|
|
|
160
156
|
const DEFAULT_SYSTEM_OPTIONS: Required<NodeSystemOptions> = {
|
|
161
157
|
loggerOptions: DEFAULT_LOGGER_OPTIONS,
|
|
162
158
|
networkClient: new HttpClient(),
|
|
163
|
-
proxyUrl: "",
|
|
164
|
-
customAgentOptions: {} as http.AgentOptions | https.AgentOptions,
|
|
165
159
|
disableInternalRetries: false,
|
|
166
160
|
protocolMode: ProtocolMode.AAD,
|
|
167
161
|
};
|
|
@@ -202,10 +196,7 @@ export function buildAppConfiguration({
|
|
|
202
196
|
}: Configuration): NodeConfiguration {
|
|
203
197
|
const systemOptions: Required<NodeSystemOptions> = {
|
|
204
198
|
...DEFAULT_SYSTEM_OPTIONS,
|
|
205
|
-
networkClient: new HttpClient(
|
|
206
|
-
system?.proxyUrl,
|
|
207
|
-
system?.customAgentOptions as http.AgentOptions | https.AgentOptions
|
|
208
|
-
),
|
|
199
|
+
networkClient: new HttpClient(),
|
|
209
200
|
loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
|
|
210
201
|
disableInternalRetries: system?.disableInternalRetries || false,
|
|
211
202
|
};
|
|
@@ -256,10 +247,7 @@ export function buildManagedIdentityConfiguration({
|
|
|
256
247
|
networkClient = system.networkClient;
|
|
257
248
|
// otherwise, create a new one
|
|
258
249
|
} else {
|
|
259
|
-
networkClient = new HttpClient(
|
|
260
|
-
system?.proxyUrl,
|
|
261
|
-
system?.customAgentOptions as http.AgentOptions | https.AgentOptions
|
|
262
|
-
);
|
|
250
|
+
networkClient = new HttpClient();
|
|
263
251
|
}
|
|
264
252
|
|
|
265
253
|
return {
|
|
@@ -38,7 +38,7 @@ export class ManagedIdentityRequestParameters {
|
|
|
38
38
|
const parameters = new Map<string, string>();
|
|
39
39
|
|
|
40
40
|
if (this.queryParameters) {
|
|
41
|
-
RequestParameterBuilder.
|
|
41
|
+
RequestParameterBuilder.addExtraParameters(
|
|
42
42
|
parameters,
|
|
43
43
|
this.queryParameters
|
|
44
44
|
);
|
|
@@ -56,7 +56,7 @@ export class ManagedIdentityRequestParameters {
|
|
|
56
56
|
const parameters = new Map<string, string>();
|
|
57
57
|
|
|
58
58
|
if (this.bodyParameters) {
|
|
59
|
-
RequestParameterBuilder.
|
|
59
|
+
RequestParameterBuilder.addExtraParameters(
|
|
60
60
|
parameters,
|
|
61
61
|
this.bodyParameters
|
|
62
62
|
);
|
|
@@ -41,6 +41,10 @@ export const NodeAuthErrorMessage = {
|
|
|
41
41
|
code: "thumbprint_missing_from_client_certificate",
|
|
42
42
|
desc: "Client certificate does not contain a SHA-1 or SHA-256 thumbprint.",
|
|
43
43
|
},
|
|
44
|
+
redirectUriNotSupported: {
|
|
45
|
+
code: "redirect_uri_not_supported",
|
|
46
|
+
desc: "RedirectUri is not supported in this scenario. Please remove redirectUri from the request.",
|
|
47
|
+
},
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
export class NodeAuthError extends AuthError {
|
|
@@ -128,4 +132,14 @@ export class NodeAuthError extends AuthError {
|
|
|
128
132
|
NodeAuthErrorMessage.thumbprintMissing.desc
|
|
129
133
|
);
|
|
130
134
|
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Creates an error thrown when redirectUri is provided in an unsupported scenario
|
|
138
|
+
*/
|
|
139
|
+
static createRedirectUriNotSupportedError(): NodeAuthError {
|
|
140
|
+
return new NodeAuthError(
|
|
141
|
+
NodeAuthErrorMessage.redirectUriNotSupported.code,
|
|
142
|
+
NodeAuthErrorMessage.redirectUriNotSupported.desc
|
|
143
|
+
);
|
|
144
|
+
}
|
|
131
145
|
}
|
package/src/index.ts
CHANGED
|
@@ -27,12 +27,7 @@ export { ILoopbackClient } from "./network/ILoopbackClient.js";
|
|
|
27
27
|
// Clients and Configuration
|
|
28
28
|
export { PublicClientApplication } from "./client/PublicClientApplication.js";
|
|
29
29
|
export { ConfidentialClientApplication } from "./client/ConfidentialClientApplication.js";
|
|
30
|
-
export { ClientApplication } from "./client/ClientApplication.js";
|
|
31
|
-
export { ClientCredentialClient } from "./client/ClientCredentialClient.js";
|
|
32
|
-
export { DeviceCodeClient } from "./client/DeviceCodeClient.js";
|
|
33
|
-
export { OnBehalfOfClient } from "./client/OnBehalfOfClient.js";
|
|
34
30
|
export { ManagedIdentityApplication } from "./client/ManagedIdentityApplication.js";
|
|
35
|
-
export { UsernamePasswordClient } from "./client/UsernamePasswordClient.js";
|
|
36
31
|
|
|
37
32
|
export {
|
|
38
33
|
Configuration,
|
|
@@ -63,9 +58,6 @@ export { DistributedCachePlugin } from "./cache/distributed/DistributedCachePlug
|
|
|
63
58
|
// Constants
|
|
64
59
|
export { ManagedIdentitySourceNames } from "./utils/Constants.js";
|
|
65
60
|
|
|
66
|
-
// Crypto
|
|
67
|
-
export { CryptoProvider } from "./crypto/CryptoProvider.js";
|
|
68
|
-
|
|
69
61
|
// Request objects
|
|
70
62
|
export type { AuthorizationCodeRequest } from "./request/AuthorizationCodeRequest.js";
|
|
71
63
|
export type { AuthorizationUrlRequest } from "./request/AuthorizationUrlRequest.js";
|