Allowing anonymous access to Google Apps Script web app (Google Apps account) - google-apps-script

I have a spreadsheet in my Google Drive that I would like to share through a web app. I want the script to run as me and allow everyone to access the web app.
When this is done in my personal Google account (non Google App account), I get "Anyone, even anonymous" option under "Who has access to the web app" section in the "Publish as a web app" dialog in the Apps Script editor. And everything works fine.
However when I try to do the same thing in my Google Apps account in my organization, I do not get "Anyone, even anonymous" option under "Who has access to the web app" section. Only options that are presented is "Only myself" & "Anyone within XXXXXXX.com"
Anybody have any idea why this is happening? Is there any security option that I can change in my Google Apps domain?
Thanks

Have you checked with your Google Apps Administrator? They might have enforced a policy that one can not share the docs outside the organization.
Here is the documentation on docs sharing policy.
https://support.google.com/a/answer/60781?hl=en

This setting is controlled by the domain administrator via the "Allow users in [domain] to publish files on the web or make them visible to the world as public or unlisted files" options that's under "Settings for Drive and Docs".
Note that after checking that option, you'll have to create a new Script in order to be able to publish it with "Anonymous" access. Existing scripts don't seem to get that option even after the setting has been changed.
Also note the Google issue tracker for this: https://issuetracker.google.com/issues/36764781

Related

GAS deploying option "Anyone, Even Anonymous" option is not available

I'm trying to use my google script app in the google site which should be publicly available to anyone.
When I'm trying to deploy my google script as a web app (Publish->Deploy as web app), in the "Who has access to the app" field, the "Anyone, Even Anonymous" option is not available. I have only "Only myself" and "Anyone within my domain".
** RESOLVED **
Hi guys,
This somehow misled me by choosing "User accessing the web app" under Execute the app as where it should be "ME"!
Only then then "Anyone, even Anonymous" will show up in the next dropdown. Took a while before I figured this out as I realized that Google needs to know the account who will execute the script. If its any user, then it will surely prompt the account login to where it should associate the "executor" of the script with. So if its always ME (your account) then it won't prompt anymore of any authentication.
This is where I can really mark this as RESOLVED!
Deploy as Web App window
For anyone that comes across this and is using the new Apps Script IDE, I found that the option only exists when using the legacy IDE.
In order to let users in the domain to share the webapp with "Anyone, even anonymous", your domain Admin should do the following:
Visit Google Admin console.
Select Apps > G Suite > Settings for Drive and Docs > Sharing settings.
In Sharing options > Sharing outside of [Your domain], select ON.
Beware, because of a current bug, if you created the script when the sharing settings were OFF, you won't be able to share it outside the domain, even if you change that. The sharing settings are applied when the script is created, and those settings cannot be changed. A new script should be created for that (after enabling sharing outside the domain).
Reference:
Issue Tracker: Cannot select "Anyone, even anonymous" option in web app publication screen

How to publish google apps script website

I wrote a simple Google Apps Script to launch google website. Its integrated with google sheet to get data from it. If I press publish button on the menu it works well. However, I pasted the url into another browser which has not same session with google apps script editor it is not working while attempts login to google.
The google account is not for google play developer. Should I register my google account as google play developer?
You have to set your Web App "Who has access to the app:" property to "Anyone, even anonymous".

File creation and download, Drive scopes, and publishing editor add-on

I'm working on an Forms add-on which would allow you to export survey response data and/or save it to user's Drive. Is there no way to do this other than allowing full Drive access through the most extensive scope?
And about publishing editor add-on, how does one go about with it? I'm unable to get it to G-Suite marketplace, and the original unlisted version was on Chrome Webstore. (which is now unavailable)
I tried to test it with "Integrate With Google" via the G-Suite Marketplace API, but nothing shows up when testing. I don't know why, since the add-on works as expected via "Test as extension" from Google Apps Script editor. And the "waiting for review" has been taking ages. Is there any way to know the status of it?
EDIT: It seems like only Drive API can be used with custom scope (after enabling it), but DriveApp always requires full-access scope. And the functions that fetch files from Drive ONLY give out those that the script has access to (created or opened with) if you're using drive.file scope.
...the publishing part is still a mess though.
Regarding scopes and using Drive through Apps Script, there is two things that are needed to know.
1) DriveApp class that is readily provided in Apps Script, always requires full read-write access to user's Drive. This apparently can't be changed.
2) Drive API (v2) under "Advanced Google Services" allows usage of all available Drive scopes. This, however, needs to be enabled separately.
Another thing: drive.file scope allows you to only access files and folders in user's Drive that have been opened or created with specific script. This includes queries, so you only get what you can access. No need to check permissions separately.

Can't make a Google Apps Script publish for anonymous users

I've built a Google Apps Script and when I try to publish it won't show an option to allow anonymous users. There are only two options: "Only myself" and "Anyone within mydomain.com"
We're using Google Apps for Business (or Work is it now?).
How do I make the other options available?
Sharing outside your Google Apps Domain may be disabled in Admin Console.
In your Google Apps Admin Console, go to Google Apps section, then Drive, click Sharing Settings and check that "Users can share files outside this organization" option is selected. Also select appropriate checkboxes below that option as necessary.
If your organization policies prevent sharing outside your domain, you can create and deploy your webapp from your personal gmail account instead.

Google App Script no longer have "Allow anyone to access" option when deploy to web app

i have a couple of google app script that reads and writes to a google spreadsheet
I used to deploy the script as a service to allow anyone to access, I allow "invoke as me"
Recently, I notice that the interface has changed to "deploy as web app"
However, now there is no option to "allow anyone to access". There is only 2 options to run the script either "only me" or "only anyone in domain"
Has Google changed the policy to not allow anyone to access scripts?
Or have I done anything wrong? Please advise
I really need the scripts to run publicly
urgent. thanks
It is possible. Here's what I did:
Go to the control panel of your Google Apps Account (instructions here)
Select the Settings tab
On the left, under Services, select Drive & Docs
In Sharing Options, select "Users can share documents outside this organization" (I've left the "Warn users..." check box blank)
Also in Sharing Options, I've selected "Private" under Document Visibility but I'm not certain that's necessary. You could try with/without.
Go back to Deploy as webapp in your script project and you should now see "allow anyone to access" - at least I do in mine!
The documentation seems to be quite clear on this matter, you haven't done anything wrong :
After you write the script, you publish it as a service. During the publishing process, you define who has access to the script.
In a Google Apps domain, you can publish the script so that only you have access or so that everyone in the domain has access.
In a Google consumer account, you can publish the script so that only you have access or so that everyone in the world has access.
If you need anyone outside your google apps domain to access your spreadsheet data you could install the script on a consumer account (that has sharing permission on the domain spreadsheet) and publish it from there.