Integrate Google Calendar

Deploy the Google Calendar integration to schedule calendar events and list events and office hours of a user from any device or intranet. This integration delivers these four use cases:

  • With the Create Event microapp, users can host one-time or recurring meetings, add invitees, and select different timezones. The microapp also follows up with an email to all invitees with the corresponding event object for easy calendar integration.
  • With the My Calendar (Current Month) microapp, users can view all upcoming events for the current month.
  • With the My Office Hours microapp, users can set up virtual office hours or list all the current month office hours of the user.

Note:

We provide two Google Calendar integration templates for your use. This new HTTP-based template (under the Preview category in the catalog) is more flexible and provides more power to configure the cached data structure. The java-based template (under the integrations category in the catalog) provides more use-cases.

For comprehensive details of out-of-the-box microapps for Google Calendar, see Use Google Calendar microapps.

Note:

This integration template is in Preview and marked as Preview in the list of available templates that are shown in the product when adding a new integration. While in Preview, there is no commitment to support, and support is provided by the developer on a best-effort basis. Preview integration templates are shared for the purpose of testing and validation. We do not advise deploying them in production environments. For more information, see Maintenance statement for Microapps integration templates.

Review prerequisites

These prerequisites assume that administrator will be a part of the Google Calendar integration set up of the organization. This Google Calendar admin account must have full read privileges for user information. After you set up this integration with Google Calendar , you will need these artifacts to add the integration in Citrix Workspace Microapps:

  • BASE URL: https://www.googleapis.com/
  • TOKEN URL: https://oauth2.googleapis.com/token
  • AUTHORIZATION URL: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent
  • CLIENT ID: The client ID is the string representing client registration information unique to the authorization server.
  • SECRET: The client secret is a unique string issued when setting up the target application integration.

Note:

We recommend that you always use OAuth 2.0 as your service authentication method where available. OAuth 2.0 ensures that your integration meets the maximum-security compliance with your configured microapp.

Configure Citrix Gateway to support single sign-on for Google Meet so that once users log in they are automatically logged in again without having to enter their credentials a second time. For more information about configuring SSO, see Citrix Gateway Service https://docs.citrix.com/en-us/citrix-gateway-service/.

The integration requires regular access to your Google Calendar instance, so we recommend creating a dedicated user account. This account must have the following permissions:

  • Permissions required for Service Account: Full administrator privileges

  • Scopes required for Service Account:

    https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.events https://www.googleapis.com/auth/admin.directory.user

The number of API requests that can be made to specific resources is limited, we therefore recommend the following:

Create a new service account

Sign in here: https://workspace.google.com/intl/en/pricing.html

How to enable APIs

Google Calendar API’s are enabled for access via web services for paid account by default.

Configure OAuth

  1. Log in with service account to: https://console.cloud.google.com
  2. Select APIs and Services on left-hand menu.
  3. Select the appropriate project from the project list on the navigation menu.
  4. Select ENABLE APIS AND SERVICES, and enable all the required APIs from G-Suite . Recommended APIs: Google Calendar API and Admin SDK.
  5. Go back to the APIs and Services page, and select OAuth consent screen on the left screen.
  6. Select the User Type according to your requirement (we recommend: Internal), and then select **Create.
  7. Complete the required fields including Scopes required for Service Account, and save the details. These are the required scopes:

Configure callback URL server

Configure the OAuth server to read data through the Google Calendar integration.

  1. Log in with service account to: https://console.cloud.google.com
  2. Select APIs and Services on left-hand menu.
  3. Select the appropriate project from the project list on the navigation menu.
  4. Select Credentials on the left screen.
  5. Select CREATE CREDENTIALS, and select OAuth client ID from the list.
  6. Select Web Application from the Application type list, and enter a Name.
  7. Select ADD URI under Authorized redirect URIs.
  8. Enter the following authorized redirect URLs for this integration in the URIs field:

    • https://{yourmicroappserverurl}/admin/api/gwsc/auth/serverContext
  9. Select Create.
  10. Copy and save the ClientId and Secret shown on the screen. You use these details for Service Authentication while configuring the integration.

Configure callback URL client

Configure the OAuth client for writing back data through the Google Calendar integration.

  1. Log in with service account to: https://console.cloud.google.com
  2. Select APIs and Services on left-hand menu.
  3. Select the appropriate project from the project list on the navigation menu.
  4. Select Credentials on the left screen.
  5. Select CREATE CREDENTIALS, and select OAuth client ID from the list.
  6. Select Web Application from the Application type list, and enter a Name.
  7. Select ADD URI under Authorized redirect URIs.
  8. Enter the following authorized redirect URLs for this integration in the URIs field:

    • https://{yourmicroappserverurl}/app/api/auth/serviceAction/callback
  9. Select Create.
  10. Copy and save the ClientId and Secret shown on the screen. You use these details for Service Action Authentication while configuring the integration.

Add the integration to Citrix Workspace Microapps

Add the Google Calendar integration to Citrix Workspace Microapps to connect to your application. This delivers out-of-the-box microapps with pre-configured notifications and actions which are ready to use within your Workspace.

Follow these steps:

  1. From the Microapp Integrations page, select Add New Integration, and Add a new integration from Citrix-provided templates.
  2. Choose the Google Calendar tile.
  3. Enter a name for the Integration.
    • Enter the instance Base URL: https://www.googleapis.com/.
    • Select an Icon for the integration from the Icon Library, or leave this as the default icon.
  4. Under Service authentication, select OAuth 2.0 from the Authentication method menu and complete the authentication details. The authentication options are preselected. Ensure that these options are selected as you complete the process. Use the OAuth 2.0 security protocol to generate request/authorization tokens for delegated access. It is recommended that you always use OAuth 2.0 as your service authentication method where available. OAuth 2.0 ensures that your integration meets the maximum security compliance with your configured microapp.

    1. Select Authorization code from the Grant type menu. This grants a temporary code that the client exchanges for an access token. The code is obtained from the authorization server where you can see the information the client is requesting. Only this grant type enables secure user impersonation. This displays the Callback URL, which you use when registering your application.
    2. Select Request body from the Token authorization menu.
    3. The Authorization URL is prefilled: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent
    4. The Token URL is prefilled: https://oauth2.googleapis.com/token
    5. Ensure the following is entered for Scope: https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.events https://www.googleapis.com/auth/admin.directory.user
    6. Enter your Client ID. The client ID is the string representing client registration information unique to the authorization server. You collect this and the secret when you configured the OAuth server. You need to add the Callback URL you see on the integration configuration page.
    7. Enter your Client secret. The client secret is a unique string issued when setting up the target application integration.

    Service authentication

  5. Under Service Action Authentication, enable the Use Separate User Authentication in Actions toggle. Service action authentication authenticates at the service action level. The authentication options are preselected. Ensure that these options are selected as you complete the process.

    1. Select OAuth 2.0 from the Authentication method menu and complete the authentication details.
    2. Select Authorization code from the Grant type menu. This grants a temporary code that the client exchanges for an access token. The code is obtained from the authorization server where you can see the information the client is requesting. Only this grant type enables secure user impersonation. This will display the Callback URL, which you use when registering your application.
    3. Select Request body from the Token authorization menu.
    4. The Authorization URL is prefilled: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent
    5. The Token URL is prefilled: https://oauth2.googleapis.com/token
    6. Ensure the following is entered for Scope: https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.events
    7. Enter your Client ID. The client ID is the string representing client registration information unique to the authorization server. You collect this and the secret when you configured the OAuth client. You need to add the Callback URL you see on the integration configuration page.
    8. Enter your Client secret. The client secret is a unique string issued when setting up the target application integration.

    Service action authentication

  6. Enable the Enable request rate limiting toggle. Enter 100 for Number of requests and 1 minute for Time interval.
  7. (Optional) Enable Logging toggle to keep 24 hours of logging for support purposes.

    Rate limiting and logging toggles

  8. Select Save to proceed.
  9. Under OAuth Authorization, select Authorize to log in with your service account. A pop-up appears with a Google login screen.
    1. Enter your Service Account user name and password and select Log in.
    2. Select Accept.

    Authorize

The Microapp Integrations page opens with your added integration and its microapps. From here you can add another integration, continue setting up your out-of-the-box microapps, or create a new microapp for this integration.

You are now ready to set and run your first data synchronization. As a large quantity of data can be pulled from your integrated application to the Microapps platform, we recommend you use the Table page to filter entities for your first data synchronization to speed up synchronization. For more information, see Verify needed entities. For complete information about synchronization rules, synchronization that does not meet its schedule and veto rules, see Synchronize data.

Note:

It is recommended to set the “Full Synchronization” interval as Weekly to remove the cancelled or deleted events from Microapps platform and subsequently from the user’s calendar.

For more details of API endpoints and table entities, see Google Calendar connector specifications.

Use Google Calendar microapps

Existing application integrations come with out-of-the-box microapps. Start with these microapps and customize them for your needs.

Note:

Since the currently available time zones are hardcoded in the Create Event, My Office Hours and My Calendar (Current Month) microapp, the addition of any other time zone would require the admin to add them manually.

Create Event: Schedule an event according to user preferences.

Notification or Page Use-case workflows
Create Event page Provides a form to schedule an event with these details: Event Title, Google Meet Video link, Start and End Time, Time Zone, Recurrence (One Time, Daily, Weekly, Monthly), Description, Location, and Event Attendees.

My Calendar (Current Month): View list of the upcoming current month’s one-time and recurring calendar events and the ability to edit the events.

Notification or Page Use-case workflows
Event Notification Details page Detail page which shows all appropriate details of an event and Join now button to start the meeting. User can also redirect to Google Calendar by selecting Open My Calendar.
Load Events page Provides a list of one-time and recurring calendar events available for the user with Refresh List button to refresh the list. Users can view event details by clicking on the events available in the list.
List Events page Provides up to date list of one-time and recurring calendar events available for the user. Users can view event details by clicking on the events available in the list.
Event Details page Detail page which shows all the appropriate details of the event. User can start/join the meeting by selecting Join Event and users can redirect to Google Calendar by selecting Open My Calendar.
All Day Event Details page Detail page which shows all the appropriate details of all day events. User can start (join) the meeting by selecting Join Event and users can redirect to Google Calendar by selecting Open My Calendar.
Edit OneTime Event page Form page to edit the one-time event.
Edit Recurring Event page Form page to edit the existing recurring event.

My Office Hours: Create, edit, and view office hours.

Note:

Refresh button is used to sync cache with the most recent data, in lieu of full or incremental synchronization.

Notification or Page Use-case workflows
Create Office Hours page Provides a form to create office hours with these details: Start and End Time, Time Zone, Recurrence (One Time, Daily, Weekly, Monthly).
My Office Hours List page Provides a list of user office hours available with a Refresh List/Load My Hours button to update/refresh the list. User can add office hours by selecting Add Office Hours.
Edit My Office Hours page Form page to edit user office hours.
Integrate Google Calendar