-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for 'externalbrowser' authentication #24
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
Conversation
4588964 to
ee88c75
Compare
|
I have successfully authenticated from an R/RStudio session outside Snowflake into a Snowflake-hosted Connect instance using a connection having rsconnect::connectSPCSUser(server="NAME", apiKey="KEY", snowflakeConnectionName = "CON")I have not tested within Snowflake. |
|
Within Snowflake you'll get an error from this package that |
|
@edavidaja Any chance you're trying this from Positron or VS Code and not RStudio? I'm pretty sure I found a bug in how they handle |
ee88c75 to
475a885
Compare
edavidaja
left a comment
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.
I think it's probably worth noting somewhere that we don't expect this to work in Positron / VS Code or documenting the workaround. Maybe just the readme if we expect that subsequent changes there will resolve the issue.
This commit adds the machinery to support the "externalbrowser"
authenticator, which is an interactive sign-in flow for users with
access to a local browser. It includes session caching, which is a nice
ergonomic improvement for repeated calls.
(The underlying protocol is completely bespoke to Snowflake so it took me
a little while to get it actually working.)
You can test it as follows:
snowflake_connection(
account = <account>
user = <username>,
authenticator = "externalbrowser"
) |> snowflake_credentials()
This should open a browser window to the account's SSO provider.
Unfortunately this is all highly interactive code, so there is not much
to unit test.
Signed-off-by: Aaron Jacobs <aaron.jacobs@posit.co>
475a885 to
373ca18
Compare
|
Added a note to the README. |

This commit adds the machinery to support the "externalbrowser" authenticator, which is an interactive sign-in flow for users with access to a local browser. It includes session caching, which is a nice ergonomic improvement for repeated calls.
(The underlying protocol is completely bespoke to Snowflake so it took me a little while to get it actually working.)
You can test it as follows:
This should open a browser window to the account's SSO provider.
Unfortunately this is all highly interactive code, so there is not much to unit test.