perbrage / sectoralarm

Sector Alarm Node.js Library
MIT License
23 stars 8 forks source link

Api url not working #42

Open sander-visser opened 7 months ago

sander-visser commented 7 months ago

Where to get siteid when linked https://mypagesapi.sectoralarm.net/ is not functioning?

burner- commented 7 months ago

that root wont work and looks that /User/Login is not valid anymore. Service use https://login.sectoralarm.com for login but library wont support it.

perbrage commented 7 months ago

I haven't been super active on this project as I don't use it due to sector alarms failing cloud services. But, I see they have reworked the login which might be more to work on than just changing URL.

Did anyone try to just change URL?

burner- commented 7 months ago

I did not. But I look with browser and it looks that it still use https://mypagesapi.sectoralarm.net/ for commands but https://login.sectoralarm.com/ for login. By my understanding form sends its data to https://login.sectoralarm.com/u/login and it redirects to https://login.sectoralarm.com/authorize/resume and its redirect to country spesific url https://omatsivut.sectoralarm.fi/ each request include "state" property what is some kind session hash or something. from omatsivut it request oauth token from https://login.sectoralarm.com/oauth/token and that it will use https://mypagesapi.sectoralarm.net/

And looks that there is no https://login.sectoralarm.com/User/Login so direct url change wont help.

burner- commented 7 months ago

as additional info. Looks that entrypoint needs to be https://omatsivut.sectoralarm.fi/login and it make some kind token what is needed to go next steps. Not sure is there some way to bypass all that Firebase crap. Most probably that mobile app get auth token from some other place.

sander-visser commented 1 month ago

I got the API working fine from curl/python:

https://github.com/sander-visser/py-playground/blob/main/sector_alarm_status.py