@@ -787,21 +787,6 @@ private OpenIDConnectEndpoints getUnifiedOidcEndpoints(String accountId) throws
787787 return new OpenIDConnectEndpoints (prefix + "/v1/token" , prefix + "/v1/authorize" );
788788 }
789789
790- private OpenIDConnectEndpoints fetchOidcEndpointsFromWellKnown () throws IOException {
791- ApiClient apiClient =
792- new ApiClient .Builder ()
793- .withHttpClient (getHttpClient ())
794- .withGetHostFunc (v -> getHost ())
795- .build ();
796- try {
797- return apiClient .execute (
798- new Request ("GET" , "/oidc/.well-known/oauth-authorization-server" ),
799- OpenIDConnectEndpoints .class );
800- } catch (IOException e ) {
801- throw new DatabricksException ("IO error: " + e .getMessage (), e );
802- }
803- }
804-
805790 private OpenIDConnectEndpoints fetchDefaultOidcEndpoints () throws IOException {
806791 if (getHost () == null ) {
807792 return null ;
@@ -811,16 +796,23 @@ private OpenIDConnectEndpoints fetchDefaultOidcEndpoints() throws IOException {
811796 if (getHostType () == HostType .UNIFIED ) {
812797 return getUnifiedOidcEndpoints (getAccountId ());
813798 }
814-
815- if (isAzure () && getAzureClientId () != null ) {
816- return fetchOidcEndpointsFromWellKnown ();
817- }
818799 if (isAccountClient () && getAccountId () != null ) {
819800 String prefix = getHost () + "/oidc/accounts/" + getAccountId ();
820801 return new OpenIDConnectEndpoints (prefix + "/v1/token" , prefix + "/v1/authorize" );
821802 }
822803
823- return fetchOidcEndpointsFromWellKnown ();
804+ ApiClient apiClient =
805+ new ApiClient .Builder ()
806+ .withHttpClient (getHttpClient ())
807+ .withGetHostFunc (v -> getHost ())
808+ .build ();
809+ try {
810+ return apiClient .execute (
811+ new Request ("GET" , "/oidc/.well-known/oauth-authorization-server" ),
812+ OpenIDConnectEndpoints .class );
813+ } catch (IOException e ) {
814+ throw new DatabricksException ("IO error: " + e .getMessage (), e );
815+ }
824816 }
825817
826818 @ Override
0 commit comments