@@ -31,6 +31,7 @@ public class OAuthClient {
3131 public static class Builder {
3232 private String host ;
3333 private String clientId ;
34+ private String discoveryUrl ;
3435 private String redirectUrl ;
3536 private List <String > scopes ;
3637 private String clientSecret ;
@@ -53,6 +54,11 @@ public Builder withClientId(String clientId) {
5354 return this ;
5455 }
5556
57+ public Builder withDiscoveryUrl (String discoveryUrl ) {
58+ this .discoveryUrl = discoveryUrl ;
59+ return this ;
60+ }
61+
5662 public Builder withClientSecret (String clientSecret ) {
5763 this .clientSecret = clientSecret ;
5864 return this ;
@@ -91,6 +97,7 @@ public OAuthClient(DatabricksConfig config) throws IOException {
9197 .withHttpClient (config .getHttpClient ())
9298 .withClientId (config .getClientId ())
9399 .withClientSecret (config .getClientSecret ())
100+ .withDiscoveryUrl (config .getDiscoveryUrl ())
94101 .withHost (config .getHost ())
95102 .withRedirectUrl (
96103 config .getOAuthRedirectUrl () != null
@@ -106,7 +113,7 @@ private OAuthClient(Builder b) throws IOException {
106113 this .host = b .host ;
107114 this .hc = b .hc ;
108115
109- DatabricksConfig config = new DatabricksConfig ().setHost (b .host ).resolve ();
116+ DatabricksConfig config = new DatabricksConfig ().setHost (b .host ).setDiscoveryUrl ( b . discoveryUrl ). resolve ();
110117 OpenIDConnectEndpoints oidc = config .getOidcEndpoints ();
111118 if (oidc == null ) {
112119 throw new DatabricksException (b .host + " does not support OAuth" );
0 commit comments