Package com.databricks.jdbc.auth
Class AzureMSICredentialProvider
- java.lang.Object
-
- com.databricks.jdbc.auth.AzureMSICredentialProvider
-
- All Implemented Interfaces:
com.databricks.sdk.core.CredentialsProvider
public class AzureMSICredentialProvider extends Object implements com.databricks.sdk.core.CredentialsProvider
Implementation of CredentialsProvider that uses Azure Managed Service Identity (MSI) for authentication with Databricks services.This provider obtains access tokens from Azure MSI and includes them in the request headers for Databricks API calls. It supports both resource ID-based authentication and direct token authentication.
When Azure Workspace Resource ID is provided, the provider will include both the resource ID and a management endpoint token in the request headers.
-
-
Constructor Summary
Constructors Constructor Description AzureMSICredentialProvider(IDatabricksConnectionContext connectionContext)Constructs a new AzureMSICredentialProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringauthType()Returns the authentication type identifier for this provider.com.databricks.sdk.core.HeaderFactoryconfigure(com.databricks.sdk.core.DatabricksConfig databricksConfig)Configures and returns a HeaderFactory that produces authentication headers for Databricks API requests.
-
-
-
Constructor Detail
-
AzureMSICredentialProvider
public AzureMSICredentialProvider(IDatabricksConnectionContext connectionContext)
Constructs a new AzureMSICredentialProvider.- Parameters:
connectionContext- The Databricks connection context containing authentication parameters such as client ID and Azure workspace resource ID.
-
-
Method Detail
-
authType
public String authType()
Returns the authentication type identifier for this provider.- Specified by:
authTypein interfacecom.databricks.sdk.core.CredentialsProvider- Returns:
- The string constant representing Azure MSI authentication type.
-
configure
public com.databricks.sdk.core.HeaderFactory configure(com.databricks.sdk.core.DatabricksConfig databricksConfig)
Configures and returns a HeaderFactory that produces authentication headers for Databricks API requests.The returned HeaderFactory will provide:
- An Authorization header with the Azure MSI access token
- If resourceId is available, an X-Databricks-Azure-Workspace-Resource-Id header
- If resourceId is not available, an X-Databricks-Azure-SP-Management-Token header with a management endpoint token
- Specified by:
configurein interfacecom.databricks.sdk.core.CredentialsProvider- Parameters:
databricksConfig- The Databricks configuration object.- Returns:
- A HeaderFactory that produces the required authentication headers.
-
-