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
- Go to console.cloud.google.com and sign in.
- In the top bar, click the project selector and choose New Project.
- Name the project e.g.
LockMyCal Productionand 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)
3. Configuring the OAuth Consent Screen
- In the left menu, go to APIs & Services -> OAuth consent screen.
- 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.
- Fill in the required fields:
- App name:
LockMyCal - User support email: Your contact email
- Developer contact information: Your technical email
- App name:
- In the Scopes step, add:
emailandprofile(sign-in).../auth/calendar.eventsand.../auth/calendar.calendarlist.readonly(calendar).../auth/meetings.space.created(Google Meet)
- Save the settings.
4. Creating an OAuth 2.0 Client ID
- In the left menu, go to APIs & Services -> Credentials.
- Click + Create Credentials -> OAuth client ID.
- As the application type, choose Web application.
- 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 - 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.