-
Notifications
You must be signed in to change notification settings - Fork 33
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
Shiny auth? #14
Comments
Good question! Yes I would expect this to be on the roadmap, but it's admittedly not a top priority right now. We're still getting the "basic" stuff working. The next step for me is to actually connect this to googledrive and slowly move token management functionality out of googledrive/googlesheets* and into here, then re-import it into those packages. Ccing @craigcitro in case he has had any concrete thoughts re: Shiny. |
So for the Shiny case, I can imagine two models we might be interested in here:
My shiny experience is (sadly) limited -- which of these sounds more useful? |
Both are used a lot, but generally:
When using Shiny, you also have the option of doing it purely client side with JavaScript to do the OAuth dance, then just pass the object in to R once done. That is my favoured method at the moment as it then also works with RMarkdown. |
A touch on this again as I've worked with the method suggested by Joe Cheng that creates an authentication token in a Shiny landing screen before the Shiny app launches proper, meaning you can then just assume all the Google authentication is there and use API call functions normally within the Shiny code, which is more elegant than the An example of this is the Practically it means that |
Thanks @MarkEdmondson1234 for continuing to track and comment on this! I'm resuming work here now that the conference is over, but Shiny remains the area I am least up-to-speed on. |
@MarkEdmondson1234 I am pushing towards a near term release of gargle, with it still being clearly marked as "experimental". This is just an FYI that I welcome your thoughts (detailed or vague), esp. re: Shiny. But, that left to my own devices, Shiny won't be directly targeted in v0.1.0. |
10-4 :) I'm watching each commit and it all looks really great, I'm a bit full at work at the moment but plan to fork and see how it goes next window I get. I think creating the Shiny UI with a function and pre-authenticating before the Shiny app proper gargle will work in its current form, but need to test it. |
Update on strategy here. A lot of auth methods have been tried over the years, but the two modern versions are broken down to server side and client side. Both require web based application client as per #94
Perhaps only one of the above? If thats the case the JavaScript one exports dependencies to the Google libraries, tried and tested and would be my first choice. |
I was reading up on this over the weekend in fact. Yeah, we are definitely interested in developing the Shiny story here in gargle and sooner, rather than later. Thanks for the recent research and summary. Maybe this will be a good area for you to get involved with a PR and/or review/testing. I may try to recruit another person (with more Shiny/JS experience) to help weigh the options. |
Recording some thoughts that are becoming more clear, having just had a call with @schloerke. Refining @craigcitro's comment waaaay above. I think there are (at least) 3 big Shiny auth scenarios:
|
Hi, I want to share my experiences about this issue. Shiny auth scenarios:
About the scenario 3. I wrote a shinyapp to do flow cytometry analysis. The data files can be huge (4MB to 1GB). All my data files are already in a googledrive acount. I needed to open these files in my shinyapp.io app, but with no need to download the file to my workstation and upload to shinyapp.io.
I use googleAuthR module to user OAuth authentication and pass the token to drive_auth. It´s working. I think that the shiny module solution is great! Regards, |
Hi, When I try to do this R always seems to fail when it tries to open a browser. I understand how Is it possible to do the following is there an option I'm missing? library(googldrive)
options(
gargle_oob_default = TRUE,
gargle_oauth_email = "...@email.com",
gargle_oauth_cache = TRUE
)
drive_auth() Point your browser to the following URL: https://accounts.google.com/signin/oauth/identifier?......
Enter authorisation code: I've tried the shared options mentioned above using the json service account downloaded from https://console.developers.google.com using
This still requires the browser interaction, which is the issue I'm struggling. Thanks |
@vnniyB Can you use a browser in the container at all? The service account approach should NOT require any browser interaction. I need to hear more about that to help you find the mis-usage. You could even get a user token elsewhere (i.e. not in the container) and move it to the container, into whatever location you plan to indicate for the gargle oauth cache. This is a little icky but it's fundamentally no different from your current main plan, which is to pre-cache. |
Interesting hack-y solution that seems to be enough for some folks and their applications: |
This is ok for app users who want their own data in the Shiny app but it’s really moving back to the old .httr-oauth token style and placing it in the same folder as the app. To make it non-hacky a function to copy over from the desktop system level cache to the local cache would be nice.
…________________________________
From: Jennifer (Jenny) Bryan <notifications@github.com>
Sent: Friday, May 1, 2020 4:32:38 PM
To: r-lib/gargle <gargle@noreply.github.com>
Cc: Mark <github@markedmondson.me>; Mention <mention@noreply.github.com>
Subject: Re: [r-lib/gargle] Shiny auth? (#14)
Interesting hack-y solution that seems to be enough for some folks and their applications:
https://stackoverflow.com/questions/44980757/remote-server-authentication-to-read-googlesheets-from-r-script-not-using-servic/59910070#59910070
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#14 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAYCPLGJYQ4ZIMCJAJY7F2TRPLMQNANCNFSM4DQLLQPA>.
|
It is with great excitement I see the activity here (been watching since @jennybc pinged me about its prototype a while back), I hope to move all auth things of
googleAuthR
to depend on this package for its next major version, for which it is well due. Hopefully it will also mean more cross compatibility between all the Google API packages out there.Is multi-user Shiny authentication on the road map for this package? That was pretty much the reason I went down the rabbit hole of
googleAuthR
, as it was a tougher nut to crack due to the token needing to be a Shiny reactive object, which meant keeping the token in a global of the package didn't work. I got around that at the time with awith_shiny
wrapper function that added an argument to each API call function with the token explicitly supplied, but there must be a better way.If I can help at all, I will try to chip in, at the very least documentation or something once its developed.
The text was updated successfully, but these errors were encountered: