franc6 / ics_calendar

Provides an ICS (icalendar) platform for the Home Assistant calendar
Apache License 2.0
146 stars 22 forks source link

Digest Auth failed #140

Closed member1980 closed 2 weeks ago

member1980 commented 3 months ago

Hi,

is there a bug using the digest auth? my cloud space provider may hav updated his server. Now the log shows

Failed to open url(https://webdav.server..com/calendar.ics): digest auth failed

Is there a fix available?

franc6 commented 3 months ago

There hasn't been an update released for this component since early this year. If this is a recent problem, it's more likely that your provider no longerSupports digest auth. Support for other authentication methods is on my list for a future release, but given my current schedule, it will likely be a long while. :(

Please try to contact your provider to determine if this is the problem. Another possibility is that your username/password have changed.

member1980 commented 3 months ago

Thanks for you superfast response. :) here is an additional info:

Traceback (most recent call last):
  File "/config/custom_components/ics_calendar/calendardata.py", line 197, in _download_data
    with urlopen(
         ^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 521, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 630, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 553, in error
    result = self._call_chain(*args)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 492, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 1234, in http_error_401
    retry = self.http_error_auth_reqed('www-authenticate',
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/urllib/request.py", line 1116, in http_error_auth_reqed
    raise ValueError("AbstractDigestAuthHandler does not support"
ValueError: AbstractDigestAuthHandler does not support the following scheme: 'NTLM'

i guess IONOS changed the authentication method. :( NTLM support would help.

ftp or smb support would be nice, too. thanks anyway! :)

franc6 commented 3 months ago

NTLM is just a bad idea. :( If you have access via SMB, you could mount the filesystem via HA, and use a local URL to access it. Either file:///… or http:///. It depends on where you mount it. I’ll try to give a more complete example in a few days when I’ve had a chance to look them up again.

member1980 commented 3 months ago

local URL is valid, too? That's great!! Maybe this could be helpful in the documentation. :) Now i need to find out how to mount and where to point the file:// URL exactly 🤭

franc6 commented 2 weeks ago

Updated documentation for the 5.0.0 release.