So I'm building a web app that's going to read and write data to a Google Sheet (I know - not ideal). This is for an educational organization with Google accounts for employees. The backend is node.js, express etc. I've implemented OpenID Connect via the newer "Sign in with Google" flow. The end user signs in in the browser, and Google sends the ID token via redirect to my server. Fine. I use the Google token-verification library for node to verify and decode the ID token. I look the user up in my db (for now just the Sheet). Authentication is essentially done.
I've created a service worker for the Google Cloud Project that's associated with this. My node server has the credential/key.json file for that service worker; scopes include Google APIs for Sheets etc. The service worker is fully authorized to read and write to the sheet, and of course, the sheet is "shared" with the service worker. Now come the questions:
At this point, since I know the identity of any end user from the Google ID token, is it simply enough to create my own authorization flows based on who the user is? I control the service worker and can thus write logic in my server to allow certain users to perform certain actions on the Google sheet. These authorizations can be very finely grained. Simple. Is there any problem here, assuming, of course that my server itself remains secure. With all of the discussion of OAuth2.0 and access tokens, refresh tokens etc. should I be thinking differently?
(Bigger question) How to handle subsequent requests from the browser? Sure, I can start a session when I authenticate the user and handle it that way. Or I can use my own JWT sent back to the client/browser and set in a secure http-only cookie. But can't I just send back the JWT that I already have ... the actual Google ID token? This has been asked on a few security forums in the past and no one can seem to give a solid answer. Sure the OpenID Connect docs say "start a session." And we know the session vs (irrevocable) JWT debate continues. But nowhere on the JWT side can I seem to find anyone really discouraging me from using the ID token instead. There are even a few tutorials that do it this way. And yet it still "feels" wrong to me. Even given proper SSL/TLS it still feels dangerous: a stolen ID token could be used in someone else's web app, where a poorly-designed backend isn't checking the token's aud claim for example, or the expiration time - essentially allowing a nefarious user to utilize that web app as someone else. Strange to me that I can't find anyone saying "yeah, don't do this!"