Caldav and google calendar stop working few days ago

Hi all, i’m using caldav bindings on OH2 hosted by openhabian 2.0 with success for quite long time.
Just few days ago it started to have a problem connecting to the calendar (401 - invalid credential found in the log).

I’ve cheked the access link using Advanced Rest Client and I’ve found that the problem is real:

If I try to connect using chrome I can login using the user/psw and see and manage the calendar.
The flag “accept less secure application” is on.

It seems that the problem is related to the security check on “device” but i don’t know how to fix it.
Thanks for any suggestion.
f

Again using ARC I’ve found that the response headers from the GET are:

Accept-Ranges: none
Alt-Svc: quic=":443"; ma=2592000; v="39,38,37,35"
Cache-Control: private, max-age=0
Content-Type: text/html; charset=UTF-8
Date: Tue, 22 Aug 2017 15:25:16 GMT
Expires: Tue, 22 Aug 2017 15:25:16 GMT
Server: GSE
Transfer-Encoding: chunked
Vary: X-Origin; Origin,Accept-Encoding
Www-Authenticate: basic realm="Google APIs"
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Web-Login-Required: https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbuUy36WkpFBUnvkFgPKykNQPMIzvbjXNNQ8sYNx8LVI8b5mftSjuc3t2akwViY8-CO14IGic7V8JnaHzhNHYPrHj4iv33sCe1RYYgmyenxapl0oxHB7xXNlVT9PJvuAyld-EDozU4vmT6G3BdBpNtRAxwfrlpbtyWBc323w5jl-BCqPM5TJKTIqBsVgOMycKJKFkSVlByUc8rbRCpLwMNnhbup6wkST0hy05QZjVUX2ZBpljpE
X-Xss-Protection: 1; mode=block

and following the X-Web-Login-Required link you get the confirmation form:

It seems that I’ve found a workaround (or a new mandatory path I don’t know).

Step to resolve

  1. login using a browser
  2. activate the “2-step verification”
  3. go to the app password page https://security.google.com/settings/security/apppasswords
  4. create a app password for openhab (you can use custom name)
  5. use the 16 digit app password as password in caldavio.cfg

Now the test using ARC is ok.