dengste / org-caldav

Caldav sync for Emacs orgmode
GNU General Public License v3.0
724 stars 105 forks source link

Can't use authinfo on windows #247

Open proudot opened 2 years ago

proudot commented 2 years ago

Hi and thx a lot for the great mode! I am having trouble with authinfo. Org-caldav keeps asking me for my credential. Here is my config below. I can retrieve it with (auth-source-search ...). Any ideas ?

machine dav.fruux.com:433 port https login USERNAME password PWD

deb75 commented 2 years ago

Same issue here. I tried many things for machine, like same as org-caldav-url or part of it, but none succeeded.

I digged into org-caldav code, but so far, I could not find with which string org-caldav tries to retrieve the auth info.

Perhaps enabling debug, but where ?

deb75 commented 2 years ago

Got it !

I use org-caldav with davmail.

I configured this latest to listen on localhost at port 1080 without ssl.

The org-caldav relevant configuration is :

(setq org-caldav-url "http://localhost:1080/users"
      org-caldav-inbox "/path/to/org/agenda/file/where/org-caldav/write/events/outlook.org"
      org-caldav-calendar-id "myname@mycompany.com/calendar")

Then, in .authinfo.gpg file, add the following :

machine localhost:1080 login mylogin password mypassword

and never again will you be asked your credentials (apart decrypting the authinfo file).

Regards

Thaodan commented 2 years ago

I think the issues is that the username and the user path isn't the same but the package assumes this. The solution would be to resolve the username the path for the username.

Other clients such as Kontact or Sailfish OS do it like this.

E.g. change org-caldav-url to point to the caldav server. Add org-caldav-user property that is then resolved to the path of the user like (setq org-caldav-calendar (org-caldav--resolve-path calendar)).

After this is done configuring calendars should be easier and credentials can be resolved by the real user name and not just by the internal id.