Issue Description
Deploying an R Shiny app to shinyapps.io using Earth Engine via rgee, I'm encountering an issue with non-interactive authentication:
App deployment unexpectedly falls back to interactive OAuth, prompting for a verification code.
Non-interactive authentication works locally but fails when deployed to shinyapps.io.
Reproducible Example
Local test (works fine):
library(reticulate)
reticulate::py_run_string(
"import ee; ee.Initialize(project='able-device-311600-453303'); print(ee.data.getAssetRoots())"
)
Returns expected asset roots locally:
[{'type': 'Table', 'id': 'projects/able-device-311600-453303/assets/Bool_area_3577'}]
shinyapps.io setup (failing):
.Renviron configuration:
GOOGLE_APPLICATION_CREDENTIALS="/srv/connect/apps/AusPlots_S2/credentials/able-device-311600-453303-dcb943459adc.json"
EE initialization within the deployed app:
library(rgee)
ee_Initialize(
user = "able-device-311600@able-device-311600-453303.iam.gserviceaccount.com",
credentials = "persistent",
project = "able-device-311600-453303",
drive = FALSE,
gcs = FALSE,
quiet = TRUE,
auth_mode = "appdefault"
)
Upon deployment, the app ignores provided credentials and attempts interactive OAuth, causing deployment to fail.
Checks already done
Expected Behavior
Non-interactive authentication succeeds using provided credentials on shinyapps.io deployment without prompting for interactive OAuth.
Actual Behavior
Interactive OAuth prompt prevents successful app deployment.
Environment
- R version: 4.4.2 (2024-10-31 ucrt)
- rgee version: 1.1.7
- reticulate version: 1.40.0
- Shiny version: 1.9.1
- Deployment target: shinyapps.io
Any guidance or workarounds to resolve this issue would be greatly appreciated.
Thank you!
Chris
Issue Description
Deploying an R Shiny app to shinyapps.io using Earth Engine via rgee, I'm encountering an issue with non-interactive authentication:
Non-interactive authentication works locally but fails when deployed to shinyapps.io.
Reproducible Example
Local test (works fine):
Returns expected asset roots locally:
[{'type': 'Table', 'id': 'projects/able-device-311600-453303/assets/Bool_area_3577'}]shinyapps.io setup (failing):
.Renvironconfiguration:EE initialization within the deployed app:
Upon deployment, the app ignores provided credentials and attempts interactive OAuth, causing deployment to fail.
Checks already done
Expected Behavior
Non-interactive authentication succeeds using provided credentials on shinyapps.io deployment without prompting for interactive OAuth.
Actual Behavior
Interactive OAuth prompt prevents successful app deployment.
Environment
Any guidance or workarounds to resolve this issue would be greatly appreciated.
Thank you!
Chris