0

I have a published Web App in Apps Script set to "anyone in my domain can view" that I need to "execute as me". If an end user is only signed into Google accounts that aren't in my domain, they get an ugly

Sorry, unable to open the file at this time.

Please check the address and try again. 

error message. If I embed the published Web App within a Google Site and publish the Site as "people in my domain can view", then users only signed into Google accounts that aren't in my domain get the ugly

404. That’s an error.

The requested URL was not found on this server. That’s all we know.

error. What I want is to redirect end users to sign into their Workspace account on my domain if they aren't already authenticated, or pass through if they are. I've even tried:

https://accounts.google.com/AccountChooser?hd=mydomain.com&continue=https%3A%2F%2Fscript.google.com%2Fa%2Fmacros%2Fmydomain.com%2Fs%2MY-APP-URL%2Fexec

but that forces a re-auth if they're already authenticated. What are my other options?

1 Answer 1

2

It is impossible to guide the user in logging in to a domain account using a Google Apps Script web app deployed only to the owner's domain.

One option is to use a second thing, like a Google Site or web app, deployed to anyone with the link to provide the guidance.

It's worth mentioning that Google Apps Script web apps, dialogs and sidebars created using the HTML Service don't support multiple Google accounts signed in. Considering this, your guidance should include instructions to sign out of non-domain accounts, use another web browser profile, guest or private mode or use a different web browser.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.