Skip to content

CalDAV Digest Authentication Support Missing #1837

@DmitriSchrama

Description

@DmitriSchrama

Description:
Easy!Appointments CalDAV sync fails with 401 Unauthorized when connecting to CalDAV servers that require Digest authentication (e.g., SabreDAV-based servers like zxcs.nl).

Steps to Reproduce:

  1. Set up a CalDAV server with Digest authentication (SabreDAV default)
  2. Configure Easy!Appointments CalDAV sync with server credentials
  3. Attempt to connect or sync
  4. Observe 401 Unauthorized error with message: "No 'Authorization: Digest' header found"

Expected Behavior:
CalDAV sync should work with both Basic and Digest authentication methods.

Actual Behavior:
Only Basic authentication is supported, causing connection failures with Digest-only servers.

Root Cause:
In application/libraries/Caldav_sync.php, the get_http_client() method uses Basic authentication only:

'auth' => [$caldav_username, $caldav_password],

Proposed Solution:
Add Digest authentication support:

// Option 1: Always use Digest (may break Basic-only servers)
'auth' => [$caldav_username, $caldav_password, 'digest'],

// Option 2: Configurable authentication type
$authType = $provider['settings']['caldav_auth_type'] ?? 'basic';
'auth' => [$caldav_username, $caldav_password, $authType],

// Option 3: Auto-detect based on server response

Affected Version:
Easy!Appointments v1.5.0+

Workaround:
Manually edit Caldav_sync.php to add 'digest' as the third parameter in the auth array.

Additional Context:

  • Tested with zxcs.nl CalDAV server (SabreDAV 4.4.0)
  • Error: Sabre\DAV\Exception\NotAuthenticated: No 'Authorization: Digest' header found
  • Fix verified working with Digest authentication

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions