Hi,
I am using OAuth machine-to-machine (M2M) authentication. I created a service principal and wrote a Java application that allows me to connect to the Databricks warehouse. My question is regarding the code below:
String url = "jdbc:databricks://<server-hostname>:443";
Properties p = new java.util.Properties();
p.put("httpPath", "<http-path>");
p.put("AuthMech", "11");
p.put("Auth_Flow", "1");
p.put("OAuth2ClientId", "<service-principal-application-id>");
p.put("OAuth2Secret", "<service-principal-oauth-secret>");
Connection conn = DriverManager.getConnection(url, p);
I only provide the client ID and secret, and the rest is handled by the driver, such as generating the access token internally. According to the documentation, the access token expires after 1 hour. If my application runs continuously for more than 1 hour, will the driver automatically handle token refresh once the current token expires? Alternatively, is there a way to customize the access token expiration duration when creating the service principal?
thanks