Closed jlaur closed 1 year ago
Reported in the forum: https://community.openhab.org/t/sure-petcare-binding-login-failure-due-to-rejected-http-user-agent/146992
Works - HTTP code 200:
curl -v -X POST -H 'Content-Type: application/json' -d '{"email_address":"<USERNAME>","password":"<PASSWORD>","device_id":"<ANYRANDOMSTRING>"}' -A 'Mozilla/5.0 (Linux; Android 7.0; SM-G930F Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/64.0.3282.137 Mobile Safari/537.37' https://app.api.surehub.io/api/auth/login
Fails - HTTP code 403:
curl -v -X POST -H 'Content-Type: application/json' -d '{"email_address":"<USERNAME>","password":"<PASSWORD>","device_id":"<ANYRANDOMSTRING>"}' -A 'Mozilla/5.0 (Linux; Android 7.0; SM-G930F Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/64.0.3282.137 Mobile Safari/537.36' https://app.api.surehub.io/api/auth/login
Binding should be able to login and communicate with the service.
Service returns HTTP code 403.
Change user agent here: https://github.com/openhab/openhab-addons/blob/43d35538d5395dbe20929bd26145216d25593171/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareAPIHelper.java#L66
openHAB 3.4
This issue has been mentioned on openHAB Community. There might be relevant details there:
https://community.openhab.org/t/sure-petcare-binding-login-failure-due-to-rejected-http-user-agent/146992/4
Reported in the forum: https://community.openhab.org/t/sure-petcare-binding-login-failure-due-to-rejected-http-user-agent/146992
Works - HTTP code 200:
Fails - HTTP code 403:
Expected Behavior
Binding should be able to login and communicate with the service.
Current Behavior
Service returns HTTP code 403.
Possible Solution
Change user agent here: https://github.com/openhab/openhab-addons/blob/43d35538d5395dbe20929bd26145216d25593171/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareAPIHelper.java#L66
Your Environment
openHAB 3.4