Hello!
Does anyone know how to obtain a refresh token for a G Suite Add on, considering that the authorization flow to obtain the user consent was handled by Apps Script?
I know how to obtain the access token with the method ScriptApp.getOAuthToken(), but I don't know how to obtain the refresh token.
Context:
I have an add on that allows users to schedule recurring meetings. The user grants me access to their calendar when they install the add on, so I can read and write to their calendars when they are running the script.
I want to send them reminders a day before the meeting, so I want to read their calendars in the background using a cloud function when they are not running the script.
In order to do that I would need to have the refresh token for that user since the access token expires.
I'm really stuck on this for many days now. Any help would be much appreciated!
Thanks
Gabriel