get authetication in google api browser but gargle permission fails

804 Views Asked by At

I am using googledrive to download directly from my drive folders, I am getting now this error

since i was getting this error Show in New Window

Error in gargle_abort_request_failed(): ! Client error: (403) Forbidden Insufficient Permission: Request had insufficient authentication scopes. • domain: global • reason: insufficientPermissions • message: Insufficient Permission: Request had insufficient authentication scopes.

Backtrace:

  1. googledrive::drive_ls(...)
  2. googledrive:::as_parent(path)
  3. googledrive:::as_dribble.drive_id(d)
  4. googledrive::drive_get(id = x)
  5. purrr::map(as_id(id), get_one_file_id)
  6. googledrive (local) .f(.x[[i]], ...)
  7. gargle::response_process(response)
  8. gargle:::gargle_abort_request_failed(error_message(resp), resp) Error in gargle_abort_request_failed(error_message(resp), resp) :

I used gs4_deauth() and then gs4_auth() to open the google api and get authentified again... I am still getting the same error, what should I do? Thanks

2

There are 2 best solutions below

0
On

I received this same error when updating some packages. I was able to resolve by entering "0" at this prompt when starting it up from a fresh R session. Even though my account was listed under option "1", entering "0" allowed me to refresh it somehow.

The googlesheets4 package is requesting access to your Google account.
Select a pre-authorised account or enter '0' to obtain a new token.
Press Esc/Ctrl + C to cancel.
0
On

Permission: Request had insufficient authentication scopes.

Means that the access token that was used to make this request was not created with the proper scopes. Im not sure which method you are using exactly but

The file.export method requires one of the following scopes

enter image description here

The file.get method requires one of the following scopes

enter image description here

You need to request authorization of the user with the proper consent scope