Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed AccountClient U2M OAuth2 auth when using external-browser auth type #720

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion databricks/sdk/credentials_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def external_browser(cfg: 'Config') -> Optional[CredentialsProvider]:
oauth_client = OAuthClient(host=cfg.host,
client_id=client_id,
redirect_url='http://localhost:8020',
client_secret=cfg.client_secret)
client_secret=cfg.client_secret,
account_id=cfg.account_id)

# Load cached credentials from disk if they exist.
# Note that these are local to the Python SDK and not reused by other SDKs.
Expand Down
5 changes: 3 additions & 2 deletions databricks/sdk/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ def __init__(self,
redirect_url: str,
*,
scopes: List[str] = None,
client_secret: str = None):
client_secret: str = None,
account_id: str = None):
# TODO: is it a circular dependency?..
from .core import Config
from .credentials_provider import credentials_strategy
Expand All @@ -368,7 +369,7 @@ def __init__(self,
def noop_credentials(_: any):
return lambda: {}

config = Config(host=host, credentials_strategy=noop_credentials)
config = Config(host=host, credentials_strategy=noop_credentials, account_id=account_id)
if not scopes:
scopes = ['all-apis']
oidc = config.oidc_endpoints
Expand Down
Loading