0

I have two GAS scripts. One of them is GSheets add-on another is Web App. The web app has doGet and doPost implemented. doGet returns custom HTML login screen. This screen is called from the GSheet script. After user logs into the web app I execute a doPost call to web app from the GSheet script to transform some data and return it as a JSON content.

The Web App is published with the following permissions

deployments screenshot

I need to run it as the "User accessing the web app" since I access user's drive and UserProperties service from the Web App.

When the doGet is executed for the first time from the Gsheets script the web app script request users permissions with the following OAuth scopes

  • "https://www.googleapis.com/auth/script.external_request"
  • "https://www.googleapis.com/auth/script.storage"
  • "https://www.googleapis.com/auth/drive"

User grants it and the Login page is rendered and works great.

When I execute the doPost call from the GSheet script I use:

UrlFetchApp.fetch('https://script.google.com/macros/s/<...>/exec', options)

The options object contains the Authorization: 'Bearer ' + ScriptApp.getOAuthToken(); basically user authorization of the GSheets script.

Everything was working great until yesterday. Now when I do the doPost call from the GSheets script I get the following HTML as a response.

Any ideas what is wrong here and why it stopped working without any changes? Perhaps some GAS update?

permission screen


If I share the source code with the user who runs the scripts the issue is gone. I believe the issue could be related.

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
vzhemevko
  • 815
  • 8
  • 25
  • If you think that the cause of a problem is due to a bug in the service itself, you can [search the Issue Tracker](https://issuetracker.google.com/issues?q=status:open%20componentid:191640%2B%20type:bug) to determine if it is a known issue. If the issue is completely new, you can [report it on the Issue Tracker](https://issuetracker.google.com/issues/new?component=191640&template=823905) as well. – abielita Apr 12 '18 at 16:51
  • @abielita Thank you, it seems to be that it may an issue. This can be related https://stackoverflow.com/questions/49784884/google-apps-script-deploy-as-web-app-now-requires-me-to-share-the-the-code – vzhemevko Apr 12 '18 at 17:30

0 Answers0