File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
databricks-sdk-java/src/main/java/com/databricks/sdk/core Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -798,18 +798,15 @@ private OpenIDConnectEndpoints fetchDefaultOidcEndpoints() throws IOException {
798798 }
799799
800800 if (isAzure () && getAzureClientId () != 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 );
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 ;
812807 }
808+ return new OpenIDConnectEndpoints (
809+ realAuthUrl .replaceAll ("/authorize" , "/token" ), realAuthUrl );
813810 }
814811 if (isAccountClient () && getAccountId () != null ) {
815812 String prefix = getHost () + "/oidc/accounts/" + getAccountId ();
You can’t perform that action at this time.
0 commit comments