Skip to content
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

Support for automatic credential refresh with supported drivers #653

Open
atheriel opened this issue Dec 7, 2023 · 1 comment
Open

Support for automatic credential refresh with supported drivers #653

atheriel opened this issue Dec 7, 2023 · 1 comment
Assignees

Comments

@atheriel
Copy link
Collaborator

atheriel commented Dec 7, 2023

Issue Description and Expected Result

Right now if you're using an OAuth2 token instead of a username/password with certain drivers and the token expires, queries start returning errors.

Microsoft has a section on this in the ODBC 4.0 spec, and there's more precise detail in the documentation for the Databricks driver itself:

manual1
manual2

I'm wondering if it's possible to catch these errors, refresh the tokens (if possible), and retry the query automatically.

Database

Databricks, but potentially others.

Reproducible Example

I'm not sure I can provide a reproducible example for this, it's transient and requires all of the OAuth2 stuff to be set up.

Session Info
devtools::session_info()
#> output
@atheriel atheriel self-assigned this Dec 7, 2023
@fh-mthomson
Copy link

We're currently leveraging r-lib/httr2#349 to handle the OAuth token refresh for connecting to Snowflake from Workbench (since, as you noted, external browser auth doesn't necessarily work).

Currently, I'm working through leveraging the same pattern in Connect (but requires setting access / refresh tokens as env vars), but that's proving to be a bit more clunky when needing to update env vars on the fly.

I'd be happy to discuss further, if helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants