Skip to main content

Google project setup

TheBooking uses one Google Cloud project and one OAuth web client for all Google Accounts connected to the WordPress site.

Before you begin​

  • Serve WordPress over HTTPS.
  • Sign in to the Google account that is to own the Cloud project.
  • In TheBooking, open Settings > Integrations, turn on Google Calendar, and select Configure. In Settings > Integrations > Google Calendar, keep the values under Values for your OAuth client at hand: the Authorized redirect URI and the Authorized JavaScript origin. Select Copy to copy each value.
The Authorized redirect URI and Authorized JavaScript origin to copy into the OAuth client in Google Cloud

Configure Google Cloud​

  1. Create or select a dedicated project in the Google Cloud console.
  2. Enable the Google Calendar API from the API Library.
  3. Configure the Google Auth consent screen with an application name, support email, and developer contact.
  4. Choose the audience and the publishing status of the application: see Audience and publishing status.
  5. Create an OAuth client with application type Web application.
  6. Add the exact Authorized redirect URI shown by TheBooking to the authorized redirect URIs of the client. Add the Authorized JavaScript origin only if Google asks for one. A mismatch produces Google's redirect_uri_mismatch error.
The OAuth client in the Google Cloud console, with the authorized redirect URI, the client ID, and the client secrets
  1. In Settings > Integrations > Google Calendar, enter the client ID in Client ID, the client secret in Client secret, and the name of the application in App name. Then select Save.

Do not publish the client secret, place it in documentation screenshots, or reuse credentials from an unrelated application.

Audience and publishing status​

TheBooking asks Google for access to the calendars of each account: the list of calendars, the free/busy times, and the events. Google counts these permissions as sensitive, so the audience of the application decides who can connect an account and what they see.

AudienceWho can connectWhat they see
InternalOnly the accounts of your Google Workspace organization.No warning, and no verification.
External, published In productionAny Google account, up to 100 accounts over the life of the project.The warning Google hasn't verified this app, at each connection, until Google verifies the application.
External, in TestingOnly the test users you list, up to 100.The connection stops working after 7 days.
  • When all the accounts belong to your Google Workspace organization, choose Internal.
  • Otherwise, choose External and publish the application: open Google Auth Platform > Audience and select Publish app. You don't have to submit it for verification: whoever connects an account goes past the warning, as described in If Google hasn't verified the app. The limit of 100 accounts counts only the Google accounts that connect, those of administrators and providers: customers never connect one.
  • Avoid Testing: Google ends the authorization of a test user 7 days after the connection, and the account must be connected again every week.

To remove the warning and the limit, submit the application to Google for verification. Google asks for a home page and a privacy policy on a domain you own, and reviews the use of the Calendar permissions. See Google's help on unverified apps.

Google changes the console navigation regularly. Refer to Google's current web-server OAuth guide if a label has moved.

Settings​

Settings > Integrations > Google Calendar appears when Google Calendar is on under Settings > Integrations.

SettingWhat it doesDefault
Client IDThe client ID of the OAuth client.Empty
Client secretThe client secret of the OAuth client. Keep it private.Empty
App nameThe name of the OAuth consent screen, which users see when they authorize the account.Empty
Let providers connect their own Google accountLets providers connect their own accounts. It is available when providers are enabled. See Connect a Google account.Off
Allow service providers to use override commands.Lets providers use slot commands in the titles of their events. It appears when providers are enabled, can manage their own availability, and can connect their own accounts. See Providing availability.Off
Refresh delayFor calendars without Live updates: how long TheBooking keeps the availability read from Google Calendar before reading it again, from 30 seconds to 1 hour. With No caching, it reads Google Calendar at every request. A longer delay saves Google API quota, but changes in Google Calendar appear later. Calendars with Live updates do not use it.1 minute

The Authorized redirect URI and the Authorized JavaScript origin are not settings: the page shows them under Values for your OAuth client, to copy into the OAuth client.

Next step​

Connect a Google account and verify that its calendars are listed before assigning calendar roles. On a public HTTPS site, turn on Live updates for the account to keep availability in sync through Google's notifications.