Limiting Google Apps Script Web app to certain users only

Viewed 5487

Making a web app that makes changes to certain (Sheets) files on my Google Drive (i.e. user will use the app as me), but I would like to restrict the Web app access only to certain users. When deploying app, I only have the options of making it private or public. One solution would be to use the session class to see if a correct user is logged in.

function onAppBegin(){

 if (Session.getActiveUser().getEmail() != "correctappuser@gmail.com") return null;
 accessGranted();
}

However, I am concerned if this crude method is actually safe and is not hackable?

1 Answers
Related