5.1 Syncing to Google Calendar

NOTE: Using org-caldav with Google Calendar may be currently broken. See https://github.com/dengste/org-caldav/issues/284

The CalDAV endpoint for Google Calendar requires OAuth2 authentication. So first, you need to install the oauth2 library from GNU ELPA, and afterwards you need to acquire an application ID and secret from the Google Developer Console. For details on how to do this, follow the Google documentation at

https://developers.google.com/google-apps/calendar/caldav/v2/guide#creating_your_client_id

Put the client ID and secret into org-caldav-oauth2-client-id and org-caldav-oauth2-client-secret, respectively. Then set org-caldav-url to the symbol 'google, and look up the org-caldav-calendar-id as described above.

On first connection, the oauth2 library should redirect you to the Google OAuth2 authentication site. This requires a javascript enabled browser, so make sure that browse-url-browser-function is set to something like browse-url-firefox (the internal eww or w3m browsers will not work). After authentication, you will be given a key that you have to paste into the Emacs prompt. The oauth2 library will save this key in Emacs’ secure plist store, which is encrypted with GnuPG. If you have not yet used a secure plist store, you will be asked for its encryption passphrase. In the future, you should only need to enter that passphrase again to connect with Google Calendar.

By default, plstore will not cache your entered password, so it will possibly ask you many times. To activate caching, use

(setq plstore-cache-passphrase-for-symmetric-encryption t)