'Is it possible to use the Google Sheets JavaScript API WITHOUT user consent or auth tokens
Background: I know it is possible to read/write data from/to a Google sheet using the JavaScript API. I know it is possible to do it with an API key paired with oAuth (because the service has to know who the user is, which really means being a google user).
However, the question that Google does not address clearly (and I find the documentation misleading):
Can a JavaScript app/webpage have write permission to a google sheet (that is public open access) WITHOUT having to provide an oAuth client ID?
Everything I tried and researched leads to no, you cannot - you have to provide a client ID. Also I find the Service Account method not applicable for JS API via a web page.
Am I missing totally missing something? Please let me know if you have any specific insight into the above.
I solved it by having middleware php code that takes data from the webpage and uses a Service Account to communicate with the Google sheet, then returns data to the webpage. So... my question re-phrased: can I do the above directly without php?
Solution 1:[1]
After testing it seems that there is no way to use Sheets API without getting some sort of consent being either through a consent screen or by using an API Key, your code will either have to show a consent screen to grant authorization or as you are currently doing, perform domain wide authority with domain wide delegation.
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 | Gabriel Carballo |
