Share a Google App Script to other users - permission requested & authorize script

11,909

Solution 1

The problem is you are mixing web app with ui dialog on a sheet.
The webapp is accesed from the webapp url (given when you publish the webapp).
The ui dialog is a window shown on top of the spreadsheet.
You want to use webapp, follow the tutorial for that. Publish it to be accesed from the domain if all users are in the same gapps domain. Else use public anonymous.
Run doGet before publish to authorize. Its also possible to do the other ui-on-sheet but you need more steps for each user to authorize.

Solution 2

Since you selected to execute the app as you, you need to authorize this script first.

Just select method doGet and press run in the editor, you will get the chance to authorize.

Share:
11,909
BeNdErR
Author by

BeNdErR

this is not the profile you are looking for. SOreadytohelp

Updated on June 19, 2022

Comments

  • BeNdErR
    BeNdErR almost 2 years

    I've created a spreadsheet with some GAS behind it that opens a form with some inputs, and now I need to deploy the webapp and share it to some other users. The problem is that when the other users try to open the spreadsheet (shared in Google Drive), they get this error message:

    enter image description here

    I've already tried to:

    1. Share the spreadsheet to the user/s (Adding the user/s email address with permission Can edit)
    2. Deploy the webapp settings with the following settings:

    enter image description here

    As you can see, the setting screen reports "You need to authorize the script before distributing the URL".

    How can I authorize the script? I can't find a way to do that. Do you know if there's another way to share and let other users run the script?

  • BeNdErR
    BeNdErR almost 10 years
    what if I need to share the ui dialog and the spreadsheet instead?
  • Zig Mandel
    Zig Mandel almost 10 years
    post a minimal code so we know what are you doing and with what triggers. does the error happen in onOpen? in general you shouldnt do anything there that requires authorization, use a menu item to make the auth happen, each user would need to execute the menu item first.
  • BeNdErR
    BeNdErR over 9 years
    The code validates the spreadsheet cells content, then if everything is ok it creates a copy of the current sheet in a specific gdrive folder. I think the permissions issue is on this kind of action..
  • ScottMcC
    ScottMcC about 6 years
    I didn't get the chance to authorize but simply running it in the editor fixed the issue that I was having