1. werkregen's Avatar
    Has anyone managed to natively sync PRIV with owncloud carddav? Syncing works on my Classic, but the same settings don't work on the Priv. I managed to sync them with davdroid but I'd rather use a native solution.
    04-27-16 05:49 AM
  2. MiSsY_'s Avatar
    What server address are you using?
    04-27-16 06:05 AM
  3. werkregen's Avatar
    My own on a https address (port 443) with a let's encrypt certificate ... I've tried using the server address such as "https://werkregen.server.com" and the full address "https://werkregen.server.com/link/from/owncloud". I've also set the security type to SSL/TLS (Accept all certificates).

    Edit: Some extra details:
    • owncloud server version 9.0.1
    • the previous method on the blackberry didn't work right, because using the default link provided from the owncloud app produced duplicate contacts.
    • The default link was "https://xxx.xxx/remote.php/dav/addressbooks/users/[username]/[long random character string]/"
    • the new link, found on the blackberry support forums, which currently seems to be working is "https://xxx.xxx/remote.php/carddav/principals/[username]/"
    • this link looks very similar to the carddav server config for iOS which is "example.com/remote.php/dav/principals/users/USERNAME/"


    None of the combinations I've found on the internet worked
    Last edited by werkregen; 04-27-16 at 07:41 AM.
    04-27-16 06:31 AM
  4. Strato's Avatar
    Hi,

    I've had the same issue when I switched to PRIV, I was unable to configure my owncloud server, like you.

    I've solved the issue and I think there is a bug in the BlackBerry contact app.

    I had two issues, the first one was fixed with editing the .htaccess file on my owncloud server:

    I missed the "well-known" rewrite rule, so, the correct one that works (for me) is:

    RewriteRule ^.well-known/carddav /remote.php/carddav/ [R=301,L]
    RewriteRule ^.well-known/caldav /remote.php/caldav/ [R=301,L]

    (on my setup of owncloud 5.0, those lines where configured with [R] only. I didn't tested without rule L as it's working now).

    ** Doing this only let me able to pass the server configuration steps, as my owncloud setup totaly missed those lines **


    Then, when configuring the DAV account, the app now accept my settings but when the app tries to
    sync my contacts, I observed on the Apache logs that the app did not send the correct username, getting
    back "http fobidden" responses from server !


    This is the bug: when you configure an account, you input an email address, a username and a password.
    When the app tries to validate server setup, it uses the username to authenticate to the server, which is fine.
    But once this is done, the app clear the username you previously inputted and use the email address instead, causing the server to reject authentication !

    for my setup, the fix has been pretty easy to determine: I choosed to patch owncloud code to strip the @domain part
    to make the authentification to succeed, but this trick will not work if in your setup, the "user" part of the email
    address does not corresponds to the username needed to authenticate to your server.

    I totally ignore if the different versions of owncloud have the same code at the same place where to apply the patch,
    so I can explain two ways to apply the patch:

    1) once you are on the root folder of your owncloud installation, do this:

    - vi lib/base.php
    - search for a line like "$_SERVER['PHP_AUTH_USER'] = $name;" (for me, it was line 448)
    - just before, add this line: $name = str_replace("@domain", "", strip_tags($name)); // replace @domain by your. eg: @gmail.com

    2) I've found where to place that patch doing a grep -lr XAUTHORIZATION in the root owncloud folder.

    I think applying a patch where $name is set in the first time may be a better solution but I've not searched for it.

    I also think that I currently have to apply that patch in other parts also, but I diden't observed issues with carddav.

    NOTE: this has fixed carddav sync issue, but caldav still does not work (there is no authentication issue in the logs so
    I will have to try more patching about auth username and/or analyse traffic between client and server to see if
    there is something related to my probably incomplete patch or something else.

    About the way to configure the server settings on the contact app, there is no need to put "https://" or the long URI.
    You just have to put the server's DNS name. The app will query the well-known URL to determine correct path to use

    Best regards,
    Strato
    09-26-16 08:09 AM
  5. werkregen's Avatar
    Hey man. First of all, thanks for writing such a detailed solution!

    Since then, I gave up and moved to a hosted Exchange account cause I needed a simple note taking app and I wasn't satisfied with those available in owncloud.

    I can't test your findings, but I remember this:

    • I updated to owncloud 9.1 and it allowed logging in with full e-mail address, not just username. I think that should have solved this part:


    for my setup, the fix has been pretty easy to determine: I choosed to patch owncloud code to strip the @domain part
    • I tried this rewrite rule to no avail:


    RewriteRule ^.well-known/carddav /remote.php/carddav/ [R=301,L]
    RewriteRule ^.well-known/caldav /remote.php/caldav/ [R=301,L]
    In the end, it's just a BlackBerry problem. Their android apps for notes, tasks, calendar, contacts are not finished. If you want a hassle free solution, try DAVdroid. It worked perfectly fine for caldav and carddav.
    09-30-16 06:17 AM
  6. Strato's Avatar
    Hey !

    Thank you, glad to help

    the RewriteRules only makes the app discover the specific path where to find data, it's not related to auth issue. It is just odd that the rules from owncloud 5 used default R=302, which looked to not being correctly understanded by the blackberry andoid apps.

    yeah, I know my owncloud is really old but too much work for now to upgrade everything needed and too much work testing to avoid regression

    I agree, the blackberry android apps miss of polish, as always (ahh, I remember I already had to patch and workaround with my Z10 lol)

    really strange that the calendar app does not sync anything with my OC, as the apache server's log now show that everything looks to works well... hope someone will work around this one day....

    Ah DAVdroid.... yeah I would have tried it, unfortunately it's not free

    Best regards,
    Strato.
    09-30-16 06:37 AM
  7. Jerry A's Avatar
    Hey !

    Thank you, glad to help

    the RewriteRules only makes the app discover the specific path where to find data, it's not related to auth issue. It is just odd that the rules from owncloud 5 used default R=302, which looked to not being correctly understanded by the blackberry andoid apps.

    yeah, I know my owncloud is really old but too much work for now to upgrade everything needed and too much work testing to avoid regression

    I agree, the blackberry android apps miss of polish, as always (ahh, I remember I already had to patch and workaround with my Z10 lol)

    really strange that the calendar app does not sync anything with my OC, as the apache server's log now show that everything looks to works well... hope someone will work around this one day....

    Ah DAVdroid.... yeah I would have tried it, unfortunately it's not free

    Best regards,
    Strato.
    I've been having similar issues with Fastmail. Hopefully, Cody is reading this and can use it as another data point for fixing CalDAV.

    DAVDroid does have a free option. Install it from F-Droid. There it only asks for a donation instead of an up-front purchase. (If you're not buying from the Play Store, consider donating since this is an open source project).
    09-30-16 07:08 AM
  8. c_bryant34's Avatar
    Team is going over a lot of our DAV code at the moment and looking at fixes.
    FF22, tickerguy and Jerry A like this.
    09-30-16 10:30 AM
  9. Strato's Avatar
    Hi,

    Thanks for F-Droid and DAVdroid !!! I love F-Droid

    Best regards,
    Strato
    10-01-16 01:15 PM

Similar Threads

  1. Replies: 7
    Last Post: 05-12-16, 04:17 PM
  2. unlocked BlackBerry priv $399
    By BBFanIndia in forum BlackBerry Priv
    Replies: 27
    Last Post: 05-02-16, 01:40 PM
  3. Why is my BlackBerry Z10 security wipe taking days to complete?
    By CrackBerry Question in forum BlackBerry Z10
    Replies: 12
    Last Post: 04-29-16, 03:36 AM
  4. Looking for a place with BlackBerry symbols
    By lilevo93 in forum General BlackBerry News, Discussion & Rumors
    Replies: 3
    Last Post: 04-27-16, 01:12 PM
  5. How do I tether my Android Internet connection through Bluetooth to BlackBerry Q10?
    By Dhrayco in forum General BlackBerry News, Discussion & Rumors
    Replies: 1
    Last Post: 04-27-16, 02:09 AM
LINK TO POST COPIED TO CLIPBOARD