-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client ID and Secret defaults to package supplied credentials when running deployed shiny apps #74
Comments
Hi @emadretina - yes unfortunetly this has come up before here #57 and #59 The fix at the moment is to either use the JS based auth, or to rebuild the package (e.g. clone github, rebuild) locally with your own details, as some kind of caching is taking place on Shinyapps. I'll have another look at this to see if a better fix is available. |
Thank you, built it locally. Great work by the way, this is an amazingly useful package. |
@emadretina may I just check with you, if you were using the CRAN or the GitHub version as it is today? The most recent version has no options specified. |
It was GitHub version. Also, I would suggest not putting the app id and secret in the code. I modified it to pull those from Env variables for local build. |
True, those client id/secret are throw away details but how you did it is the recommended way. I'm inquiring with Shinyapps on this thread to see if I can do anything. The very latest # googleAuthR.webapp.client_id = "201908948134-cjjs89cffh3k429vi7943ftpk3jg36ed.apps.googleusercontent.com",
# googleAuthR.webapp.client_secret = "mE7rHl0-iNtzyI1MQia-mg1o", |
Figured thats actually the best way to handle it, let you set your environment arguments which you can do by uploading an * Default demo project scopes now NULL, set your own Google Project via `options()` or by setting up environment arguments:
- `googleAuthR.client_id = Sys.getenv("GAR_CLIENTID")`
- `googleAuthR.client_secret = Sys.getenv("GAR_CLIENT_SECRET")`
- `googleAuthR.webapp.client_id = Sys.getenv("GAR_WEB_CLIENTID")`
- `googleAuthR.webapp.client_secret = Sys.getenv("GAR_WEB_CLIENT_SECRET")`
- `googleAuthR.scopes.selected = Sys.getenv("GAR_SCOPES")` |
Hm.... I'm not sure that's the syntax for
or more like:
I'm guessing it's the first option. In any case, it's good to know that this issue has been solved ^^. |
Its the former, but you have to restart your R session to see it. Here are examples I have in my
After restarting R they are reachable via: Sys.getenv("GAR_CLIENTID")
Sys.getenv("GAR_CLIENT_SECRET") and subsequently should be in the options via getOption("googleAuthR.client_id")
getOption("googleAuthR.client_secret") |
Excellent, thanks! |
Hmm, you can't pass vectors if you want to do multiple scopes, so I'll set that up that you need a comma delimiter:
|
I just need a confirmation this clears up the issue, no rebuilding needed. I'll run a test myself next week-ish |
Not sure if anyone else has seen this problem but when I tried deploying a shiny app it seems like it automatically defaults to the options provided by library rather than using mine. Has anyone else seen this issue?
The text was updated successfully, but these errors were encountered: