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
2 changes: 2 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### Bug Fixes

* Ensure that refresh tokens are returned when using the `external-browser` credentials strategy.

### Documentation

### Internal Changes
Expand Down
8 changes: 5 additions & 3 deletions databricks/sdk/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,11 @@ def __init__(
):

if not scopes:
scopes = ["all-apis"]
# all-apis ensures that the returned OAuth token can be used with all APIs, aside
# from direct-to-dataplane APIs.
# offline_access ensures that the response from the Authorization server includes
# a refresh token.
scopes = ["all-apis", "offline_access"]

self.redirect_url = redirect_url
self._client_id = client_id
Expand All @@ -654,8 +658,6 @@ def noop_credentials(_: any):
return lambda: {}

config = Config(host=host, credentials_strategy=noop_credentials)
if not scopes:
scopes = ["all-apis"]
oidc = config.oidc_endpoints
if not oidc:
raise ValueError(f"{host} does not support OAuth")
Expand Down
Loading