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

Auth by "internal" google token #1170

Open
RentFreeMedia opened this issue Feb 12, 2023 · 0 comments
Open

Auth by "internal" google token #1170

RentFreeMedia opened this issue Feb 12, 2023 · 0 comments

Comments

@RentFreeMedia
Copy link

RentFreeMedia commented Feb 12, 2023

Is your feature request related to a problem? Please describe.
Authentication options only seem to support building an OAuth flow from scratch.

Describe the solution you'd like
It would be nice to be able to re-use "internal" OAuth tokens which google creates on the client side for Apps Script projects which use the card builder UI.

When building test-only (single user) and internal-domain applications and using the card builder UI, Google generates auth flow for you based on the Apps Script project defined scopes. When including OAuth and OpenID in the scopes there in this way, a token is generated for "internal" Google API usage, and the developer of the project can access and send it via authorization headers to an external API even, but it has no refresh options, so it isn't compatible with the current implementation of gspread by the looks of the docs/code.

In my case I'm sending API calls to an external Flask API for NLP cleanup purposes, and then having the Flask API send POST data back to the spreadsheet. Using gspread would be nicer than using the Google Client SDK directly, but a glance at the auth code suggests that I would have to create my own auth flow for this, whereas with the Google Client SDK I could just pass an authorization header into my Flask API with Google's internal token in it and away I go.

Describe alternatives you've considered
Building my own OAuth flow of course, but the Apps Script UI builder is nice, it takes a lot of boilerplate out of building apps script projects from a UI standpoint, I just have to define buttons, not build a whole UI with HTML, CSS, etc, and not build an OAuth flow.

Additional context
Perhaps an internal auth flag (internal_token=True/False with the default to False) could be used to bypass a lot of the external or service account auth flow? Will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants