File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
databricks-sdk-java/src/main/java/com/databricks/sdk/core Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -798,15 +798,18 @@ private OpenIDConnectEndpoints fetchDefaultOidcEndpoints() throws IOException {
798798 }
799799
800800 if (isAzure () && getAzureClientId () != null ) {
801- Request request = new Request ("GET" , getHost () + "/oidc/oauth2/v2.0/authorize" );
802- request .setRedirectionBehavior (false );
803- Response resp = getHttpClient ().execute (request );
804- String realAuthUrl = resp .getFirstHeader ("location" );
805- if (realAuthUrl == null ) {
806- return null ;
801+ ApiClient apiClient =
802+ new ApiClient .Builder ()
803+ .withHttpClient (getHttpClient ())
804+ .withGetHostFunc (v -> getHost ())
805+ .build ();
806+ try {
807+ return apiClient .execute (
808+ new Request ("GET" , "/oidc/.well-known/oauth-authorization-server" ),
809+ OpenIDConnectEndpoints .class );
810+ } catch (IOException e ) {
811+ throw new DatabricksException ("IO error: " + e .getMessage (), e );
807812 }
808- return new OpenIDConnectEndpoints (
809- realAuthUrl .replaceAll ("/authorize" , "/token" ), realAuthUrl );
810813 }
811814 if (isAccountClient () && getAccountId () != null ) {
812815 String prefix = getHost () + "/oidc/accounts/" + getAccountId ();
You can’t perform that action at this time.
0 commit comments