Many thanks to Carlos Pineda, Senior Solutions Advisor at Zimbra, for this post!
Did you know that you can sync your Gmail calendar to your Zimbra account, starting with Zimbra 8.8.9? This means that you can see your Zimbra events in your Gmail calendar AND your Gmail events in your Zimbra calendar. Any change you make to one calendar will sync to the other including new events, updates to events, and deleted events.
There are steps to perform in Google, on the Zimbra server and in the Zimbra Web Client. Let’s start with the steps in Google.
Steps in Google
1. Create a Project in the Google Developer Console.
- Go to https://console.developers.google.com/
- Login using your gmail account.
- Create a Project.
2. Create credentials to access Google’s APIs. A client ID and client secret are required to authenticte users and gain access to Google’s APIs.
- Specify OAuth consent screen details.
- Create credentials specifying your ZCS environment; for example, https://mail.zimbra.io
3. Enable CalDAV API.
Steps on the ZCS Server
-
- Set zimbraOAuthConsumerAPIScope on your domain.
zmprov md <your domain> zimbraOAuthConsumerAPIScope ‘https://www.googleapis.com/auth/calendar:google_caldav’
-
- Set zimbraOAuthConsumerCredentials on your domain. Specify your client id and client secret.
zmprov md <your domain> zimbraOAuthConsumerCredentials <client id>:<secret>:google
-
- Set zimbraOAuthConsumerRedirectUri on your domain.
zmprov md <your domain> zimbraOAuthConsumerRedirectUri ‘<hostname>/service/extension/oauth2/authenticate/google:google’
Example:
zmprov md zimbra.io zimbraOAuthConsumerRedirectUri ‘https://mail.zimbra.io/service/extension/oauth2/authenticate/google:google’
Steps in the Zimbra Web Client
- Login to your Zimbra Web Client.
- Authorize Google to visit the following URL, specifying your hostname: https://<hostname>/service/extension/oauth2/authorize/google?type=caldav
- Select your Gmail account, and you will see the Gmail Calendar in the Zimbra Calendar.
- You can create an event from Zimbra into Gmail Calendar or create an appointment in Gmail Calendar, and see it from Zimbra.
Calendar View in Zimbra
Calendar View in Gmail
Thanks for reading,
Your Zimbra Friends & Colleagues
Hi There a very interesting Post as ive been looking for this however
I am getting this error when adding attribute
zmprov md zimbraOAuthConsumerAPIScope ‘https:/www.googleapis.com/auth/calendar:google_caldav’
ERROR: account.INVALID_ATTR_NAME (invalid attr name: invalid attr name – unable to modify attributes: ldap host=:389: zimbraOAuthConsumerAPIScope: attribute type undefined
Do I have to create these first and if so what are the steps?
Hi Mike – thanks for your comment. Please post this in the Zimbra Forums for a quick response: https://forums.zimbra.org. Thanks!
Hi Mike – thanks for your comment. Please post this in the Zimbra Forums for a quick response: https://forums.zimbra.org. Thanks!
I applied the first step on the ZCS Server:
1. Set zimbraOAuthConsumerAPIScope on your domain but this error appears:
ERROR: account.INVALID_ATTR_NAME (invalid attr name: invalid
attr name – unable to modify attributes: zimbraOAuthConsum
rAPIScope: attribute type undefined)
By applying the steps on the ZCS Server:
1. Set zimbraOAuthConsumerAPIScope on your domain. Tthis error appears:
ERROR: account.INVALID_ATTR_NAME (invalid attr name: invalid attr name – unable to modify attributes: zimbraOAuthConsumerAPIScope: attribute type undefined)
Hi Ivan – thanks for your comment. Please post this in the Zimbra Forums for a quick response: https://forums.zimbra.org. Thanks!
I simply add gmail calender as external calendar into Zimbra.
Do you have to do the server side if each user wanted to have there own Google Sync?
Hi Peter – thanks for your comment. Please post this in the Zimbra Forums for a quick response: https://forums.zimbra.org. Thanks!
Does the same procedure work for multiple users on the same domain?
Hi – thanks for your comment. Please post this in the Zimbra Forums for a quick response: https://forums.zimbra.org. Thanks!
Do you need a specific version of Zimbra to do this? I am running 8.8.6 and I’m getting account.INVALID_ATTR_NAME errors:
[zimbra@zimbra ~]$ zmprov md mydomain zimbraOAuthConsumerAPIScope ‘https://www.googleapis.com/auth/calendar:google_caldav’
ERROR: account.INVALID_ATTR_NAME (invalid attr name: invalid attr name – unable to modify attributes: ldap host=my_server:389: zimbraOAuthConsumerAPIScope: attribute type undefined)
Hi Scott – thanks for your comment. Please post this in the Zimbra Forums for a quick response: https://forums.zimbra.org. Thanks!
Hello,
I’m trying to implement this but I’m running into the following error.
zimbra@zimbra:/$ zmprov md mydomain.com zimbraOAuthConsumerAPIScope ‘https://www.googleapis.com/auth/calendar:google_caldav’
ERROR: account.INVALID_ATTR_NAME (invalid attr name: invalid attr name – unable to modify attributes: zimbraOAuthConsumerAPIScope: attribute type undefined)
I’m attempting this on version 8.6. Was this not implemented until a later version?
Thanks,
Stephen
Hi Stephen – thanks for your comment. Please post this in the Zimbra Forums for a quick response: https://forums.zimbra.org. Thanks!
I’ll post it over there but could you update at least update the article with supported versions?
Thanks,
Stephen
Hi Stephen — I’ve updated the post, and it’s starting with Zimbra 8.8.9. Thanks!
Hey Gayle,
Web searches are bringing people to this page. The error that we’re receiving makes it pretty useless, and there’s no followups on the forums (that I can find).
Instead of the canned message, could you give us at least what version of Zimbra is required?
Hi Kevin – have you opened a Zimbra Support case for the error that you are receiving? I’ll try to get you help with your issue, but until then, I will find out what version of Zimbra is required for this feature. Thanks.
Can you please update the “Steps in the Zimbra Web Client?”
It says “Authorize Google to visit the following URL, specifying your hostname: https:///service/extension/oauth2/authorize/google?type=caldav”
But it doesn’t provide any information about how that is to be done. It doesn’t specify how to add the calendar in the Zimbra client UI. I went to Add External Calendar, selected Google and then when I clicked Next, it just reloads the UI.
Hi Stephen – In the Zimbra Web Client, you should be able to select “Add External Calendar” (as you did) and specify the google URL. If that is not working, please contact your email admin. It’s possible that they have not enabled that feature. Thanks.
I got all the steps, however when I try
**** “Authorize Google to visit the following URL, specifying your hostname: https:///service/extension/oauth2/authorize/google?type=caldav”*****
I got this URL
https://xxxx.xxxx.xxxx/?error=unhandled_error#2
My Zimbra server version: 8.8.12_GA_3794.FOSS
Hi Onur – please ask this question on forums.zimbra.com. The Zimbra Community has more technical knowledge than I do. Thanks