-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
[AIRFLOW-5906] Add authenticator parameter to snowflake_hook #8642
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
|
def test_authenticator(self): | ||
self.conn.extra_dejson = {'database': 'db', | ||
'account': 'airflow', | ||
'warehouse': 'af_wh', | ||
'region': 'af_region', | ||
'role': 'af_role', | ||
'authenticator': 'externalbrowser'} | ||
|
||
uri_shouldbe = 'snowflake://user:pw@airflow/db/public?warehouse=af_wh&role=af_role' \ | ||
'&authenticator=externalbrowser' | ||
self.assertEqual(uri_shouldbe, self.db_hook.get_uri()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is not related to the changes in this PR. It just checks if extra_dejson
of any Connection object is changed, they are reflected and can be retrieved with get_uri()
.
Awesome work, congrats on your first merged pull request! |
(cherry picked from commit cd635dd)
(cherry picked from commit cd635dd)
(cherry picked from commit cd635dd)
To use Snowflake with SSO, Okta, ADFS or any other SAML 2.0 compliant identify provider we need to pass the
authenticator=externalbrowser
extra parameter to the snowflake connection string. Currently theauthenticator
parameter not extracted from the connection extras JSON and not possible to use Airflow and Snowflake with SAML/SSOThis PR extracts the
authenticator
parameter from the connection "extra"s JSON and passing it to the snowflake uri. This allows to use Airflow and Snowflake configured with SAML/SSO.Example airflow connection config:
Related snowflake documentation with the valid authentication strings: Snowflake Python: Connecting using Federated Authentication
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.