Synology WebDAV server package: 401 authentication failed



  • The Calendar package is not available for my Synology DS212j, its not supported and it doesnt show up in the package center.

    I had issues with Caldav and Davdroid a log time ago and the problem was solved by the Davdroid team with a new version. Good service 🙂

    It worked for me afterwards. Now I reset my phone to send it in for service, and reinstalled davdroid. I cannot get it working again.
    The Sogo-Connector and Thunderbird calender still have access to the synology, and I can sync adresses and calender items.

    But when I enter the exact path I entered in Thunderbird and use the same credentials, Davdroid cannot find Caldav entries.

    The log shows Authentification problems, 401. But I am shure the credentials are correct, as they work for thunderbird. I entered them multiple times.

    Would love to use the new calendar app, but buying a new synology just for this feature isn`t worth it, my nas still works jut fine.

    Is there a tutorial for the old way, using the wedav server? I can`t remember how I got it working a few years ago.

    Thanks
    Christoph


  • developer

    @christoph1212 said in Synology Calendar CalDAV Error:

    The log shows Authentification problems, 401. But I am shure the credentials are correct, as they work for thunderbird. I entered them multiple times.

    Are there any special characters in the password?


  • developer

    @rfc2822 I have added instructions for the old WebDAV package again: https://www.davdroid.com/tested-with/synology/#c158

    Does it work for you?



  • @rfc2822
    Thank you for the reply.
    There are no special characters either in username or password.

    The path contained an underscore _ . I replaced it and made the path really simple. After I created a new calendar in thunderbird with the new path, all calendar items where synced from the nas. The new credentials and path worked right away in thunderbird. But Davdroid still fails with error 401,
    This server could not verify that are authorized to access the document requested. Either you supplied the wrong credentials or your browser doesn`t understand how to supply the credentials required.

    As the credentials are the same as in thunderbird, it looks like Davdroid doesn`t supply the credentials in the expected manner?

    Is it possible that Davdroid was altered to support the new Syno-calendar which hamperes the old sync via webdav?

    Regards
    Christoph


  • admin

    DAVdroid does not have any workarounds or special settings for servers or services (=no pre-configured paths or so). So the behaviour did not change in the last time. Did you try to access the URL you enter in DAVdroid on your Android browser? Did you try to use only http instead of https to test if it is a SSL/TLS issue?


  • developer

    Are there any redirects? DAVdroid might provide the credentials only to the initial domain or something. Please provide the full logs.



  • @devvv4ever said in Synology WebDAV server package: 401 authentication failed:

    Did you try to access the URL you enter in DAVdroid on your Android browser? Did you try to use only http instead of https to test if it is a SSL/TLS issue?

    I did try to open the adress in chrome. Same result, 401 Message. And wants me to enter the credentials again. Very strange.
    And I tried htttp://...:5005 . Same problem.

    I checked the path several times, it`s identical to the one in thunderbird. I checked if the user has the appropriate rights, and they seem ok.
    Webdav is allowed, and user has read/write permission on all relevant folders.

    But the user must definitly have all required rights as thunderbird and sogo work right away when I enter the same credentials and URL. No problem at all. I don`t get it. It looks like Synology requires a non-standard approach to acces the data, and Sogo/ thunderbird implemented something to work around that.

    I even changed the password to test and tried again, same result.

    @rfc2822 said in Synology WebDAV server package: 401 authentication failed:

    Are there any redirects?

    I don`t think so. I use the ip adress to access the server.

    @rfc2822 said in Synology WebDAV server package: 401 authentication failed:

    Please provide the full logs.

    Will try to send them by pm.
    Thanks for the help.



  • I have sent the full log to play@bitfire.at

    I couldn`t access the url with firefox on my pc either.
    But I made another test: I installed netdrive and added url and credentials there.
    It worked flawlessly, even without the path given. I could open all folders the user had access to, including the calender folder and its items.

    I also found a discussion on another board, where a user stated that WebDav on synology does not support web browser access.

    I wonder why it worked a few years ago. I have to admit that I didn' t use it for at least a year or so, as i couldn't find a way to sync my calendar items to outlook at work, which was more important for me. I used Sony's PC Explorer to sync my contacts and calendar, and the explorer couldn' t find the Davdroid account, just the local android account. So I switched to managing my appointments with outlook at work only.

    PC Explorer is discontinued though, and that's why i want to switch back to thunderbird and davdroid and manage it at home. Sony's new windows tool doesn't include outlook sync anymore.

    So it's entirely possible that a synology update killed the compatibility with Davdroid caldav since then and I didn't notice.


  • developer

    @christoph1212 said in Synology WebDAV server package: 401 authentication failed:

    I couldn`t access the url with firefox on my pc either.

    Which error do you get when you access the URL with Firefox? If you get a 401, too, it's probably some server problem.



  • @rfc2822 said in Synology WebDAV server package: 401 authentication failed:

    Which error do you get when you access the URL with Firefox? If you get a 401, too, it's probably some server problem.
    The same as in the logs. Same test, as Synology webdav does not support browser access with http. It works with netdrive, as suggested by synology.

    I think Davdroid does a http-login approach and Synology WebDav wants something else, something thunderbird does. The Synology calendar plugin is different. I configured my sisters newer synology and installed calendar, and Davdroid worked flawlessly.

    But we can close this issue. I installed the calendar sync trial and it worked right away with the same config. Looks like it accesses caldav just as thunderbird and Sogo does and not like a browser. I can configure it to sync with the standard calendar, which i like too. I used a separate app to sync the davdroid calendar with the local android calendar so the items where syncable using usb and sony's PC explorer and outlook at work. So I can skip this sync app too.

    My problem is solved and i totally understand that you wouldn`t invest time to change davdroid to support the old webdav server on old synologys. It's not worth it. Probably just state that it doesn't work with synology WebDav, just with Synology calendar though (which is sufficient).

    Thanks
    Christoph



  • I have to apologize. This is embarassing. I wasn't at home when I tried the other sync tool. I was logged in via Fritz!Box VPN. All my previous attempts where made connected by local Wifi, same subnet. When I tried Calendar Sync trial at home using Wifi, it failed too. Then I tried Davdroid over VPN, and it worked.

    After digging around I found the problem. I activated a safety mechanism in synology DSM long time ago when I routed Synology ports to the public internet adress. If one IP enters wrong credentials more than 3 times, it is added to a blacklist. I must have entered wrong credentials more than three times when I configured DavDroid and my mobile's DHCP adress got blocked. As VPN users get a different, unblocked IP, it worked.

    So embarassing 😞 Sorry to wast your time and of course davdroid works just fine with Synology's WebDav-Server.

    Have a nice evening.