hi, I also had the HTTP 401 error trying to read my google calendar using the caldav binding.
In my case I had the URL wrong. The correct URL format for me was: https://www.google.com/calendar/dav/@import.calendar.google.com/events
you can get the calendar id value from the settings of your google calendar, in my case google was showing something like : abcdef1245@import.calendar.google.com
take the value left from the @ and this should be your calendar-id
good luck !
Hello there, my solution was to set disableCertificateVerification=true. Although the most tutourials say “false”. And in my tests a value for reloadInterval < 5 doesn’t work. Thank yu for your help.
Thanks for the feedback. It make sense, maybe that https certificate verification rely on some system configuration (eg. it has to know the root ca certificate in order to trust the source of the certificate that is checking) so disabling the check remove a potential point of failure. The side effect is that security is lower because without check you can’t really trust the identity of the server you are talking to and you are prone to server impersonation attack. I think that you can bear it
@querdenker2k:
I’m trying to switch from OH1 to OH2 but I do not get Google OAuthv2 connection up and running.
Do you remember?
We were in contact regarding the same issue in OH1. I got it running using one of your snapshot versions of the addon (1.9.0). Obviously OH 2.2.0 does not support the new URL https://apidata.googleusercontent.com/caldav/v2/<calid>/events out of the box?
@sihui - I preferred to file issue #668
Got the binding running in my OH2 instance.
The major issue here is that I had to allow “insecure apps” to authenticate and that now username / password is stored in a plain text configuration file.
2018-06-10 21:10:52.854 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (401 - Unauthorized)
com.github.sardine.impl.SardineException: Unexpected response
at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) [234:org.openhab.io.caldav:1.12.0]
at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40) [234:org.openhab.io.caldav:1.12.0]
at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35) [234:org.openhab.io.caldav:1.12.0]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218) [234:org.openhab.io.caldav:1.12.0]
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160) [234:org.openhab.io.caldav:1.12.0]
at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962) [234:org.openhab.io.caldav:1.12.0]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417) [234:org.openhab.io.caldav:1.12.0]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409) [234:org.openhab.io.caldav:1.12.0]
at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386) [234:org.openhab.io.caldav:1.12.0]
at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) [234:org.openhab.io.caldav:1.12.0]
at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [234:org.openhab.io.caldav:1.12.0]
at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh230]
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh230]
I also get the same 401 unauthorized error with using the v2 API and OAuth. I am using the latest openHAB 2.3 snapshot. Is there a current workable solution using the Google v2 API are we stuck with v1 and insecure apps for the time being?
Sorry, i am not using the Google calendar. I Just tested it maybe 2 years ago.
The warn Message appears every Minute because of the failure.
Your configuration Looks good. Isn’t Somebody Here who is using caldav with Google?
I configured the binding with Google a year ago and it worked with some restriction.
Allow insecure apps in Google configuration.
The configuration is shwon below:
i use this ol topic because I have an issue with the caldav binding.
I configured it and it worked for two days. Now I get an 401 error. But not with the calender I want to use.
I had serveral configurations and I deleted all exept one. This is working. But the errors are from an old configuration that I dont use.
I cleaned the cache with no result.and a restart didnt solve the problem as well.
I had the same problem. Tried to fix it by the hints in the forum. It was not a OH / CALDAV configuration problem but a Google security issue.
I had to allow less secure Apps in my google accout https://myaccount.google.com/lesssecureapps