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

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.

Related

How do I give non-google member webapp permission?

I've built a webapp (form) that I want others to be able to use. But when they access it, it askes to login to their Google account. I've already changed the settings so "anyone can access".
Is there a way to bypass this or authorize anyones accesss to the app so non-google users can use it?
When deploying, just make sure to choose the following:
Execute as: Me (username#domain.com)
Who has access: Anyone
If it still didn't worked, try to copy the GS code into a new file and then choose the following details above again. This seems to solve the same issue for some other users.

How to troubleshoot Google login appearing when using Anonymous Web App

I am new to apps-scripts and want anonymous users to access my web app script that is container bound to a spreadsheet.
The web app displays a form that collects information that the script stores in the containing spreadsheet, it works perfectly when I am logged into my google account, but when logged out the web app url displays a google login screen instead of my form.
I am struggling for the way to troubleshoot this. I have checked:
the script is deployed to execute as 'me' and with access by anyone + anonymous
I am using the 'exec' url
I have put the oauth scopes into the manifest and reduced scope as I can
I have approved the unverified app.
Here are some extra elements that I don't know whether they are causing issues or not:
I add a single query parameter to the web app exec url before sending it to the user for them to use anonymously.
I have a number of other functions in the script apart from the doget(), these process data from the web app form, write data to the containing spreadsheet and return some of it to the user. In the same script I also add a menu to the containing spreadsheet.
There seem very few ways to get logging or troubleshooting information for this problem - especially with container bound scripts. Can anyone with more experience please explain why this problem might occur and suggest how I can troubleshoot and resolve it? As I say the web app url works perfectly when I'm logged in, but when I'm logged out or in incognito mode I get a Google account sign in form. Thank you.
I solved this whilst creating a minimal reproducible example as requested.
The problem lay in my confusion over deployments, /exec, /dev and V8 versus rhino.
This answer about /dev /exec is very helpful.
What I discovered is:
/dev always asks you to login to your google account if you're not logged in in your browser e.g. incognito mode.
As commented there has been some confusion under what circumstances V8 getUrl() returns /dev or /exec.
My suggestions for troubleshooting this for an anonymous web app:
Be very careful when testing anonymous web app using /dev - it will always lead to login request
Check very carefully what getURL() is returning - in combination with whether you are using rhino or V8.
I solved my particular problem by 'downgrading' to rhino by putting into the manifest: "runtimeVersion": "DEPRECATED_ES5"

Google Script ~ How to automate authorization for app?

I've made an app in Google Apps Script to use in an iframe on my site. Problem is I have to go through a bunch of steps every time someone new wants to use the app.
My goal:
What I would like to do is automate the app so it just approves anyone who authorizes it when they're initially prompted. Given that the users initial confirmation is the important part, I don't see why it would be a problem to just have the app allow them in, without them having to wait for me to confirm their confirmation.
The Breakdown:
The permissions settings for the app are as follows:
"Execute the app as:" = "User accessing the web app"
"Who has access to the app:" = "Anyone"
The user must obviously have a Google account to use this app, and they have to authorize the app before they can use it. When they do, an email gets sent to me, I have to find it, open it, and click the "Open sharing settings" link which opens the apps script file, then click "send" on the popup just to allow that one person to use the app.
Many people will be requesting authorization, and I don't want to have to check my gmail every day and manually confirm 5 or 10 new authorizations. That's way too much for me, and too much of a pain for the people using it. Despite having put almost a year into coding this thing, I'd rather not deploy it than bother with that. Yea, I definitely should've scoped this out better before coding the bulk of it.
Potential Solution:
This is a relatively naive guess, but would it work for me to make a second app that runs on a schedule, and opens the initial app's script file in an iframe, using sandbox="allow-same-origin allow-popus" attribute, then maybe use javascript to toggle "send" on the "share with others" pop-up?

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

Google Chrome Browser Sync using Google Apps Domain

I have a bit of a nagging problem here. At my current position, we have a Google Apps domain set up (for the sake of this question, it will be pennmanor.net) and I would like to determine a way to log in to Google Chrome (the web browser) and connect the Apps account to sync the settings.
I have found this article: Bug Report that describes the issue, which has been resolved. I have made sure that the options described in Comment 64 are correct, but still no sync. Other articles suggest that it is simply a matter of punching in the credentials and thats it.
We do have a custom SSO and Active Directory set up with the apps account, would this possibly be the cause of the problem?
Does anyone know what I might need to do to enable account Google Chrome to sync pennmanor.net account?
Are you setting user's Google password? Chrome Sync will not use the SSO password. If your users are stored in Active Directory, you can use the Google Apps Password Sync tool to sync passwords from AD to Google as they are changed:
http://support.google.com/a/bin/answer.py?hl=en&answer=2611859