Skip to content

403 Error from gar_shiny_login_ui() #236

Description

@PotcharaS

What goes wrong

Unable to get to the authentication page

Steps to reproduce the problem

Please note that if a reproduceable example that I can run is not available, then the likelihood of getting any bug fixed is low.

**UI.R

** # Of course, I can wrap the gar_shiny_ui before the bracket - but I want the app to launch before the log in page.
ui <- (fluidPage(title = "googleAuthR Shiny Demo",
h4("Test App"),
# Big Google Button
gar_shiny_login_ui(),
))

**server.R
library(shiny)
library(googleAuthR)
source("./global.R")

server <- function(input, output, session){

Screenshot 2024-12-19 at 17 32 12 Screenshot 2024-12-19 at 17 32 18 # To authenticate the session, gar_shiny_auth(session) }

**global.R
library(googleAuthR)
library(shiny)
gar_set_client(scopes = "https://www.googleapis.com/auth/spreadsheets",
json = "YOUR_CLIENTS_ID from Google, "
)

The above code actually ran and give me the correct project name.

Expected output

Being taken to Google Login page, instead I got the screen shot attached - Error 403.

Actual output

Before you run your code, please run:

options(googleAuthR.verbose=2) and copy-paste the console output here.
Check it doesn't include any sensitive info like auth tokens or accountIds - you can usually just edit those out manually and replace with say XXX

options(googleAuthR.verbose=2)
runApp('app')
✔ Setting client.id from ../app/XXXXX.apps.googleusercontent.com.json
ℹ 2024-12-19 17:20:21.64327 > options(googleAuthR.scopes.selected=c(' https://www.googleapis.com/auth/spreadsheets ')) options(googleAuthR.client_id=' XXXX') options(googleAuthR.client_secret=' XXXX ') options(googleAuthR.webapp.client_id=' XXXX ') options(googleAuthR.webapp.client_secret=' XXXX ')

NOTE - I have 2 clients, 1 for Desktop App and one for Web App, I am using Desktop JSON for this case.

Session Info

Please run sessionInfo() so we can check what versions of packages you have installed

sessionInfo()
R version 4.3.3 (2024-02-29)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Paris
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] shinyauthr_1.0.0 googleAuthR_2.0.2 googlesheets4_1.1.1 shiny_1.8.0

loaded via a namespace (and not attached):
[1] jsonlite_1.8.7 crayon_1.5.2 dplyr_1.1.3 compiler_4.3.3 promises_1.2.1
[6] tidyselect_1.2.0 Rcpp_1.0.12 assertthat_0.2.1 later_1.3.2 jquerylib_0.1.4
[11] fastmap_1.1.1 mime_0.12 R6_2.5.1 generics_0.1.3 curl_5.2.1
[16] tibble_3.2.1 openssl_2.1.1 bslib_0.5.1 pillar_1.9.0 rlang_1.1.1
[21] utf8_1.2.4 cachem_1.0.8 httpuv_1.6.14 fs_1.6.3 sass_0.4.7
[26] memoise_2.0.1 cli_3.6.1 withr_2.5.2 magrittr_2.0.3 digest_0.6.33
[31] rstudioapi_0.15.0 xtable_1.8-4 askpass_1.2.0 rappdirs_0.3.3 lifecycle_1.0.3
[36] vctrs_0.6.4 gargle_1.5.2 glue_1.6.2 cellranger_1.1.0 rsconnect_1.3.1
[41] googledrive_2.1.1 fansi_1.0.5 httr_1.4.7 purrr_1.0.2 tools_4.3.3
[46] pkgconfig_2.0.3 ellipsis_0.3.2 htmltools_0.5.7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions