Setting Up a Microsoft Azure App (Entra ID)

To connect LockMyCal to an Outlook / Microsoft 365 calendar and to create meetings in Microsoft Teams automatically, you need to register an application in the Microsoft Entra ID portal (Azure Portal).

Note

The same application is used for calendar synchronization, Teams video calls and also signing in with a Microsoft account (personal, work or school). For signing in, add the redirect URI https://bookings.yourdomain.com/auth/microsoft/callback and turn on ENABLE_MICROSOFT_AUTH=true (or the switch in Administration → Application settings → Authentication). The email from Microsoft is only pre-filled into the registration – a new user confirms it with a link.


1. Registering the application in the Azure Portal

  1. Sign in to portal.azure.com or entra.microsoft.com.
  2. Open the Microsoft Entra ID service (formerly Azure Active Directory).
  3. In the left menu, click App registrations -> + New registration.
  4. Set:
    • Name: LockMyCal
    • Supported account types: Choose Accounts in any organizational directory and personal Microsoft accounts (if you want to support both business M365 and personal @outlook.com accounts).
    • Redirect URI: Choose the Web platform and enter:
      https://bookings.yourdomain.com/auth/outlook/calendar/callback

      After registration, under Authentication, also add https://bookings.yourdomain.com/auth/teams/video/callback (Teams) and, if needed, https://bookings.yourdomain.com/auth/microsoft/callback (sign-in).

  5. Click Register.

2. Getting the Application (Client) ID

On the overview page of the newly registered application you'll see the Application (client) ID. Copy this value.


3. Creating a Client Secret

  1. In the left menu of the application, click Certificates & secrets.
  2. In the Client secrets tab, click + New client secret.
  3. Enter a description (e.g. LockMyCal Production) and choose a validity period (e.g. 24 months).
  4. Click Add and immediately copy the value in the Value field (it will no longer be shown after you leave the page).

4. Setting API permissions (Microsoft Graph)

  1. In the left menu, go to API permissions.
  2. Click + Add a permission -> Microsoft Graph -> Delegated permissions.
  3. Search for and add:
    • User.Read (basic profile and email)
    • Calendars.ReadWrite (reading and writing the calendar; Teams meetings are also created through it)
    • offline_access, openid, profile, email
  4. (Optional): If you are the tenant administrator, click Grant admin consent for [Your organization].

5. Configuration in LockMyCal

Add the variables to .env:

OUTLOOK_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
OUTLOOK_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OUTLOOK_STATE_SECRET=random_string   # openssl rand -base64 32
# Optionally signing in with a Microsoft account:
ENABLE_MICROSOFT_AUTH=true