Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depricated google endpoint - new endpoint doesn't work #28

Closed
wentasah opened this issue Sep 24, 2013 · 4 comments
Closed

Depricated google endpoint - new endpoint doesn't work #28

wentasah opened this issue Sep 24, 2013 · 4 comments

Comments

@wentasah
Copy link

Hello,

https://developers.google.com/google-apps/calendar/caldav/v2/guide says that https://www.google.com/calendar/dav endpoint is deprecated. One should use https://apidata.googleusercontent.com/caldav/v2/calid/events instead. I tried to

(setq org-caldav-url "https://apidata.googleusercontent.com/caldav/v2")

and modified the source like this:

diff --git a/org-caldav.el b/org-caldav.el
index cccb9bf..7241a26 100644
--- a/org-caldav.el
+++ b/org-caldav.el
@@ -322,7 +322,7 @@ Are you really sure? ")))
 
 (defun org-caldav-events-url ()
   "Return URL for events."
-  (if (string-match "google\\.com" org-caldav-url)
+  (if (string-match "google\\(usercontent\\)?\\.com" org-caldav-url)
       (concat org-caldav-url "/" org-caldav-calendar-id "/events/")
     (concat org-caldav-url "/" org-caldav-calendar-id "/")))
 

I ended up with an error:

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
  url-http-handle-authentication(nil)
  url-http-parse-headers()
  url-http-chunked-encoding-after-change-function(415 440 25)
  url-http-wait-for-headers-change-function(1 453 452)
  url-http-generic-filter(# "HTTP/1.1 401 Unauthorized
\nWWW-Authenticate: Bearer realm=\"https://www.google.com/accounts/AuthSubRequest\"
\nContent-Type: text/html; charset=UTF-8
\nDate: Tue, 24 Sep 2013 13:32:04 GMT
\nExpires: Tue, 24 Sep 2013 13:32:04 GMT
\nCache-Control: private, max-age=0
\nX-Content-Type-Options: nosniff
\nX-Frame-Options: SAMEORIGIN
\nX-XSS-Protection: 1; mode=block
\nServer: GSE
\nAlternate-Protocol: 443:quic
\nTransfer-Encoding: chunked
\n
\ne
\nLogin Required
\n0
\n
\n")
  accept-process-output(#)
  #[0 "\302�\303\300@!)\207" [(#) inhibit-quit nil accept-process-output] 2 "\n\n(fn)"]()
  funcall(#[0 "\302�\303\300@!)\207" [(#) inhibit-quit nil accept-process-output] 2 "\n\n(fn)"])
  url-retrieve-synchronously("https://apidata.googleusercontent.com/caldav/v2/wentasah@gmail.com/events/")
  url-http-options("https://apidata.googleusercontent.com/caldav/v2/wentasah@gmail.com/events/")
  url-dav-supported-p("https://apidata.googleusercontent.com/caldav/v2/wentasah@gmail.com/events/")
  (if (url-dav-supported-p (org-caldav-events-url)) nil (error "The URL %s does not seem to accept DAV requests" (org-caldav-events-url)))
  org-caldav-sync()
  call-interactively(org-caldav-sync record nil)
  command-execute(org-caldav-sync record)
  execute-extended-command(nil "org-caldav-sync")
  call-interactively(execute-extended-command nil nil)

Any idea why is that? With the old endpoint, everything works.

@dengste
Copy link
Owner

dengste commented Oct 6, 2013

The new endpoint requires OAuth2 authentication. This is not supported in Emacs proper, though there exists a library for it in GNU ELPA.

I guess I could extend org-caldav to use this library, but after looking around for roughly an hour on Google, using the new endpoint with OAuth2 isn't straightforward at all. It seems I have to register org-caldav as an application, which also for some reason requires giving Google my cell phone number, which I won't do. Also, the application is restricted to limits like 5 requests per second, which will lead to errors during the initial sync. Unless I pay for it, of course...

I find it pretty ridiculous that I should have to jump through hoops like this just to sync a calendar, especially since I don't use it. So it seems that when the old endpoint stops working, this is it for Google Calendar sync, unless someone else wants to implement it.

@dengste dengste mentioned this issue Oct 6, 2013
@d12frosted
Copy link

You are not required to create application. It's better to ask users that want to use OAuth2 to create their own applications if they wish to use new endpoint. So 5 requests per second is good enough for almost all users.

As example, there is org-gcal that works with new end point.

@sje30
Copy link

sje30 commented Nov 13, 2016

Is anyone else interested in merging org-gcal functionality into org-caldav?

@dengste
Copy link
Owner

dengste commented May 28, 2017

Since Google does no longer require cell phone numbers for registering a CalDAV application, I've added that functionality. Every user will still need to register its own application with Google, though (see README).

@dengste dengste closed this as completed May 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants