File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
databricks-sdk-java/src/main/java/com/databricks/sdk/core Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -628,7 +628,8 @@ private OpenIDConnectEndpoints fetchDefaultOidcEndpoints() throws IOException {
628
628
if (getHost () == null ) {
629
629
return null ;
630
630
}
631
- if (isAzure () && getAzureClientId () != null ) {
631
+
632
+ if (isAzure () && shouldUseAzureOidcEndpoints ()) {
632
633
Request request = new Request ("GET" , getHost () + "/oidc/oauth2/v2.0/authorize" );
633
634
request .setRedirectionBehavior (false );
634
635
Response resp = getHttpClient ().execute (request );
@@ -742,4 +743,14 @@ public DatabricksConfig newWithWorkspaceHost(String host) {
742
743
public String getEffectiveOAuthRedirectUrl () {
743
744
return redirectUrl != null ? redirectUrl : "http://localhost:8080/callback" ;
744
745
}
746
+
747
+ /**
748
+ * Determines if Azure-specific OIDC endpoints should be used.
749
+ * This is true in two cases:
750
+ * 1. When auth type is not specified (this is only in case of external browser auth)
751
+ * 2. When Azure client ID is present (service principal auth)
752
+ */
753
+ private boolean shouldUseAzureOidcEndpoints () {
754
+ return Objects .equals (getAuthType (), null ) || getAzureClientId () != null ;
755
+ }
745
756
}
You can’t perform that action at this time.
0 commit comments