Search code examples
google-apps-scriptgoogle-sheetsgoogle-oauthnest-device-access

Is there a way to avoid re-authorizing my AppsScript project?


I'm setting up a Google Sheet to download data from my Next device and would like it to run unattended.

I've been using OAuth2 for Apps Script to provide access tokens. Unfortunately, the authorization tends to expire every seven days and needs to be reapplied. I also looked into ScriptApp.getOAuthToken(), but it can't access my Nest project, probably because it hasn't been authorized.

My ideal solution would be to remove the bulk of the authorization code needed by OAuth2 for Apps Script, but I'll happy settle for just not having to log in every week just to re-auth the project.

Is what I'm looking for possible? If so, how do I go about it?


Solution

  • On the consent page just publish the app to production. There should be no need to have it verified by Google as it is internal. You will just get unverified app when you log in. But no need to relogin every 7 days.