Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User auto-creation fails with 3 different clients on new/fresh davis server from v4.4.4 #170

Open
n-connect opened this issue Oct 13, 2024 · 1 comment
Assignees

Comments

@n-connect
Copy link

Hello @tchapi,

Started as simple query in #56 , then extensive tests, debugging and code fixing, aaand here's a new issue. The last comment saved here finally:

Okay, multiple issues :) :

  • since the bcrypt modification in PHP this spring, an error raised with app.ERROR: [500]: ValueError - Bcrypt password must not contain null character in Utils.php
  • I've manually modified the connected line, using bin2hex(), however still not creating the user and bumping into another error [2024-10-13T14:16:59.998558+00:00] app.ERROR: [412]: Sabre\DAV\Exception\PreconditionFailed - An If-Match header was specified and the resource did not exist [{"file":"/usr/local/www/davis/vendor/sabre/dav/lib/DAV/Server.php","line":466,"function":"checkPreconditions","class":"Sabre\\DAV\\Server","type":"->","args":[{"Sabre\\HTTP\\Request":"PUT /dav/principals/[email protected]
  • Also I'm glad I do not spent time raising a former PR for the bcrypt fix, as I've bumped into your own work in Aug 30, 2024 Fix random bytes having null terminators
  • however the last release is from Aug 3, v4.4.4 -> this is what I've got almost a week ago, lucky me :)

So:

  • 2 of the 3 caldav clients (macOS & IOS Calendar app) are not even get to phase in the code to auto-create a randompw'd user -> no idea why, I guess its about client side vs CalDAV RFC compatibility
  • 3rd one, Thunberbird creates the account without server-side auto-creating a user but revealed both the bcrypt and the Precondition error in dev.log (Created account need to be enabled, which fails).
  • fixing the v4.4.4 code manually won't make it work (even using exactly your line as below),
  • checked the commits since Aug 3/v.4.4.4 to make sure I'm not missing anything connected to user auto-creation or se dependency, but no

Well, I give up. This issue is about to show that something, - blocking change(?) - has come to live since the original working user auto-creation code in 2022, which rendered it not working. Unfortunately I have no other caldav clients to test with.

Thank you for your nice work!

@tchapi
Copy link
Owner

tchapi commented Oct 15, 2024

Thanks for the issue

As you have noticed, the auto creation code has not changed a bit since 3 years. For the auto creation code to be called, the first thing is that the imap login must succeed (and this happens in sabre/dav code, not in Davis), see this piece of code. I understand that you say that this code is not called, so are your credentials correct for the IMAP login to be successful? If you add logs in there, what does $success says? If you don't even get into the imapOpen function, then you might not even use the IMAP backend - what is your configuration like?

@tchapi tchapi self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants