'Authentification into Google Analytics using R doesn´t work

I can´t authentificate with ga_auth() via rstudio desktop.

I tried with rstudio.cloud and authentification worked:

> ga_auth()
ℹ 2020-08-14 12:56:19 > Default Google Project for googleAnalyticsR is set.  

ℹ 2020-08-14 12:56:19 > Setting client.id from options(googleAuthR.client_id)
Is it OK to cache OAuth access credentials in the folder '/home/rstudio-user/.R/gargle/gargle-oauth' between R sessions?

1: Yes
2: No

Selection: 1
httpuv not installed, defaulting to out-of-band authentication
Enter authorization code: xxxxxx

If I try the same with my rstudio desktop I receive following message:

> ga_auth()
i 2020-08-14 14:42:29 > Default Google Project for googleAnalyticsR is set.  

i 2020-08-14 14:42:29 > Setting client.id from options(googleAuthR.client_id)
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Fehler: Could not authenticate via any gargle cred function

The difference is that I´m directly forwarded to browser authentification. After authentification I receive the message "Fehler: Could not authenticate via any gargle cred function" and no file is stored in path "C:\Users\xv12345.R\gargle\gargle-oauth"

Any ideas why cloud is working but desktop not? Maybe a Firewall issue from my company?

Thank you!

r


Solution 1:[1]

Yes, it is likely a firewall issue. Maybe try authenticating with a different API and see if you have similar issues.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jas