MarkEdmondson1234 / googleAuthR

Google API Client Library for R. Easy authentication and help to build Google API R libraries with OAuth2. Shiny compatible.
https://code.markedmondson.me/googleAuthR
Other
175 stars 51 forks source link

googleSignIn not showing button #135

Closed tsmith64 closed 5 years ago

tsmith64 commented 5 years ago

When trying to use the googleSignIn module, no button is rendered. The below example returns a blank page for me. Inspecting the source code, however, shows that the appropriate divs are there. I have the same issue when running the sample code from the original file created by David Kulp.

library(shiny)
library(shinyjs)
library(googleAuthR) #Requires github development version

ui <- fluidPage(
  googleSignInUI('auth')
)

server <- function(input, output, session) {
  user <- callModule(googleSignIn, 'auth')
}

shinyApp(ui = ui, server = server)

Session Info

R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
[1] shinyjs_1.0            googleAuthR_0.7.0.9000 shiny_1.1.0            RPostgreSQL_0.6-2      DBI_1.0.0             

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.19     digest_0.6.18    later_0.7.5      assertthat_0.2.0 mime_0.6         R6_2.3.0         jsonlite_1.5    
 [8] xtable_1.8-3     magrittr_1.5     httr_1.3.1       promises_1.0.1   tools_3.4.4      rsconnect_0.8.8  httpuv_1.4.5    
[15] yaml_2.2.0       compiler_3.4.4   memoise_1.1.0    htmltools_0.3.6 
MarkEdmondson1234 commented 5 years ago

Can you look at the Console messages in the browser? Have you perhaps an Ad blocker on?

tsmith64 commented 5 years ago

There is no Ad blocker, and there are no console messages in the browser. I'm using Malwarebytes and windows defender. I take it you couldn't replicate this?

MarkEdmondson1234 commented 5 years ago

Have you set a client ID? This is my project, it should work as well.

library(shiny)
library(googleAuthR) # its on CRAN now

options(googleAuthR.webapp.client_id = "1080525199262-qecndq7frddi66vr35brgckc1md5rgcl.apps.googleusercontent.com")

ui <- fluidPage(
  googleSignInUI('auth')
)

server <- function(input, output, session) {
  user <- callModule(googleSignIn, 'auth')
}

shinyApp(ui = ui, server = server)

The demo app is available here too:

shiny::runApp(system.file("signin_demo", "app", package = "googleAuthR"))

Its just in so I may need to update the documentation, I think its the client.id you need.

tsmith64 commented 5 years ago

Adding your client id made the button show up. Thank you very much! I will register my own app, and change the client id.