Web app asking user to login, even though its been deployed to be used by “Anyone, even anonymous”

231 views
Skip to first unread message

Script GS

unread,
Oct 13, 2019, 1:02:37 AM10/13/19
to Google Apps Script Community

I've deployed a script to be used as a web app that can be accessed by "Anyone, even anonymous" and yet, if a user has not logged into a gmail account on a particular browser, its asking them to login.


Here's my manifest file -


{
 
"timeZone": "Asia/Kolkata",
 
"dependencies": {
 
},
 
"webapp": {
   
"access": "ANYONE_ANONYMOUS",
   
"executeAs": "USER_DEPLOYING"
 
},
 
"exceptionLogging": "STACKDRIVER"
}

To replicate the problem, you can visit the following link by logging out of your gmail accounts (or in a browser that does not have your gmail sign in) -

https://script.google.com/macros/s/AKfycbyayXeY_LGm7sy-J1VGvg7wfqOZYonZmKphS0F4Qz4jLZ336qsR/exec/test*

*it is required that you not change the pathInfo of the URL


Current behavior -

  • When signed in: You will be redirected to https://www.google.com/
  • When signed out: You'll be asked to login to your Google acc.

I'm building (or rather, though I already had built) a URL shortener service using Apps Script and oddly, it is not asking users to login when accessed from a custom domain (an iframe embedded in https://tmt.pw) but it is asking them to login once they shorten the URL and try visiting the shortened URL.


The original resources are all available here -

I've tested this on Chrome, Safari and Firefox (all on a Mac) and they all exhibit the same behavior.


I'm guessing this is something very fundamental and all I want is the web app to not ask users to login, given that it has been instructed to execute even for an anonymous user.


The script has some business with a Spreadsheet as well and so I tried making the sheet publicly editable by everyone (anyone on the internet) and it still didn't work.


Was using 1 private function (with an _ at the end of the function name) & have stopped doing that in my script - still no change; problem persists.

Alex

unread,
Oct 13, 2019, 2:15:03 AM10/13/19
to Google Apps Script Community
Don't use pathInfo property and all be fine.

You cannot use cheating in production.

Script GS

unread,
Oct 13, 2019, 3:18:45 AM10/13/19
to Google Apps Script Community
Hey Alex - turns out you were right :) Rolled back to using e.queryString!

Alex

unread,
Oct 14, 2019, 9:30:21 AM10/14/19
to Google Apps Script Community
Thanks for the confirm.
Reply all
Reply to author
Forward
0 new messages