Copy pasting the script from Google Apps deployments repo
Fixing the helper to authenticate using 2LO OAuth1
Fixing the helper to authenticate using 2LO OAuth1