Apps Script OAuth2 dropping scopes

27 views
Skip to first unread message

Brad Melluish

unread,
Jun 8, 2024, 5:57:15 PMJun 8
to Google Apps Script Community

Experimenting with using gcp service accounts to query gemini from a spreadsheet via the OAuth2 library. Using the example from the Google Workspace Installable Triggers guide.

Screenshot 2024-06-07 at 4.22.48 PM.png

When I run it, the log shows `access: true scopes: undefined`, and I get the following error:

Screenshot 2024-06-07 at 4.22.55 PM.png

I've tried copying the setScopes function out of the OAuth2 repo and running it on my scope array to make sure I wasn't just doing the input wrong, and it was properly generating a space-delimited list of scopes. Tried passing a space-delimited list instead of an array, still comes back undefined. As best as I've been able to tell, the code is largely the same as whats found in the example I linked above.

The service appears to be successfully getting a token, but something is happening to the scopes. Any insight is appreciated.

Reply all
Reply to author
Forward
0 new messages