Table of Contents generated with DocToc
In order to use some of the new GAM 3.0 Calendar, Drive and (coming soon Google+) commands, Google requires you to setup a service account. You can then authorize this service account to act on behalf of your Google Apps account and all users. This is the OAuth 2.0 equivalent of the (deprecated) Two-Legged OAuth 1.0a.
- You can access the Google Cloud Console at:
https://cloud.google.com/console
you'll need to be logged in to a Google Account.
- Click Create Project.
- Give your project a name and ID.
- Click "APIs & auth" to the left.
- Click the green "ON" button for any service that have been pre-enabled in order to turn them off.
- Click the gray "OFF" button for Calendar API, Drive API, Drive SDK, Google+ API and Google+ Domains API to toggle them "ON". Accept any terms of service that may appear. Confirm each service is listed at the top and is on.
- Click the "Credentials" link to the left.
- Click the red "Create New Client ID" button.
- Give your app a name. Ensure "Service account" is selected and click the blue "Register" button.
- Save the downloaded file with a name of "oauth2service.p12" in the same folder/directory as gam.exe or gam.py.
- Underneath the Service Account area, click the "Download JSON" button and save the file with a name of "oauth2service.json" in the same folder/directory as gam.exe or gam.py.
- Now from the GAM, try running your GAM command that requires a Service Account. An example command would be:
gam all users show calendars
- GAM will print out an error. The error shows the Client Name of your OAuth Service Account as well as the scopes that are needed for the given command. Follow GAM's instructions to grant your Service Account access to your Google Apps domain in the Control Panel.