Google App Scripts get IP

2019-08-04 08:00发布

问题:

How can I restrict a script on GAS to load only if the host has a certain IP?

I have a script that takes a input, submits, and then returns a table of data. But I want it to return the data only if the host has a certain IP because I don't want the data available outside this location.

No login is required.

回答1:

You cant currently detect the request ip with gas. At most you can detect the user's email.
see https://code.google.com/p/google-apps-script-issues/issues/detail?id=2569