Follow these steps to configure your Google Apps domain to work with the Account provisioning for Google Apps API.
Login to your Google Apps domain with an admin account and go to https://console.developers.google.com/project.
Create a new project, e.g. My project.
Copy the Project Name you provided somewhere as you will use it later.
The project dashboard will automatically open once the project is created.
On the left side panel go to Credentials > Create credentials
and click on the option OAuth client ID.
Under Application type select Other, then type a name and click on Create.
The OAuth account is now created.
Copy the Client ID and Client Secret fields somewhere as you will use them later.
On the left side panel go to Credentials > Create credentials
and click on the option Service account key.
In Service account
select the option that has the name of the project, in Key type
select P12 option, then click on Create.
A P12 file will download. e.g. My project-84d807544f50.p12
. You will use this file later.
On the left side panel go to Credentials
and click on the link Manage service accounts.
Copy the Service account ID of your project in somewhere as you will use it later. This is the Email address of your project.
On the left side panel go to Overview > Google APIs
and search for admin sdk. Click on the Admin SDK result
Click on Enable
Go to https://admin.google.com and navigate to Security > Advanced settings > Manage OAuth domain key
If you don't see the Advanced settings click on Show more
Check the Enable this consumer key box
Finally, navigate to Security > Advanced settings > Manage OAuth domain key
Enter the Client ID that was created in step 2 in the Client Name input box. In the One or More API Scopes input box enter https://www.googleapis.com/auth/admin.directory.user
. Click on Authorize
Awesome! You now have everything you need to configure the API.
Open the config.properties
file and fill out the following fields:
Enter your Google Apps domain. Example:
apis.GoogleAPIs.domain=yourdomain.com
Enter your Google Apps account. This is the account you used to sign in and create the developers project in step 1. Example:
apis.GoogleAPIs.authUser=you@yourdomain.com
Move the P12 file you created in step 3 to the location where the appsProvisioning-0.0.1.jar
file is located. Set the keyPath
value to your P12 file location. Example:
apis.GoogleAPIs.keyPath=./My project-84d807544f50.p12
Enter the Service account Email address you created in step 3. Example:
apis.GoogleAPIs.serviceAccountEmail=1234567890123-abcdefghijklmnopqrstuvwxz01234567@developer.gserviceaccount.com
Provide the Project Name you created in step 1. Example:
apis.GoogleAPIs.appName=My project
Great! The configuration is now complete. You can now start using the Account provisioning for Google Apps API in your Google Apps domain.