6.0.0-git
2019-03-20

[#13319] access to external google-calendar not working anymore
Summary access to external google-calendar not working anymore
Queue Kronolith
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester piper (at) hrz (dot) uni-marburg (dot) de
Created 2014-07-04 (1720 days ago)
Due 07/07/2014 (1717 days ago)
Updated 2014-11-21 (1580 days ago)
Assigned 2014-07-04 (1720 days ago)
Resolved 2014-11-21 (1580 days ago)
Milestone
Patch No

History
2014-11-21 17:48:54 Jan Schneider Assigned to Jan Schneider
State ⇒ Resolved
Version ⇒ Git master
 
2014-11-21 17:48:43 Git Commit Comment #8 Reply to this comment
Changes have been made in Git (master):

commit d4d1334f55c3c704e70eaabbc4669109649c7958
Author: Jan Schneider <jan@horde.org>
Date:   Fri Nov 21 18:48:57 2014 +0100

     [jan] Fix DAV client always using Digest authentication (Bug #13319).

  framework/Dav/lib/Horde/Dav/Client.php |   11 ++++++++---
  framework/Dav/package.xml              |    2 ++
  2 files changed, 10 insertions(+), 3 deletions(-)

http://github.com/horde/horde/commit/d4d1334f55c3c704e70eaabbc4669109649c7958
2014-09-28 08:46:23 forum (at) cybert (dot) de Comment #7 Reply to this comment
Confirm this problem after upgrade to kronolith-4.2.2 / Horde_Dav-1.0.7.

External SabreDav (Basic Auth) calenders are not more accessible. Error logs:
Sep 28 08:12:05 X HORDE: [kronolith] Not authenticated [pid 7969 on 
line 124 of "/usr/share/php/Horde/Dav/Client.php"]
Sep 28 08:12:05 X HORDE: [kronolith] Failed to retrieve remote 
calendar: url = "https://..."", status = 401 [pid 7969 on line 593 of 
"/var/www/ebert.pw.443/horde/kronolith/lib/Driver/Ical.php"]

2014-07-31 10:51:42 Jasper (dot) Olbrich (at) students (dot) uni-marburg (dot) de New Attachment: fix_external_calendars.patch Download
 
2014-07-31 09:40:42 Jasper (dot) Olbrich (at) students (dot) uni-marburg (dot) de Comment #6 Reply to this comment
Hello,

I think I've implemented a fix for http://bugs.horde.org/ticket/13319.
The main problem is that external calendars are no longer working if 
they expect HTTP Basic Auth.

The problem is that in kronolith/lib/Driver/Ical.php the variable 
$sabreOptions['userName'] is set, but this breaks the request method in
pear/php/Horde/Dav/Client.php because the authType of the SabreDAV 
client is AUTH_BASIC | AUTH_DIGEST. That leads to the DIGEST method 
being used in the Horde_Dav_Client class.

My idea is to use the HTTP 401 response from the external calendar 
provider when the user is adding the external calendar, because that's 
the place where the provider tells us which authentication mode is 
required.

In my (AFAI can tell, working) solution, this information is collected 
in Horde/Dav/Client.php and passed along using the Horde_Dav_Exception 
and the following Kronolith_Exception back to the Browser.

Then the user enters his credentials and the desired authentication 
mode is sent back to the horde server as well. There it is used to 
access the calendar provider and finally stored in the database.

I don't know why the user name is set in the sabreOptions in the first 
place (the change was introduced here 
https://github.com/horde/horde/commit/477f2c46041bde1b3bfa572d7fbac535046c3be6#diff-2a209d195528a6339e273da67af8fd86), but now something has to be done to fix this. If my approach is not completely wrong, I could provide a patch. Should I attach it to the bug tracker 
ticket?

Or are there other, better ways to get the external calendars working again?
2014-07-07 14:03:03 Jasper (dot) Olbrich (at) students (dot) uni-marburg (dot) de Comment #5 Reply to this comment
I assume this has to do with the class Horde_Dav_Client. In Horde 
5.1.6, the $settings in the constructor do not contain the user name, 
but in H5.2, they do. This finally leads to this line

$this->_http->{'request.authenticationScheme'} = Horde_Http::AUTH_DIGEST;

in the request() function to be executed. The correct setting would be 
AUTH_BASIC (or not changing it from the default, probably 
corresponding to CURLAUTH_ANY; this happens in H5.1.6, because 
$this-userName is null).

I hope this helps to track down the real cause for this error.
2014-07-07 11:01:43 piper (at) hrz (dot) uni-marburg (dot) de Comment #4 Reply to this comment
I just realised that the problem is not connected to the 
google-account. It also occurs with a horde-caldav-URL of another 
external Horde-installation. There seems to be a problem in handling 
the user credentials  (username/password) when adding an external 
calendar.

Andreas
2014-07-07 06:14:59 piper (at) hrz (dot) uni-marburg (dot) de Comment #3 Reply to this comment
Are you sure this worked with Kronolith 4.1? Google now requires 
OAuth2 authentication which we never supported in Kronolith.
Yes, it worked, and it is still working on my production system with 
Kronolith 4.1.5 (Horde 5.1.6)

Andreas
2014-07-04 12:47:07 Jan Schneider Comment #2
State ⇒ Feedback
Priority ⇒ 1. Low
Reply to this comment
Are you sure this worked with Kronolith 4.1? Google now requires 
OAuth2 authentication which we never supported in Kronolith.
2014-07-04 11:10:26 piper (at) hrz (dot) uni-marburg (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 3. High
Summary ⇒ access to external google-calendar not working anymore
Due ⇒ 2014-07-07
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
Reply to this comment
Hello,

with upgrading Horde from 5.1.6 to 5.2RC2 and Kronolith from 4.1.5 to 
4.2.0RC2 access to external google-calendars ceased to work.
As URL for the external calendar I use:
  https://www.google.com/calendar/dav/username@googlemail.com/events
Username-entry is respectively:
username@googlemail.com
The corresponding password is given.
All these entries work fine with Horde-5.1.6/Kronolith-4.1.5, but with 
Horde5.2RC2/Kronolith-4.2.0RC2 I only get the message "The 
authentication information you specified wasn't accepted."

Thanks for any hints,
Andreas

Saved Queries