How do you restrict a Google App Maker application so that only users in a Google Group can access it? - google-apps-script

I have built a Google App Maker application and published it. However, I only want users in a Google Group to be able to access the application (view UI elements) via the deployment link. How do you do this? I referenced this solution to another post: https://stackoverflow.com/a/49577258/9878092. I cannot seem to find where the Application access section that is mentioned in the solution is. Thank you!

Here are the steps you can follow to go to 'Application Access' screen.
From your appmaker window click on 'Setting' icon.
Go to Deployments tab.
Publish new deployment if you haven't done already. If you have already deployed your changes then click on the deployed version and "Edit" button.
This will open the Application Access screen. Select option "Only allow to specific" users. Provide user names who should be able to access the app.

Related

Google web app script keeps asking for users to sign in?

I have created my script and it works great. I have changed the sharing so anybody can view it, but it still asks users to login to their Google account to run the script.
Here is the link: My script
Currently you're web app is set to execute as User accessing the web app. This means they need to sign into a Google account to execute any of the code in your app.
You need to change this setting to: Execute the app as: Me
As well as change Who has access to the app from Anyone to Anyone even anonymous
Example:
The setting can be found by clicking on the cloud icon in the Apps Script IDE's toolbar.
Edit: Added new image to reflect proper settings.
It might be that they've updated the settings to where the least restrictive option is "Anyone" which would still require a log in. This is happening with my Google Workspace for Education account.

How to allow Chrome Kiosk App configuration access for administrators?

I'm building a Chrome kiosk app that will be in a public space. Users can interact with the app, but there are a variety of settings (server addresses, timeouts, etc.) that need to be set. I'm looking for a strategy on how to allow access to that administration config.
On first run - This is straightforward, but I want administrators to be able to pull it up again.
Detect if the app ran as a kiosk app or manually - This would kind of work, not sure if it's the greatest
Detect some key combination - Ctrl + Alt + Something switches over to the settings page, this feels like people could stumble on it accidentally.
Is there another approach I'm missing?
If your Chrome device(s) is managed you have a further option which is to use the Chrome App Management area within the Google Apps admin interface.
To do this you code your app to use the storage.managed API and this should allow a Configure section for your app within Chrome App Management.
I haven't tried this myself yet but this appears to be the way the Chrome Sign Builder app is configured with its schedule.
Another approach would be to have an administrator login button in a corner of the app. You can set a default password for administrators, which could then be changed in the settings dialog.
You can also think of combining suggestions you have made, first run and then a key combination, and this could bring up a password prompt as also suggested. For an example of this see the Zebradog Kiosk app which is in GitHub so you can see code of how this could be done.
I use ctrl-alt-S at boot. This allows me to login and make changes. I know you have to do a couple of reboots, but it is out of service during admin time anyway.

Connecting my application to Google Drive for test accounts?

I'm setting up my application in Google Marketplace.
I would like to test creating a document with my application.
I want to know - how can I connect my application to Google Drive Create menu for certain test users?
I published my application to specific test group of users
I sign-in as one of the test users
Click on a direct link to install my application.
Install my application.
Go to Google Drive - click Create I don't see my application in the list.
If I can't connect my application for test users, how does one test create/open files for an application? Direct links?
update: When I go to Setttings -> Manage apps, I see my application in the list as one of the connected applications. However when I try to open it via Create menu, it's not shown.
Okay, missed a form field "Create URL" in Google API console. By specifying Create URL, the app now shows up in Create New menu.

Launching the Google Drive sharing dialog in an app. What should be the APP_ID value?

I'm following this article, trying to add a sharing dialog in a web app.
I got the button working in opening the modal popup, but it just prints this error in the console:
Refused to display 'https://drive.google.com/share?id=SOME_LONG_ID&foreignService=explorer&shareService=explorer&shareProtocolVersion=2&command=init&subapp=10&popupWindowsEnabled=true&shareUiType=default&rand=1386925457304&theme=2&client=postMessage&appId=MY_APP_ID&embedOrigin=http%3A%2F%2Fmy_app.appspot.com'
in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
And the modal itself just shows the message "Sorry, sharing is unavailable at this time. Please try again later."
For the checklist at the bottom of the article:
The user is signed in to Google True
The user has installed your app False How do I ask them to install?
The URL of the page that launches the dialog must have the same origin as the Open URL registered for the app. True
So I have 2 questions:
How do I ask them to install my app? It's supposed to be a web app, where there's 1 button to select Drive files via the Picker API (which is now working), and then another button which will sow this Drive sharing dialog to set the permissions of the selected files. There's no need for installation. Will it work for this setup?
What should be the value for the APP_ID? I'm guessing it's the ID in the "Drive SDK" section of the Cloud Console? The console is so confusing and there's so many values for keys, ids, etc. that I have no idea which to use. Here's a screenshot of what I mean by the ID and what I'm trying to use.
(1) Installing means you have to get the user to accept the drive.install scope - instructions here. This will integrate your app with the "open with" menu in Google Drive. But before that can work you will need to tell the Google Cloud Console what url to go to when the user clicks "open" - more instructions. In your case, since you don't actually want to allow the user to open files from Drive you won't be defining any file types, so in reality there won't actually be any visible integration with Drive.
Note that the share dialog will only work on the one page which has the url you specify as the target for "open" (the instructions say this and from experience it seems to be true).
(2) Client ID You can find this in the Google Cloud Console - see above. Mine is a 12 digit number, so yours will probably be too.
I had the same problem. The iFrame error shows up when you call setItemIds if your app_id is wrong. No idea why. Anyway, it started working for me when I used the right app_id -- the one that shows up like in your screenshot.

How to allow others to access a web app made from a Google Apps Script?

I deployed a web app from a Google Apps Script, but others don't seem to be able to run it.
(It runs fine for me when logged-in to Google)
I keep getting "Request to share" email, even though I set the source script to be "Public on the Web".
"Execute the app as:" is set to "User accessing the web app".
A link to the app is at http://truevis.com/rations
It could be very useful to others, but right now I think that no one else can run it.
The link you show here is the development link , the one that is described as "the last saved version of your code", this link is not shareable ... the one you should give to people is this one :
https://script.google.com/macros/s/AKfycbz1SKJi5HW1r2ZHiYpjedjul-IE4vcB266kdDzDrVCE/exec
it is shown in this popup window
beside that, the sharing properties of the script file is not relevant, you could keep it private.... only the settings in this window are important to determine who has access to your app and how (meaning run as you or as user accessing the app).
You should also keep in mind that users will see the version you have chosen in this same popup window, no matter the changes you could have saved and are using in your .dev version... so think about publishing the right version.
What I did to get it working:
I copied the GS code to a new file, deployed as Web app, then set "Execute the app as:" "me", "Who has access to the app:" "anyone even anonymous".
https://script.google.com/macros/s/AKfycbwPtys8PE8Wda_HS9rvrdftJ0TGbCfMlT5xLlfsNFt9m5uw6qM/exec
I think once you deploy a version with certain permission, it does not work properly if you change the permission for the same version.
Creating a new version seems to solve the problem