@azure/msal-node 2.2.0-alpha.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/cache/ITokenCache.d.ts +15 -15
  2. package/dist/cache/NodeStorage.cjs +401 -401
  3. package/dist/cache/NodeStorage.cjs.map +1 -1
  4. package/dist/cache/NodeStorage.d.ts +182 -182
  5. package/dist/cache/NodeStorage.d.ts.map +1 -1
  6. package/dist/cache/NodeStorage.mjs +401 -401
  7. package/dist/cache/NodeStorage.mjs.map +1 -1
  8. package/dist/cache/TokenCache.cjs +265 -265
  9. package/dist/cache/TokenCache.d.ts +90 -90
  10. package/dist/cache/TokenCache.mjs +265 -265
  11. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  12. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  13. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  14. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  15. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  16. package/dist/cache/serializer/Deserializer.cjs +173 -173
  17. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  18. package/dist/cache/serializer/Deserializer.mjs +173 -173
  19. package/dist/cache/serializer/Serializer.cjs +134 -134
  20. package/dist/cache/serializer/Serializer.d.ts +39 -39
  21. package/dist/cache/serializer/Serializer.mjs +134 -134
  22. package/dist/cache/serializer/SerializerTypes.d.ts +101 -101
  23. package/dist/client/ClientApplication.cjs +333 -333
  24. package/dist/client/ClientApplication.cjs.map +1 -1
  25. package/dist/client/ClientApplication.d.ts +142 -142
  26. package/dist/client/ClientApplication.d.ts.map +1 -1
  27. package/dist/client/ClientApplication.mjs +334 -334
  28. package/dist/client/ClientApplication.mjs.map +1 -1
  29. package/dist/client/ClientAssertion.cjs +116 -116
  30. package/dist/client/ClientAssertion.d.ts +46 -46
  31. package/dist/client/ClientAssertion.mjs +116 -116
  32. package/dist/client/ClientCredentialClient.cjs +189 -189
  33. package/dist/client/ClientCredentialClient.d.ts +33 -33
  34. package/dist/client/ClientCredentialClient.mjs +189 -189
  35. package/dist/client/ConfidentialClientApplication.cjs +163 -163
  36. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  37. package/dist/client/ConfidentialClientApplication.mjs +163 -163
  38. package/dist/client/DeviceCodeClient.cjs +207 -207
  39. package/dist/client/DeviceCodeClient.d.ts +53 -53
  40. package/dist/client/DeviceCodeClient.mjs +207 -207
  41. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  42. package/dist/client/IPublicClientApplication.d.ts +42 -42
  43. package/dist/client/OnBehalfOfClient.cjs +202 -202
  44. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  45. package/dist/client/OnBehalfOfClient.mjs +202 -202
  46. package/dist/client/PublicClientApplication.cjs +229 -229
  47. package/dist/client/PublicClientApplication.d.ts +71 -71
  48. package/dist/client/PublicClientApplication.mjs +229 -229
  49. package/dist/client/UsernamePasswordClient.cjs +95 -95
  50. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  51. package/dist/client/UsernamePasswordClient.mjs +95 -95
  52. package/dist/config/Configuration.cjs +72 -72
  53. package/dist/config/Configuration.d.ts +107 -107
  54. package/dist/config/Configuration.mjs +72 -72
  55. package/dist/crypto/CryptoProvider.cjs +75 -75
  56. package/dist/crypto/CryptoProvider.d.ts +52 -52
  57. package/dist/crypto/CryptoProvider.mjs +75 -75
  58. package/dist/crypto/GuidGenerator.cjs +22 -22
  59. package/dist/crypto/GuidGenerator.d.ts +14 -14
  60. package/dist/crypto/GuidGenerator.mjs +22 -22
  61. package/dist/crypto/HashUtils.cjs +13 -13
  62. package/dist/crypto/HashUtils.d.ts +8 -8
  63. package/dist/crypto/HashUtils.mjs +13 -13
  64. package/dist/crypto/PkceGenerator.cjs +49 -49
  65. package/dist/crypto/PkceGenerator.d.ts +22 -22
  66. package/dist/crypto/PkceGenerator.mjs +49 -49
  67. package/dist/error/NodeAuthError.cjs +85 -85
  68. package/dist/error/NodeAuthError.d.ts +65 -65
  69. package/dist/error/NodeAuthError.mjs +85 -85
  70. package/dist/index.cjs +1 -1
  71. package/dist/index.d.ts +42 -42
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.mjs +1 -1
  74. package/dist/internals.cjs +8 -8
  75. package/dist/internals.d.ts +6 -6
  76. package/dist/internals.mjs +8 -8
  77. package/dist/network/HttpClient.cjs +276 -276
  78. package/dist/network/HttpClient.d.ts +25 -25
  79. package/dist/network/HttpClient.mjs +276 -276
  80. package/dist/network/ILoopbackClient.d.ts +10 -10
  81. package/dist/network/LoopbackClient.cjs +76 -75
  82. package/dist/network/LoopbackClient.cjs.map +1 -1
  83. package/dist/network/LoopbackClient.d.ts +21 -21
  84. package/dist/network/LoopbackClient.d.ts.map +1 -1
  85. package/dist/network/LoopbackClient.mjs +76 -75
  86. package/dist/network/LoopbackClient.mjs.map +1 -1
  87. package/dist/packageMetadata.cjs +4 -4
  88. package/dist/packageMetadata.d.ts +2 -2
  89. package/dist/packageMetadata.mjs +4 -4
  90. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  91. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  92. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  93. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  94. package/dist/request/InteractiveRequest.d.ts +22 -22
  95. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  96. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  97. package/dist/request/SignOutRequest.d.ts +5 -5
  98. package/dist/request/SilentFlowRequest.d.ts +16 -16
  99. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  100. package/dist/utils/Constants.cjs +80 -80
  101. package/dist/utils/Constants.d.ts +86 -86
  102. package/dist/utils/Constants.mjs +80 -80
  103. package/dist/utils/EncodingUtils.cjs +44 -44
  104. package/dist/utils/EncodingUtils.d.ts +26 -26
  105. package/dist/utils/EncodingUtils.mjs +44 -44
  106. package/dist/utils/NetworkUtils.cjs +38 -38
  107. package/dist/utils/NetworkUtils.d.ts +5 -5
  108. package/dist/utils/NetworkUtils.mjs +38 -38
  109. package/package.json +2 -2
  110. package/src/cache/NodeStorage.ts +8 -2
  111. package/src/client/ClientApplication.ts +3 -1
  112. package/src/index.ts +1 -0
  113. package/src/network/LoopbackClient.ts +1 -0
  114. package/src/packageMetadata.ts +1 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
1
+ /*! @azure/msal-node v2.3.0 2023-10-20 */
2
2
  'use strict';
3
3
  import { ClientApplication } from './ClientApplication.mjs';
4
4
  import { ClientAssertion } from './ClientAssertion.mjs';
@@ -7,168 +7,168 @@ import { OIDC_DEFAULT_SCOPES, UrlString, AADAuthorityConstants, createClientAuth
7
7
  import { ClientCredentialClient } from './ClientCredentialClient.mjs';
8
8
  import { OnBehalfOfClient } from './OnBehalfOfClient.mjs';
9
9
 
10
- /*
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License.
13
- */
14
- // AADAuthorityConstants
15
- /**
16
- * This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications
17
- * will configure application secrets, client certificates/assertions as applicable
18
- * @public
19
- */
20
- class ConfidentialClientApplication extends ClientApplication {
21
- /**
22
- * Constructor for the ConfidentialClientApplication
23
- *
24
- * Required attributes in the Configuration object are:
25
- * - clientID: the application ID of your application. You can obtain one by registering your application with our application registration portal
26
- * - authority: the authority URL for your application.
27
- * - client credential: Must set either client secret, certificate, or assertion for confidential clients. You can obtain a client secret from the application registration portal.
28
- *
29
- * In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
30
- * If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
31
- * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
32
- * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
33
- * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
34
- *
35
- * In Azure B2C, authority is of the form https://\{instance\}/tfp/\{tenant\}/\{policyName\}/
36
- * Full B2C functionality will be available in this library in future versions.
37
- *
38
- * @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
39
- */
40
- constructor(configuration) {
41
- super(configuration);
42
- this.setClientCredential(this.config);
43
- this.appTokenProvider = undefined;
44
- }
45
- /**
46
- * This extensibility point only works for the client_credential flow, i.e. acquireTokenByClientCredential and
47
- * is meant for Azure SDK to enhance Managed Identity support.
48
- *
49
- * @param IAppTokenProvider - Extensibility interface, which allows the app developer to return a token from a custom source.
50
- */
51
- SetAppTokenProvider(provider) {
52
- this.appTokenProvider = provider;
53
- }
54
- /**
55
- * Acquires tokens from the authority for the application (not for an end user).
56
- */
57
- async acquireTokenByClientCredential(request) {
58
- this.logger.info("acquireTokenByClientCredential called", request.correlationId);
59
- // If there is a client assertion present in the request, it overrides the one present in the client configuration
60
- let clientAssertion;
61
- if (request.clientAssertion) {
62
- clientAssertion = {
63
- assertion: request.clientAssertion,
64
- assertionType: Constants$1.JWT_BEARER_ASSERTION_TYPE,
65
- };
66
- }
67
- const baseRequest = await this.initializeBaseRequest(request);
68
- // valid base request should not contain oidc scopes in this grant type
69
- const validBaseRequest = {
70
- ...baseRequest,
71
- scopes: baseRequest.scopes.filter((scope) => !OIDC_DEFAULT_SCOPES.includes(scope)),
72
- };
73
- const validRequest = {
74
- ...request,
75
- ...validBaseRequest,
76
- clientAssertion,
77
- };
78
- /*
79
- * valid request should not have "common" or "organizations" in lieu of the tenant_id in the authority in the auth configuration
80
- * example authority: "https://login.microsoftonline.com/TenantId",
81
- */
82
- const authority = new UrlString(validRequest.authority);
83
- const tenantId = authority.getUrlComponents().PathSegments[0];
84
- if (Object.values(AADAuthorityConstants).includes(tenantId)) {
85
- throw createClientAuthError(ClientAuthErrorCodes.missingTenantIdError);
86
- }
87
- const azureRegionConfiguration = {
88
- azureRegion: validRequest.azureRegion,
89
- environmentRegion: process.env[REGION_ENVIRONMENT_VARIABLE],
90
- };
91
- const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByClientCredential, validRequest.correlationId, validRequest.skipCache);
92
- try {
93
- const clientCredentialConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, azureRegionConfiguration, request.azureCloudOptions);
94
- const clientCredentialClient = new ClientCredentialClient(clientCredentialConfig, this.appTokenProvider);
95
- this.logger.verbose("Client credential client created", validRequest.correlationId);
96
- return clientCredentialClient.acquireToken(validRequest);
97
- }
98
- catch (e) {
99
- if (e instanceof AuthError) {
100
- e.setCorrelationId(validRequest.correlationId);
101
- }
102
- serverTelemetryManager.cacheFailedRequest(e);
103
- throw e;
104
- }
105
- }
106
- /**
107
- * Acquires tokens from the authority for the application.
108
- *
109
- * Used in scenarios where the current app is a middle-tier service which was called with a token
110
- * representing an end user. The current app can use the token (oboAssertion) to request another
111
- * token to access downstream web API, on behalf of that user.
112
- *
113
- * The current middle-tier app has no user interaction to obtain consent.
114
- * See how to gain consent upfront for your middle-tier app from this article.
115
- * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow#gaining-consent-for-the-middle-tier-application
116
- */
117
- async acquireTokenOnBehalfOf(request) {
118
- this.logger.info("acquireTokenOnBehalfOf called", request.correlationId);
119
- const validRequest = {
120
- ...request,
121
- ...(await this.initializeBaseRequest(request)),
122
- };
123
- try {
124
- const onBehalfOfConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
125
- const oboClient = new OnBehalfOfClient(onBehalfOfConfig);
126
- this.logger.verbose("On behalf of client created", validRequest.correlationId);
127
- return oboClient.acquireToken(validRequest);
128
- }
129
- catch (e) {
130
- if (e instanceof AuthError) {
131
- e.setCorrelationId(validRequest.correlationId);
132
- }
133
- throw e;
134
- }
135
- }
136
- setClientCredential(configuration) {
137
- const clientSecretNotEmpty = !!configuration.auth.clientSecret;
138
- const clientAssertionNotEmpty = !!configuration.auth.clientAssertion;
139
- const certificate = configuration.auth.clientCertificate || {
140
- thumbprint: Constants.EMPTY_STRING,
141
- privateKey: Constants.EMPTY_STRING,
142
- };
143
- const certificateNotEmpty = !!certificate.thumbprint || !!certificate.privateKey;
144
- /*
145
- * If app developer configures this callback, they don't need a credential
146
- * i.e. AzureSDK can get token from Managed Identity without a cert / secret
147
- */
148
- if (this.appTokenProvider) {
149
- return;
150
- }
151
- // Check that at most one credential is set on the application
152
- if ((clientSecretNotEmpty && clientAssertionNotEmpty) ||
153
- (clientAssertionNotEmpty && certificateNotEmpty) ||
154
- (clientSecretNotEmpty && certificateNotEmpty)) {
155
- throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
156
- }
157
- if (configuration.auth.clientSecret) {
158
- this.clientSecret = configuration.auth.clientSecret;
159
- return;
160
- }
161
- if (configuration.auth.clientAssertion) {
162
- this.clientAssertion = ClientAssertion.fromAssertion(configuration.auth.clientAssertion);
163
- return;
164
- }
165
- if (!certificateNotEmpty) {
166
- throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
167
- }
168
- else {
169
- this.clientAssertion = ClientAssertion.fromCertificate(certificate.thumbprint, certificate.privateKey, configuration.auth.clientCertificate?.x5c);
170
- }
171
- }
10
+ /*
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License.
13
+ */
14
+ // AADAuthorityConstants
15
+ /**
16
+ * This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications
17
+ * will configure application secrets, client certificates/assertions as applicable
18
+ * @public
19
+ */
20
+ class ConfidentialClientApplication extends ClientApplication {
21
+ /**
22
+ * Constructor for the ConfidentialClientApplication
23
+ *
24
+ * Required attributes in the Configuration object are:
25
+ * - clientID: the application ID of your application. You can obtain one by registering your application with our application registration portal
26
+ * - authority: the authority URL for your application.
27
+ * - client credential: Must set either client secret, certificate, or assertion for confidential clients. You can obtain a client secret from the application registration portal.
28
+ *
29
+ * In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
30
+ * If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
31
+ * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
32
+ * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
33
+ * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
34
+ *
35
+ * In Azure B2C, authority is of the form https://\{instance\}/tfp/\{tenant\}/\{policyName\}/
36
+ * Full B2C functionality will be available in this library in future versions.
37
+ *
38
+ * @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
39
+ */
40
+ constructor(configuration) {
41
+ super(configuration);
42
+ this.setClientCredential(this.config);
43
+ this.appTokenProvider = undefined;
44
+ }
45
+ /**
46
+ * This extensibility point only works for the client_credential flow, i.e. acquireTokenByClientCredential and
47
+ * is meant for Azure SDK to enhance Managed Identity support.
48
+ *
49
+ * @param IAppTokenProvider - Extensibility interface, which allows the app developer to return a token from a custom source.
50
+ */
51
+ SetAppTokenProvider(provider) {
52
+ this.appTokenProvider = provider;
53
+ }
54
+ /**
55
+ * Acquires tokens from the authority for the application (not for an end user).
56
+ */
57
+ async acquireTokenByClientCredential(request) {
58
+ this.logger.info("acquireTokenByClientCredential called", request.correlationId);
59
+ // If there is a client assertion present in the request, it overrides the one present in the client configuration
60
+ let clientAssertion;
61
+ if (request.clientAssertion) {
62
+ clientAssertion = {
63
+ assertion: request.clientAssertion,
64
+ assertionType: Constants$1.JWT_BEARER_ASSERTION_TYPE,
65
+ };
66
+ }
67
+ const baseRequest = await this.initializeBaseRequest(request);
68
+ // valid base request should not contain oidc scopes in this grant type
69
+ const validBaseRequest = {
70
+ ...baseRequest,
71
+ scopes: baseRequest.scopes.filter((scope) => !OIDC_DEFAULT_SCOPES.includes(scope)),
72
+ };
73
+ const validRequest = {
74
+ ...request,
75
+ ...validBaseRequest,
76
+ clientAssertion,
77
+ };
78
+ /*
79
+ * valid request should not have "common" or "organizations" in lieu of the tenant_id in the authority in the auth configuration
80
+ * example authority: "https://login.microsoftonline.com/TenantId",
81
+ */
82
+ const authority = new UrlString(validRequest.authority);
83
+ const tenantId = authority.getUrlComponents().PathSegments[0];
84
+ if (Object.values(AADAuthorityConstants).includes(tenantId)) {
85
+ throw createClientAuthError(ClientAuthErrorCodes.missingTenantIdError);
86
+ }
87
+ const azureRegionConfiguration = {
88
+ azureRegion: validRequest.azureRegion,
89
+ environmentRegion: process.env[REGION_ENVIRONMENT_VARIABLE],
90
+ };
91
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByClientCredential, validRequest.correlationId, validRequest.skipCache);
92
+ try {
93
+ const clientCredentialConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, azureRegionConfiguration, request.azureCloudOptions);
94
+ const clientCredentialClient = new ClientCredentialClient(clientCredentialConfig, this.appTokenProvider);
95
+ this.logger.verbose("Client credential client created", validRequest.correlationId);
96
+ return clientCredentialClient.acquireToken(validRequest);
97
+ }
98
+ catch (e) {
99
+ if (e instanceof AuthError) {
100
+ e.setCorrelationId(validRequest.correlationId);
101
+ }
102
+ serverTelemetryManager.cacheFailedRequest(e);
103
+ throw e;
104
+ }
105
+ }
106
+ /**
107
+ * Acquires tokens from the authority for the application.
108
+ *
109
+ * Used in scenarios where the current app is a middle-tier service which was called with a token
110
+ * representing an end user. The current app can use the token (oboAssertion) to request another
111
+ * token to access downstream web API, on behalf of that user.
112
+ *
113
+ * The current middle-tier app has no user interaction to obtain consent.
114
+ * See how to gain consent upfront for your middle-tier app from this article.
115
+ * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow#gaining-consent-for-the-middle-tier-application
116
+ */
117
+ async acquireTokenOnBehalfOf(request) {
118
+ this.logger.info("acquireTokenOnBehalfOf called", request.correlationId);
119
+ const validRequest = {
120
+ ...request,
121
+ ...(await this.initializeBaseRequest(request)),
122
+ };
123
+ try {
124
+ const onBehalfOfConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
125
+ const oboClient = new OnBehalfOfClient(onBehalfOfConfig);
126
+ this.logger.verbose("On behalf of client created", validRequest.correlationId);
127
+ return oboClient.acquireToken(validRequest);
128
+ }
129
+ catch (e) {
130
+ if (e instanceof AuthError) {
131
+ e.setCorrelationId(validRequest.correlationId);
132
+ }
133
+ throw e;
134
+ }
135
+ }
136
+ setClientCredential(configuration) {
137
+ const clientSecretNotEmpty = !!configuration.auth.clientSecret;
138
+ const clientAssertionNotEmpty = !!configuration.auth.clientAssertion;
139
+ const certificate = configuration.auth.clientCertificate || {
140
+ thumbprint: Constants.EMPTY_STRING,
141
+ privateKey: Constants.EMPTY_STRING,
142
+ };
143
+ const certificateNotEmpty = !!certificate.thumbprint || !!certificate.privateKey;
144
+ /*
145
+ * If app developer configures this callback, they don't need a credential
146
+ * i.e. AzureSDK can get token from Managed Identity without a cert / secret
147
+ */
148
+ if (this.appTokenProvider) {
149
+ return;
150
+ }
151
+ // Check that at most one credential is set on the application
152
+ if ((clientSecretNotEmpty && clientAssertionNotEmpty) ||
153
+ (clientAssertionNotEmpty && certificateNotEmpty) ||
154
+ (clientSecretNotEmpty && certificateNotEmpty)) {
155
+ throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
156
+ }
157
+ if (configuration.auth.clientSecret) {
158
+ this.clientSecret = configuration.auth.clientSecret;
159
+ return;
160
+ }
161
+ if (configuration.auth.clientAssertion) {
162
+ this.clientAssertion = ClientAssertion.fromAssertion(configuration.auth.clientAssertion);
163
+ return;
164
+ }
165
+ if (!certificateNotEmpty) {
166
+ throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
167
+ }
168
+ else {
169
+ this.clientAssertion = ClientAssertion.fromCertificate(certificate.thumbprint, certificate.privateKey, configuration.auth.clientCertificate?.x5c);
170
+ }
171
+ }
172
172
  }
173
173
 
174
174
  export { ConfidentialClientApplication };