securitas-direct-new-api
securitas-direct-new-api copied to clipboard
Two Step authentication and authorized devices
Portugal just enabled two factor authentication by SMS and authorized devices. I get Unauthorized error message when trying to login through the API
+1. Same in France, the integration don’t setup because it takes more than 60s
The home assistant integration identify as a web app and not as a mobile app. I do have the second factor of authentication on my phone but not on the HA. What happen during the login process?
I will check the error log message and post it here
@guerrerotook @manuelbarbosa Same issue, 2FA is enabled both on web and mobile (France).
This is the error log :
Logger: custom_components.securitas.securitas_direct_new_api.apimanager Source: custom_components/securitas/securitas_direct_new_api/apimanager.py:106 Integration: Securitas Direct (documentation, issues) First occurred: 09:39:14 (2 occurrences) Last logged: 09:59:03
Unauthorized
Thanks for the report, unfortunately until this happens to me, it's very difficult to debug remotely. Sorry for the inconvenience.
@guerrerotook If needed to debug remotely you can ask to me to do some tests :)
@guerrerotook Luis Guerrero Guirado FTE If needed to debug remotely you can ask to me to do some tests :)
That would be awesome @siom7, I have these two documents that explain how to capture requests from the web application.
https://github.com/guerrerotook/securitas-direct-new-api/blob/main/docs/how_to_capture.md
https://github.com/guerrerotook/securitas-direct-new-api/blob/main/docs/new_operations.md
So, I would like you to fully login onto the website and export the request and the responses from the web app. My only request is to be extremely careful because that may contain your login and password and I don't want that information to be leaked . But you have the full end to end flow of the login with the SMS I can try to implement this.
Hi @guerrerotook ,
I captured this just after authentication, this can help you ?
{
"data":
{
"xSLoginToken":
{
"res":"OK",
"msg":"Utilisateur correctement validé",
"hash":"eyJhbGciOiJIUzI1NiJ9.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"lang":"FR",
"legals":true,
"mainUser":false,
"changePassword":false,
"needDeviceAuthorization":null
}
}
}
@guerrerotook And this when I check alarm status
{
"data":
{
"xSCheckAlarmStatus":
{
"res":"WAIT",
"msg":"Demande en cours de traitement",
"status":null,
"numinst":null,
"protomResponse":null,
"protomResponseDate":null
}
}
}
{
"data":
{
"xSCheckAlarmStatus":
{
"res":"OK",
"msg":"Votre alarme est désactivée",
"status":"0","numinst":"XXXXXXXX",
"protomResponse":"D",
"protomResponseDate":"2022-06-23 12:44:29.783"
}
}
}
Thanks very much. It happens to me as well, so now I can easily debug the two steps authentication.
Ok, let me know if you need me for some tests :)
Hello,
Just made some adjustments on something else and rebooted My HA and it works again !!
Le jeu. 23 juin 2022 à 13:00, siom7 @.***> a écrit :
Ok, let me know if you need me for testing :)
— Reply to this email directly, view it on GitHub https://github.com/guerrerotook/securitas-direct-new-api/issues/52#issuecomment-1164269652, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXUJD2FYEBUBBYYMVWN5QGDVQQ7V7ANCNFSM5TSXY7WA . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>
Hello,
the same. Just modify the parameter timedelta (to refresh every 5min) , save and reboot HA. The integration works again.
o refresh every 5m
Can you share what you did so I can modify the component and everyone can benefit?
I modify the line 45 in alarm_control_panel.py with SCAN_INTERVAL = timedelta(seconds=300)
I modify the line 45 in alarm_control_panel.py with SCAN_INTERVAL = timedelta(seconds=300)
How does changing the scan interval fix a 2FA auth on this service!? I am confused...
@manuelbarbosa I’m confused like you but I tried the tip of @sh4rks and it’s working 😅
Hi @guerrerotook ,
have you find the root cause?
@oborqueg Please see this issue -> https://github.com/guerrerotook/securitas-direct-new-api/issues/57
You just have to wait…
@siom7 to wait for what? updated version? I have the V1.3.0.0 and have the unathorized error :(
@oborqueg There is 2FA now to authenticate on Verisure API @guerrerotook is currently working on it, this is why you have Unauthorized error message.
Still not working?
I just installed the integration, and same error.
[custom_components.securitas.securitas_direct_new_api.apimanager] Unauthorized
Not working for me: line 45 in alarm_control_panel.py with SCAN_INTERVAL = timedelta(seconds=300)
Any update?
@BertMart71 https://github.com/guerrerotook/securitas-direct-new-api/issues/57