0

I have written R script that download email's from gmail. I have used gm_auth with gargle_oauth_cache.

library("gmailr")

gm_auth_configure(path = "path.json")
gm_auth(email = "mail",
        cache = gargle::gargle_oauth_cache(),
        use_oob = gargle::gargle_oob_default(),)

Until today it worked well on my laptop and pc that we use as a server. It still working well on my laptop but on server pc I get error

Error: Can't get Google credentials. Are you running gmailr in a non-interactive session? Consider: * Call gm_auth() directly with all necessary specifics.

I tried to find port 1410 like in drive_auth() function not creating gargle-oauth token on password submission but nothing is running on this port. I have no idea how to repair it, and why this error ocurred.

Igniste
  • 108
  • 6

1 Answers1

0

For me worked clean cache and make new one's.

rappdirs::user_cache_dir("gargle")

cache folder localization

 library("gargle")
 gargle_oauth_sitrep()

list of active tokens

Igniste
  • 108
  • 6
  • This answer helped me to resolve another problem I had [stackoverflow question](https://stackoverflow.com/questions/75054088/gmailr-authendication-problem-in-one-host-but-not-others/75058593#75058593). But still don't understand why it worked. – ThanasisN Jan 09 '23 at 14:23