5. What did you expect to see?
When using the `username_password_mfa` option the client should be caching the mfa token and should only need to re-authenticate every 4 hours. Currently, anytime I restart my sqlalchmey app, I am recieving a duo push notification to re-authenticate. If I check in my keychain access there are no keys being stored.
I have enabled the [ALLOW_CLIENT_MFA_CACHING](https://docs.snowflake.com/en/sql-reference/parameters.html#label-allow-client-mfa-caching) option in snowflake. I have also succesfully been able to use MFA caching using the standard snowflake-connector-python.
I realized the reason this was not caching properly was because you need to explicitly install the snowflake-connector-python with the secure-local-storage alongside the snowflake-sqlalchemy library.
Please answer these questions before submitting your issue. Thanks!
What version of Python are you using?
Python 3.11.7 (main, Feb 1 2024, 14:44:16) [Clang 15.0.0 (clang-1500.1.0.2.5)]
What operating system and processor architecture are you using?
macOS-14.5-arm64-arm-64bit
What are the component versions in the environment (
pip freeze
)?from sqlalchemy import create_engine from snowflake.sqlalchemy import URL
from app import settings
url = URL( account='abc123', user='testuser1', password='0123456', database='testdb', schema='public', warehouse='testwh', role='myrole', authenticator='username_password_mfa' )
engine = create_engine( url=url, future=True, echo=True, )