Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ CachedTokenSource performBrowserAuth(
.withClientId(clientId)
.withClientSecret(clientSecret)
.withHost(config.getHost())
.withAccountId(config.getAccountId())
.withRedirectUrl(config.getEffectiveOAuthRedirectUrl())
.withScopes(config.getScopes())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static class Builder {
private List<String> scopes;
private String clientSecret;
private HttpClient hc;
private String accountId;

public Builder() {}

Expand Down Expand Up @@ -71,6 +72,11 @@ public Builder withScopes(List<String> scopes) {
public OAuthClient build() throws IOException {
return new OAuthClient(this);
}

public Builder withAccountId(String accountId) {
this.accountId = accountId;
return this;
}
}

private final String clientId;
Expand All @@ -92,7 +98,8 @@ private OAuthClient(Builder b) throws IOException {
this.host = b.host;
this.hc = b.hc;

DatabricksConfig config = new DatabricksConfig().setHost(b.host).resolve();
DatabricksConfig config =
new DatabricksConfig().setHost(b.host).setAccountId(b.accountId).resolve();
OpenIDConnectEndpoints oidc = config.getOidcEndpoints();
if (oidc == null) {
throw new DatabricksException(b.host + " does not support OAuth");
Expand Down
Loading