Skip to content

SQL Server throws class not found exception for Entra authentication #25042

@lukmanulhakkeem

Description

@lukmanulhakkeem

I tried connecting to SQL Server using the property authentication=ActiveDirectoryServicePrincipal in the JDBC connection URL for Entra authentication, but I'm encountering the following error:

presto> show schemas from sqlserver;
Query 20250326_070238_00000_ah6qe failed: Failed to load MSAL4J Java library for performing ActiveDirectoryServicePrincipal authentication.
com.facebook.presto.spi.PrestoException: Failed to load MSAL4J Java library for performing ActiveDirectoryServicePrincipal authentication.
	at com.facebook.presto.plugin.jdbc.BaseJdbcClient.getSchemaNames(BaseJdbcClient.java:191)
	at com.facebook.presto.plugin.jdbc.JdbcMetadata.listSchemaNames(JdbcMetadata.java:90)
	at com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorMetadata.listSchemaNames(ClassLoaderSafeConnectorMetadata.java:223)
	at com.facebook.presto.metadata.MetadataManager.listSchemaNames(MetadataManager.java:303)
	at com.facebook.presto.connector.informationSchema.InformationSchemaMetadata.calculatePrefixesWithSchemaName(InformationSchemaMetadata.java:311)
	at com.facebook.presto.connector.informationSchema.InformationSchemaMetadata.getTableLayouts(InformationSchemaMetadata.java:270)
	at com.facebook.presto.metadata.MetadataManager.getLayout(MetadataManager.java:370)
	at com.facebook.presto.sql.planner.iterative.rule.PickTableLayout$PickTableLayoutWithoutPredicate.apply(PickTableLayout.java:211)
	at com.facebook.presto.sql.planner.iterative.rule.PickTableLayout$PickTableLayoutWithoutPredicate.apply(PickTableLayout.java:176)
	at com.facebook.presto.sql.planner.iterative.IterativeOptimizer.transform(IterativeOptimizer.java:246)
	at com.facebook.presto.sql.planner.iterative.IterativeOptimizer.exploreNode(IterativeOptimizer.java:187)

It seems like we need to add the Msal4j dependencies to support this

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🆕 Unprioritized

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions