-
Notifications
You must be signed in to change notification settings - Fork 21
Manage Fritzbox session expiry #176
Comments
Hi @zakx, thx for bringing this up.
That is correct. Sessions can expire after some time of inactivity. According to the docs it remains valid for 60 minutes after its last use. I have seen boxes behave differently in practice though.
That sounds like reasonable proposal. The main problem here is that currently there is no bullet-proof way to tell if a session is expired (from a client's perspective). Neither the API by AVM tells when a session loses validity nor do most FBoxes return an interpretable status code (like 401) when trying to use an invalid session.
I agree that it could be fixed here, provided one can come up with a reliable solution to detect session expiry. As a side note, it is not uncommon for users of the api to work around this problem, see e.g. jayme-github/fritzbox_smarthome_exporter. Anyway, I will give this some more thought. Greets |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I've been trying to use a project built on your library that exposes Fritz!DECT smart home devices via HomeKit. In order for that to work, their application needs to run continuously, so it can answer to HomeKit API requests. They will do the Fritzbox login on application start, and everything works well then. After a few minutes (I didn't measure it, I guess about 30 minutes) On/Off requests via HomeKit will stop working. When I call
Login()
beforeOn()
, it will work indefinitely. Therefore I assume that the Fritzbox I am using has some kind of session expiry and I would love if your library would just transparently handle this, for example by checking if the current session would be expired and then logging in again before handling the original API request.I assume it makes way more sense to fix this here than in the homekit-fritz project. I don't think I can contribute any code though, as I've never done any Go and my frist tries probably shouldn't end up in a decent library. I would appreciate it very much if somebody would consider implementing this. Thanks!
The text was updated successfully, but these errors were encountered: