snowflakedb / snowflakedb/snowflake-connector-python
SNOW-3984430: Missing retries for OAuth authentication
@sfc-gh-snow-drivers-warsaw-dl is already working on this.
Since Aug 22, 2026.
- Dominant language
- Python
- Stars
- 730
- Forks
- 574
- Avg merge
- 5h 45m
- Merged PRs (30d)
- 16
Description
Python version
3.14
Operating system and processor architecture
linux-64
Installed packages
does not matter
What did you do?
Using SnowflakeConnection with authenticator=OAUTH_CLIENT_CREDENTIALS does not retry (temporary) failures in the HTTP requests that obtain the access token from the configured oauth_token_request_url.
Such retries do exist in nearby code paths; see retry loop in SnowflakeConnection._authenticate, e.g. here:
https://github.com/snowflakedb/snowflake-connector-python/blob/869bcf91d08f69e29c34550a04a59baaa1b1279c/src/snowflake/connector/connection.py#L2083-L2092
So I think this is a bug. This call to auth_instance.prepare which does the request should also be covered in a retry loop:
https://github.com/snowflakedb/snowflake-connector-python/blob/869bcf91d08f69e29c34550a04a59baaa1b1279c/src/snowflake/connector/connection.py#L2048
What did you expect to see?
Retries in case of temporary failures.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.