Open MarkEdmondson1234 opened 4 years ago
You can't activate both at the same time (client_id and web client) due to some gargle thing, so if you have both you need to add the argument activate="web"
e.g.
gar_set_client(activate="web")
It would be useful to add this bit of information to the setup vignette
The current steps are as follows for Shiny:
- Click ‘Create a new Client ID’, and choose “Web Application”.
- Download the web client JSON file
- Add the URL of where your Shiny app will run to the credentials, with no port number. e.g. https://your-account.shinyapps.io/your-shiny-app/
- And/Or also put in localhost or 127.0.0.1 with a port number for local testing. Remember the port number you use as you will need it later to launch the app e.g. http://127.0.0.1:1221
- Set the GAR_CLIENT_WEB_JSON environment argument (via .Renviron or otherwise) to the full path file location of the JSON file (see gar_set_client() for other options)
- Run the app locally specifying the port number you used e.g. shiny::runApp(port=1221)
- Or deploy to your Shiny Server that deploys to web port (80 or 443).
If you just follow these steps, you get the project_id error. Especially since the next vignette https://code.markedmondson.me/googleAuthR/articles/google-authentication-types.html in the Shiny section says to use gar_set_client(scopes = "https://www.googleapis.com/auth/drive")
. In the setup guide there's instructions how to get the JSON file for use in shiny, and in the authentication guide there's an example of the actual function call to gar_set_client()
, but this alone won't work. It would be useful to mention to new users that because this is a web json, the correct parameters need to be set.
Rstudio Server:
Verbose output:
Sessioninfo:
Maybe lets ignore my PC for now then ;)
Originally posted by @domsle in https://github.com/MarkEdmondson1234/googleAuthR/issues/188#issuecomment-666377308