diff --git a/NEWS.md b/NEWS.md index 5eaab667..ef6ec7e4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -23,7 +23,8 @@ Snowflake. * Push-button publishing from desktop RStudio is now compatible with Connect - servers hosted on Snowflake. + servers hosted on Snowflake. This includes support for browser-based + authentication during deployment. (#1289) * Added support for using identity federation to authenticate against Connect when running in Posit Workbench, when available. This allows deploying to diff --git a/R/client-connect.R b/R/client-connect.R index 87c81734..c22084b3 100644 --- a/R/client-connect.R +++ b/R/client-connect.R @@ -165,6 +165,13 @@ getSnowflakeAuthToken <- function(url, snowflakeConnectionName) { parsedURL <- parseHttpUrl(url) ingressURL <- parsedURL$host + # Detect when we're running in the Deploy pane of RStudio and enable + # "interactive" temporarily so that external browser authentication is + # permitted. + if (rstudioapi::isBackgroundJob()) { + rlang::local_options(rlang_interactive = TRUE) + } + token <- snowflakeauth::snowflake_credentials( snowflakeauth::snowflake_connection(snowflakeConnectionName), spcs_endpoint = ingressURL