sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.45k stars 283 forks source link

CardDAV with iOS 6.1.3: Account verification failed #74

Closed jbfriedrich closed 11 years ago

jbfriedrich commented 11 years ago

Hi all,

it seems that I have trouble adding the CardDAV server to an iPhone 4 with iOS 6.1.3. When I tried to add it like it is described in the Install.md file, I get "CardDAV account verification failed" and see this in my log files:

xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8008/.well-known/carddav HTTP/1.1" 403 338 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8800/.well-known/carddav HTTP/1.1" 403 338 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8080/.well-known/carddav HTTP/1.1" 403 338 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php/.well-known/carddav HTTP/1.1" 401 304 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php/.well-known/carddav HTTP/1.1" 404 290 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8800/ HTTP/1.1" 403 319 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8008/ HTTP/1.1" 403 319 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8080/ HTTP/1.1" 403 319 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php/ HTTP/1.1" 401 304 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8008/principals/ HTTP/1.1" 403 330 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8080/principals/ HTTP/1.1" 403 330 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php%3A8800/principals/ HTTP/1.1" 403 330 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php/ HTTP/1.1" 207 449 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "OPTIONS /card.php/card.php/principals/test/ HTTP/1.1" 404 142 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "PROPFIND /card.php/principals/ HTTP/1.1" 207 460 "-" "iOS/6.1.3 (10B329) Preferences/1.0" xxx.xxx.xx.xxx - - [02/Apr/2013:17:37:50 +0200] "OPTIONS /card.php/card.php/principals/test/ HTTP/1.1" 404 142 "-" "iOS/6.1.3 (10B329) Preferences/1.0"

On the first look it seems that the port is at the wrong place in the URL. It might have something to do with the Rewrite rules in the Nginx configuration (I am using nginx to host Baikal). Did anyone of you have the same issue? Can someone help out?

Thanks.

jbfriedrich commented 11 years ago

I was able to fix this problem by myself. My first thought was misleading. After reading this page on the SabreDAV Wiki I added the following line to the server block of my nginx configuration:

rewrite ^/.well-known/carddav /card.php redirect;

Now you only have to specify the name of the server, no need to specify the path with "/card.php" anymore. The iPhone uses the redirect and gets pushed to the right address.

wjdp commented 10 years ago

Having same issue (PHP with ngnix), have followed above including adding rewrite rule, logs look like:

82.1.48.185 - - [28/Jun/2014:23:31:54 +0400] "PROPFIND /.well-known/carddav HTTP/1.1" 302 160 "-" "iOS/7.1 (11D169) accountsd/1.0"
82.1.48.185 - - [28/Jun/2014:23:31:55 +0400] "PROPFIND /card.php HTTP/1.1" 401 304 "-" "iOS/7.1 (11D169) accountsd/1.0"
82.1.48.185 - - [28/Jun/2014:23:31:55 +0400] "PROPFIND /card.php HTTP/1.1" 207 449 "-" "iOS/7.1 (11D169) accountsd/1.0"
82.1.48.185 - - [28/Jun/2014:23:31:55 +0400] "OPTIONS /card.php/principals/wjdp/ HTTP/1.1" 405 172 "-" "iOS/7.1 (11D169) accountsd/1.0"
82.1.48.185 - - [28/Jun/2014:23:31:55 +0400] "PROPFIND / HTTP/1.1" 405 172 "-" "iOS/7.1 (11D169) accountsd/1.0"
82.1.48.185 - - [28/Jun/2014:23:31:55 +0400] "PROPFIND /principals/ HTTP/1.1" 405 172 "-" "iOS/7.1 (11D169) accountsd/1.0"

I've got futher with baikal than with sabre-dav and the addressbookserver.php example. I'm guessing there's some flag that iOS is looking for (played around with AirPrint for far too long!).