I have an Apps Script web app which serves GET requests (via doGet
). I want to ensure that it is called from only my website, e.g. I want a way to authenticate the request. However, the document object is not accessible in Apps Script, so I cannot check document.referrer
. How do I access the origin of the request?
If this isn't possible, is there any way to authorize requests to be served from just my website and reject other requests? I am using ajax to make the request.