openhab-addons icon indicating copy to clipboard operation
openhab-addons copied to clipboard

[somfytahoma] Too many attempts with an invalid token, temporarily banned.

Open BasvanH opened this issue 1 year ago • 30 comments

Expected Behavior

Stable binding.

Current Behavior

Binding looses connection after a few days. The bridge goes offline with a Bad credentials error. The username and password are just fine. At the same time I login to tahomalink website I also get an error message, F12 in the browser and i see a Too many attempts with an invalid token, temporarily banned. in the login response.

So the binding somehow triggers this ban.

Possible Solution

The binding seems to authenticate with username and password to www.tahomalink.com and retrieves a JWT token which it uses to authenticate all the upcoming requests. Looking at the tahomalink webpage they seem to authenticate to https://accounts.somfy.com/oauth/oauth/v2/token and using OATH2 with a refresh_token. This authentication endpoind seems more solid than tahomalink JWT as it also returns a message when there are issues with authentication.

I'm already busy recoding the binding but I would like to discuss if this is the parmant way to go and agreed by all involved.

I would suggest to recode the binding to authenticate to ```https://accounts.somfy.com/oauth/oauth/v2/token`` with OATH2 as this would probably solve the ban issue.

Steps to Reproduce (for Bugs)

Run binding for a few days. Refresh: 180 Timeout:300 Retries: 1 Retry delay: 120000 Developer mode: ON or OFF (ON takes a few days longer when it gets banned)

BasvanH avatar Apr 08 '23 12:04 BasvanH