-
Notifications
You must be signed in to change notification settings - Fork 56
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
Unable to use the new gmailr version in shinyapps.io #115
Comments
You need to deploy the oauth file on the server as well, this is the same as the previous versions of gmailr |
Thank you very much for the answer Jim. Actually I have deployed also the .httr-oauth file online but the screen remains white, waiting for the browser authentication. When I created the .httr-oauth file launching the shinyapp for the first time (with the above mentioned functions at the beginning of my server) I was working locally, and the file automatically was inserted in the working directory of my app. Now if, locally, I restart the session and remove only the gm_auth_configure function, after launching the app in the new session (always locally) I get the following error message: Error : Can't get Google credentials. Are you running gmailr in a non-interactive session? Consider: Call That's way I think that for working locally I always also need to specify the path of my .json file through the gm_auth_configure function. As concern the shinyapp deployed online, even though the two functions are present at the beginning of the server, inside my logs I get the following error message: I am wondering if the .httr-oauth works just locally and maybe the issue is determined by something that I should set directly on the Google Cloud Platform. What do you think? Thank you so much for your availability. |
Jim, I don't know if it would be a solution, but maybe I have understood the source of the problem. My shiny app uses also a token generated from the package rdrop2 to upload files in dropbox, and the .httr-oauth file has the same name of the one generated every time with gmailr. That's way my token is overwritten and the application can't get the credentials. By your knowledge, do you think it's possible to rename the .httr-oauth file generated with gmailr or producing it directly with a different name? Best, Nico |
See the documentation in gargle with how to test the directory where the oauth tokens are stored https://gargle.r-lib.org/articles/non-interactive-auth.html#create-a-cache-for-a-specific-project, the short answer is you can use |
I tested the token created after having removed the one for the rdrop2 package, but it still doesn't work online. Is there some guidelines of the specific operations to do for setting up gmailr specifically for an online shinyapp? For example, with the last version in my code I had just the functions for e-mail composition and send message, the .httr-oauth file was stored in my project folder and everything was ok, but now I don't know if the initial passages for the configuration, done through gm_auth_configure and gm_auth are right or not. For example, I don't understand while I keep obtaining the message "Google Credentials not found" if at the beginning of my server there's the function "gm_auth(email = "authorized_email", path = "MY_JSON.json"). Thank you again for your help! |
I get the same errors (above) while running locally too. The gm_auth() fails even though the auth token is lying in the current working directory. There is no redirection to a browser like earlier version used to do. I also tried
What could be wrong? |
You need to call |
It worked. Sorry for jumping the gun. Have a nice evening! |
Good to hear, in 86627e9 I made the error message more clear when you call |
Hi @jimhester and @sanjmeh, thanks for your clarification. I've followed the procedure inside the README.Rmd, but I still the application doesn't work online, but just locally. Here's a list of what I did:
4.1. if I deploy my shinyapp with the functions Again, the procedure to make it working locally works, but I still can't make it work online. Is there a step that I actually can't see? Thanks again! |
You need to copy both the credentials.json and your oauth token cache (e.g. in |
Jim, thanks. It's working now. For FUTURE REFERENCES, I am going to write all the workflow that I used to correctly set up the
Best, Nico |
Hi Jim, I have another small question related to this topic. Is it possible the file that has to be placed in the .secrets folder (sdasdjabq2eqw232342323GMAIL-ADDRESS@GMAIL.COM) expires after some time or there's the need to re-do the authorisation process? I'm asking this because few days ago, in my local folders, the folder .secrets was empty and I was unable to send emails from my app. Thanks, Nico |
Hello and thanks a lot for this useful package!
I have some issues with the new version of gmailr. I followed the steps of the README and I have created a project on the Google Cloud Platform. I have downloaded the .json file and, locally, I have configured my account through the gm_auth_configure(), specifying my key ID and my secret. A popup allowed me to connect my Gmail account with my application. Then, I have used the function gm_auth(email = "my-email") to authorise every time just that e-mail to send messages from the app.
Now in my server I have:
If I launch the app locally it works, but every time I deploy it on shinyapp.io (including the .json file) it freezes waiting for a redirection of the browser.
By the way, after a launched my app locally, the .httr-oauth file was created in my project folder, but at this point I don't really know if I need to deploy also this file.
Could you please give me any suggestion to set up the right code to make the functions working also online?
Thanks!
The text was updated successfully, but these errors were encountered: