I am using msal4j library on version 0.6.0-preview and java 8 in the repo.
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>msal4j</artifactId>
<version>0.6.0-preview</version>
</dependency>
This msal4j library is to set up Azure keyvault as well as kusto data ingestion.
Here's my code:
ConnectionStringBuilder csb = ConnectionStringBuilder.createWithAadApplicationCredentials(clusterPath, appId, appKey, authorityId);
Client kustoClient = ClientFactory.createClient(csb);
createClient()
failed because in TokenProviderFactory.java
, it is expecting createFromSecret()
but ClientCredentialFactory.java
does not have createFromSecret()
but create()
. Thus it is throwing me an error:
com.microsoft.aad.msal4j.ClientCredentialFactory.createFromSecret(Ljava/lang/String;)
Lcom/microsoft/aad/msal4j/IClientSecret;
| java.lang.NoSuchMethodError: com.microsoft.aad.msal4j.ClientCredentialFactory.createFromSecret(Ljava/lang/String;)
Lcom/microsoft/aad/msal4j/IClientSecret;
at com.microsoft.azure.kusto.data.auth.TokenProviderFactory.createTokenProvider(TokenProviderFactory.java:25)
at com.microsoft.azure.kusto.data.ClientImpl.<init>(ClientImpl.java:52)
at com.microsoft.azure.kusto.data.ClientFactory.createClient(ClientFactory.java:16)
Here's the limitations we face:
- We are not able to upgrade java 11 in our repo due to other dependencies so we are stuck with java 8.
- We are not able to upgrade the msal4j library to higher version due to other dependencies.
But regardless of that, why is the TokenProviderFactory.java
has the following code;
clientSecret clientSecret = ClientCredentialFactory.createFromSecret(csb.getApplicationKey());
But ClientCredentialFactory.java
does not have createFromSecret()
? What can we do as a workaround?