Skip to content
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

400 Bad Request from gs4_auth() with path to service account json #314

Open
cfisher5 opened this issue Oct 5, 2024 · 0 comments
Open

400 Bad Request from gs4_auth() with path to service account json #314

cfisher5 opened this issue Oct 5, 2024 · 0 comments

Comments

@cfisher5
Copy link

cfisher5 commented Oct 5, 2024

Over the last day or so, gs4_auth() has not been working for me in a non-interactive capacity after working for many years without issue.
I have a google service account and pass in the path to the json to authenticate and up until recently everything has been working fine.

I am experiencing the issue on windows 2016 with R4.4.1

After setting options(gargle_verbosity = "debug")
and running: gs4_auth(path='path/to/google_service.json')

I get the following output:

trying `token_fetch()`
Trying `credentials_byo_oauth()` ...
Error caught by `token_fetch()`:
inherits(token, "Token2.0") is not TRUE
trying `credentials_service_account()`
adding "userinfo.email" scope
Error caught by `token_fetch()`:
Bad Request (HTTP 400).
trying `credentials_external_account()`
aws.ec2metadata not installed; can't detect whether running on EC2 instance
trying `credentials_app_default()`
Trying `credentials_gce()` ...
x We don't seem to be on GCE.
trying `credentials_user_oauth2()`
attempt to access internal gargle data from: googlesheets4
Gargle2.0 initialize
adding "userinfo.email" scope
loading token from the cache
Error caught by `token_fetch()`:
attempt to set an attribute on NULL
Error in `gs4_auth()`:
! Can't get Google credentials.
i Are you running googlesheets4 in a non-interactive session? Consider:
* Call `gs4_deauth()` to prevent the attempt to get credentials.
* Call `gs4_auth()` directly with all necessary specifics.
i See gargle's "Non-interactive auth" vignette for more details:
i <https://gargle.r-lib.org/articles/non-interactive-auth.html>
Run `rlang::last_trace()` to see where the error occurred.

Notably, when I run locally on my macbook (R4.1.0) with the same json, I get it working successfully

trying `token_fetch()`
trying `credentials_service_account()`
adding "userinfo.email" scope
service account email: [email protected]
@cfisher5 cfisher5 changed the title gs4_auth() not acknowledging path to google service account json 400 Bad Request from gs4_auth() with path to service account json Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant