pierceography / hubitatADC

Hubitat Alarm.com App and Driver
Apache License 2.0
16 stars 6 forks source link

Two-Factor Authentication Problem #1

Open genteelish opened 3 years ago

genteelish commented 3 years ago

Apparently Alarm.com has a new requirement where if you are a customer who has not setup two-factor authentication; when you logon with a new session; you are redirected to a "Set up your System" page that will allow you to skip or setup two-factor authentication. The code in this app mimics the same behavior a browser would, but the code does not respond to skipping the "Set up your System" page therefore the logon process within this app no longer works.

EC2730 commented 2 years ago

Fixed the two factor authentication.

  1. In application "Alarm.com Manager", function "mainPage()" added new input section { input "twoFactorAuthenticationId", "twoFactorAuthenticationId", title: "twoFactorAuthenticationId from browser", required: false }

  2. In application "Alarm.com Manager", function "getSystemAuthID()", added a fourth header to "params=": "Cookie": "twoFactorAuthenticationId=${twoFactorAuthenticationId}"

  3. Logged into the alarm.com web site and enabled for 2-factor authentication

  4. Retrieved from the browser value of cookie "twoFactorAuthenticationId" and assigned it to the field created in step 1 above

That's it. It works.