Skip to content

Update some outdated OAuth comments #339

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

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 2 additions & 15 deletions examples/interactive_oauth.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
from databricks import sql
import os

"""Bring Your Own Identity Provider with fined grained OAuth scopes is currently public preview on
Databricks in AWS. databricks-sql-connector supports user to machine OAuth login which means the
end user has to be present to login in a browser which will be popped up by the Python process. You
must enable OAuth in your Databricks account to run this example. More information on how to enable
OAuth in your Databricks Account in AWS can be found here:

https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html
"""databricks-sql-connector supports user to machine OAuth login which means the
end user has to be present to login in a browser which will be popped up by the Python process.

Pre-requisites:
- You have a Databricks account in AWS.
- You have configured OAuth in Databricks account in AWS using the link above.
- You have installed a browser (Chrome, Firefox, Safari, Internet Explorer, etc) that will be
accessible on the machine for performing OAuth login.

This code does not persist the auth token. Hence after the Python process terminates the
end user will have to login again. See examples/persistent_oauth.py to learn about persisting the
token across script executions.

Bring Your Own Identity Provider is in public preview. The API may change prior to becoming GA.
You can monitor these two links to find out when it will become generally available:

1. https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html
2. https://docs.databricks.com/dev-tools/python-sql-connector.html
"""

with sql.connect(server_hostname = os.getenv("DATABRICKS_SERVER_HOSTNAME"),
Expand Down
17 changes: 2 additions & 15 deletions examples/persistent_oauth.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
"""Bring Your Own Identity Provider with fined grained OAuth scopes is currently public preview on
Databricks in AWS. databricks-sql-connector supports user to machine OAuth login which means the
end user has to be present to login in a browser which will be popped up by the Python process. You
must enable OAuth in your Databricks account to run this example. More information on how to enable
OAuth in your Databricks Account in AWS can be found here:

https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html
"""databricks-sql-connector supports user to machine OAuth login which means the
end user has to be present to login in a browser which will be popped up by the Python process.

Pre-requisites:
- You have a Databricks account in AWS.
- You have configured OAuth in Databricks account in AWS using the link above.
- You have installed a browser (Chrome, Firefox, Safari, Internet Explorer, etc) that will be
accessible on the machine for performing OAuth login.

Expand All @@ -18,12 +11,6 @@
shows which methods you may implement.

For this example, the DevOnlyFilePersistence class is provided. Do not use this in production.

Bring Your Own Identity Provider is in public preview. The API may change prior to becoming GA.
You can monitor these two links to find out when it will become generally available:

1. https://docs.databricks.com/administration-guide/account-settings-e2/single-sign-on.html
2. https://docs.databricks.com/dev-tools/python-sql-connector.html
"""

import os
Expand Down
4 changes: 0 additions & 4 deletions src/databricks/sql/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ def __init__(
a warning log message. To suppress this log message, set `use_inline_params="silent"`.
auth_type: `str`, optional
`databricks-oauth` : to use oauth with fine-grained permission scopes, set to `databricks-oauth`.
This is currently in private preview for Databricks accounts on AWS.
This supports User to Machine OAuth authentication for Databricks on AWS with
any IDP configured. This is only for interactive python applications and open a browser window.
Note this is beta (private preview)

oauth_client_id: `str`, optional
custom oauth client_id. If not specified, it will use the built-in client_id of databricks-sql-python.
Expand Down