-
Notifications
You must be signed in to change notification settings - Fork 10
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
Browser authentication token not being cached #49
Labels
bug
Something isn't working
Comments
PRs welcome! |
Here you go @edgarrmondragon! |
edgarrmondragon
pushed a commit
that referenced
this issue
Oct 25, 2024
…sic authentication with MFA (#50) The purpose of this PR is to fix the issue reported [here](#49), essentially making sure that oauth tokens are cached when using browser authentication to avoid having multiple browser windows popping in consecutive runs, even when the Snowflake account being accessed has [ALLOW_ID_TOKEN](https://docs.snowflake.com/en/sql-reference/parameters#allow-id-token) option enabled. While there, also ensured proper caching of MFA tokens (when the user account has [ALLOW_CLIENT_MFA_CACHING](https://docs.snowflake.com/en/sql-reference/parameters#allow-client-mfa-caching) enabled). ### Implementation details: - Add `secure-local-storage` extra to `snowflake-connector-python` dependency - Add `"client_request_mfa_token": True` and `"client_store_temporary_credential": True` to the connection arguments of the SQLAlchemy engine. This is mostly relevant for Linux users, as for MacOs (at least) the `secure-local-storage` extra is enough. - Fix some linting issues (done by `pre-commit` steps)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the tap with
use_browser_authentication=True
, I noticed that the browser auth tokens are not being cached, even if one's Snowflake account has token caching enabled.From my experience, this can be achieved by applying two simple changes:
, extras = ["secure-local-storage"]
when declaring thesnowflake-connector-python
as a project dependency (pyproject.toml
)client_store_temporary_credential
in connection arguments (mostly important for linux users, as documented here):The text was updated successfully, but these errors were encountered: