How to Create Keys for Google OAuth 2.0
This document will guide you through the process of creating a set of Google Credentials so that you can use Google Apps functionality, such Google Drive with BBj, Barista, and Addon. You’re probably reading this document in response to an error message that states:
“Client ID and Client Secret must be set. See https://links.basis.cloud/GoogleOAuth2.0” This document will show you how to resolve that error by obtaining and setting Google App keys.
In order to set keys for a BBj installation, you will need access to the BBj.properties file and be ready to restart BBjServices so that your keys can take effect.
In order to create a set of keys, you will need an associated Google App project. To create the project:
- Visit https://console.developers.google.com and log into your account.
- Click the blue [Create Project] button on the right side of the page, or click the [Select a Project] box near the top of the page and select "New Project".
- Give the project a name related to what you will be using the OAuth keys for, and then press the [Create] button to create your new project.
Once you’ve created the project, enable your project to use the Google Drive API (or whatever actual API you plan to use with the keys):
- Click on the APIs & Auth=>APIs node in the left navigation tree of the page and then find and click the “Drive API” link under the “Google Apps APIs” heading.
- Press the [Enable API] button. This authorizes your app to access Google’s web-based API interface.
Next, generate your application credentials:
- Click on the APIs & Auth=>Credentials node in the left navigation tree of the page.
- Click on the “OAuth consent screen” tab
- Fill out any missing required fields such as the email address and product name and then hit [Save]
- Click back on the “Credentials” tab, then click on the “Add credentials” combobox. Select “OAuth 2.0 client ID”.
- Choose “Other”, specify a name for the set of keys and then click the [Create] button.
- You now have the credentials you need for your application. Copy these values and press [OK].
- In your BBj.properties, add these two properties:
com.basis.util.goauth2.clientid=<your client id>
com.basis.util.goauth2.clientsecret=<your client secret>
- Restart BBjServices, and now you have the Client ID and Client Secret needed to access Google APIs in your application.