Caldav with Office365

Hello,
I try to use the personal CALDAV binding together with a Office365 account.
Office365 create a link. This link can be used direct to download the ical information without user and password.
I can download with this link thi ical via browser and also with the wget command.

But the CALDAV binding get a 403/forbidden:

[e.http.impl.execchain.MainClientExec] - Executing request PROPFIND /owa/calendar/xxxx/reachcalendar.ics HTTP/1.1

2018-01-24 18:40:31.093 [DEBUG] [e.http.impl.execchain.MainClientExec] - Target auth state: UNCHALLENGED

2018-01-24 18:40:31.095 [DEBUG] [e.http.impl.execchain.MainClientExec] - Proxy auth state: UNCHALLENGED

2018-01-24 18:40:31.098 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> PROPFIND /owa/calendar/xxxxxxx/reachcalendar.ics HTTP/1.1

2018-01-24 18:40:31.101 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> Depth: 1

2018-01-24 18:40:31.103 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> Content-Type: text/xml; charset=utf-8

2018-01-24 18:40:31.106 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> Content-Length: 210

2018-01-24 18:40:31.109 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> Host: outlook.office.de

2018-01-24 18:40:31.112 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> Connection: Keep-Alive

2018-01-24 18:40:31.114 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> User-Agent: Apache-HttpClient/4.3.5 (java 1.5)

2018-01-24 18:40:31.117 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 >> Accept-Encoding: gzip,deflate

2018-01-24 18:40:31.120 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "PROPFIND /owa/calendar/xxxxx/reachcalendar.ics HTTP/1.1[\r][\n]"

2018-01-24 18:40:31.122 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "Depth: 1[\r][\n]"

2018-01-24 18:40:31.125 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"

2018-01-24 18:40:31.128 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "Content-Length: 210[\r][\n]"

2018-01-24 18:40:31.130 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "Host: outlook.office.de[\r][\n]"
2018-01-24 18:40:31.133 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "Connection: Keep-Alive[\r][\n]"
2018-01-24 18:40:31.135 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "User-Agent: Apache-HttpClient/4.3.5 (java 1.5)[\r][\n]"

2018-01-24 18:40:31.138 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "Accept-Encoding: gzip,deflate[\r][\n]"
2018-01-24 18:40:31.141 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "[\r][\n]"
2018-01-24 18:40:31.143 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 >> "<?xml version="1.0" encoding="UTF-8" standalone="yes"?><propfind xmlns="DAV:"><prop><creationdate/><displayname/><getcontentlength/><getcontenttype/><getetag/><getlastmodified/><resourcetype/></prop></propfind>"
2018-01-24 18:40:31.318 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "HTTP/1.1 403 Forbidden[\r][\n]"
2018-01-24 18:40:31.320 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "Server: Microsoft-IIS/10.0[\r][\n]"
2018-01-24 18:40:31.323 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "request-id: 048bb486-a104-4044-aa1e-9a73420929ac[\r][\n]"

2018-01-24 18:40:31.325 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-CalculatedFETarget: LEJPR01CU002.internal.outlook.com[\r][\n]"

2018-01-24 18:40:31.328 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-BackEndHttpStatus: 403[\r][\n]"

2018-01-24 18:40:31.331 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-FEProxyInfo: LEJPR01CA0062.DEUPRD01.PROD.OUTLOOK.DE[\r][\n]"

2018-01-24 18:40:31.334 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-CalculatedBETarget: FRXPR01MB0775.DEUPRD01.PROD.OUTLOOK.DE[\r][\n]"

2018-01-24 18:40:31.336 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-BackEndHttpStatus: 403[\r][\n]"

2018-01-24 18:40:31.339 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-BackEnd-Begin: 2018-01-24T17:40:31.129[\r][\n]"

2018-01-24 18:40:31.341 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-BackEnd-End: 2018-01-24T17:40:31.192[\r][\n]"

2018-01-24 18:40:31.344 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]"

2018-01-24 18:40:31.347 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-FEServer: LEJPR01CA0062[\r][\n]"

2018-01-24 18:40:31.349 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]"

2018-01-24 18:40:31.352 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-Powered-By: ASP.NET[\r][\n]"

2018-01-24 18:40:31.355 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "X-FEServer: LEJPR01CA0030[\r][\n]"

2018-01-24 18:40:31.357 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "Date: Wed, 24 Jan 2018 17:40:30 GMT[\r][\n]"

2018-01-24 18:40:31.360 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "Content-Length: 0[\r][\n]"

2018-01-24 18:40:31.363 [DEBUG] [org.apache.http.wire                ] - http-outgoing-1593 << "[\r][\n]"

2018-01-24 18:40:31.366 [DEBUG] [org.apache.http.headers             ] - http-outgoing-1593 << HTTP/1.1 403 Forbidden

For me it looks like there is an issue with the PROPFIND function to download the ics file.
There are no differences if I use a username and password parameter or leave it empty.

I use the latest OPENHAB 2 version.

Thanks for support

403 Forbidden means either you’re using the wrong URL, or Office365 doesn’t support CalDAV.

Thanks :slight_smile:

I understand that 403 means forbidden.

But why. A username and password is not necessary. I can use wget to download the file direct without any user or password.
Maybe I can use the binding only to analyse the ical file and create a cronjob to download the file.
Would this be possible?
Otherwise I have to parse the ical member by an own script.

Kind regards.

But why.

As previously stated, Office365 does not support CalDAV.

You can use wget to download a .ics file from a lot of servers that don’t support CalDAV. FTP, for example.