Setting Up a Google OAuth Application (Cloud Console)

To enable signing in via Google, synchronization with Google Calendar and automatic creation of video conferences in Google Meet on your self-hosted LockMyCal instance, you need to create one shared OAuth 2.0 application in the Google Cloud Console.

Note

One Google OAuth application serves all 3 features at once: Google Login, Google Calendar synchronization and the generation of Google Meet links.


1. Creating a project in the Google Cloud Console

  1. Go to console.cloud.google.com and sign in.
  2. In the top bar, click the project selector and choose New Project.
  3. Name the project e.g. LockMyCal Production and click Create.

2. Enabling the required Google APIs

In the left menu, go to APIs & Services -> Library and search for and enable the following APIs:

  • Google Calendar API (calendar synchronization)
  • Google Meet REST API (only if you want to create Google Meet rooms)

  1. In the left menu, go to APIs & Services -> OAuth consent screen.
  2. Choose the user type:
    • Internal: If you have Google Workspace and want to allow access only for colleagues in the organization.
    • External: For general use.
  3. Fill in the required fields:
    • App name: LockMyCal
    • User support email: Your contact email
    • Developer contact information: Your technical email
  4. In the Scopes step, add:
    • email and profile (sign-in)
    • .../auth/calendar.events and .../auth/calendar.calendarlist.readonly (calendar)
    • .../auth/meetings.space.created (Google Meet)
  5. Save the settings.

4. Creating an OAuth 2.0 Client ID

  1. In the left menu, go to APIs & Services -> Credentials.
  2. Click + Create Credentials -> OAuth client ID.
  3. As the application type, choose Web application.
  4. In the Authorized redirect URIs field, add:
    https://bookings.yourdomain.com/auth/google/callback
    https://bookings.yourdomain.com/auth/google/calendar/callback
    https://bookings.yourdomain.com/auth/google/video/callback
  5. Click Create. Google shows you the Client ID and Client Secret.

5. Writing it into the LockMyCal configuration

Add the obtained keys to your .env file:

GOOGLE_CLIENT_ID=123456789-xxxxxxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxx
GOOGLE_STATE_SECRET=random_string   # openssl rand -base64 32
# Only for signing in with a Google account (the calendar and Meet work without it too):
ENABLE_GOOGLE_AUTH=true

After restarting the container, the connection with the Google ecosystem is activated on the sign-in page and in the calendar settings section.