com.microsoft.aad.msal4j.PublicClientApplication [Correlation ID: 81396d1b-0539-4a18-a1d0-7395a15167bb] Execution of class com.microsoft.aad.msal4j.AcquireTokenByAuthorizationGrantSupplier failed.

Munot, Sneha 0 Reputation points
2023-06-13T08:51:09.01+00:00

Hi Team

We are trying to run the Monitoring Project in Ataccama data quality tool, but we are getting below error:

Database is azure sql db

 com.microsoft.aad.msal4j.PublicClientApplication [Correlation ID: 81396d1b-0539-4a18-a1d0-7395a15167bb] Execution of class com.microsoft.aad.msal4j.AcquireTokenByAuthorizationGrantSupplier failed.
Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,280 Reputation points MVP Volunteer Moderator
    2023-06-13T21:51:47.5333333+00:00

    based on the following references

    https://stackoverflow.com/questions/61182165/execution-of-class-com-microsoft-aad-msal4j-acquiretokenbyauthorizationgrantsupp

    https://stackoverflow.com/questions/38641309/azure-sql-database-connection-issues

    Specifically, the class com.microsoft.aad.msal4j.AcquireTokenByAuthorizationGrantSupplier is responsible for acquiring tokens using an authorization grant, and its execution has failed.

    Some possible solutions suggested by users who have encountered similar issues include:

    • If you're running Java version 13 or above, you can add the JVM option -Dsun.security.jgss.native=true to enable the new GSSAPI.
    • You can change the registry value \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters\AllowTgtSessionKey to 1.
    • You can run kinit in a command prompt, which will cache a Kerberos ticket in C:\Users<user>\krb5cc_<user>, and Java should be able to use it.
    • Another potential solution (though it has not been tested by the user who suggested it) is to disable Credential Guard.

    Note that apart from the first solution, the security implications are not clear, so you should carefully consider these solutions and test them in a controlled environment before deploying them in a production environment.

    As for connecting to an Azure SQL database, recommended best practices include:

    • Ensuring you have the latest version of your client drivers.
    • Turning on encryption and turning off the 'trust server certificate' setting.
    • Opening ports #1433 and #1100-114999.
    • Setting a 30s connection timeout.
    • Explicitly specifying the TCP protocol (as SQL DB only supports TCP).
    • Using a connection pool.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.