Skip to content

Two Factor Authentication Support

Chase Lau edited this page Feb 9, 2022 · 2 revisions

Alarm.com allows users to enable two-factor authentication (2FA) on their accounts for added security. Users who have enabled this (or were forced to if using ADT) can opt to receive a code via text or email when signing in.

Unfortunately, Alarm.com doesn't allow the use of things such as app passwords, meaning we need to work around this if you want to use your account with the plugin. As of 1.7.2-4, we support 2FA. You'll need to get a code from the Alarm.com website using a browser and then input it into the plugin using the UI or manually. Here's how:

Step 1: Getting the code

  1. Head to the Alarm.com website. Login if you're not already. You should be at your homes main page.
    • Heads up, the device name you enter here will be what the plugin is identified by. You can set this name to something like "Homebridge" if you want to keep track of the plugin better.
  2. Open the developer tools for your browser. In most browsers you just need to right-click the page and select "Inspect element" or "Open developer tools". Here's more information by browser:
  3. Open the Application (Chrome)/Storage (Firefox) tab of the developer tools.
  4. Find "cookies" in the sidebar and expand the cookies for the Alarm.com website.
  5. Find "twoFactorAuthenticationId" and take note of its value. The value should be a 64 character long string composed of numbers and letters.

Step 2a: Enable 2FA via the UI (Recommended)

If you're using the homebridge-ui-x plugin which comes recommended with homebridge, enabling 2FA is easy.

  1. Open the homebridge UI and open the "plugins" page.
  2. Under the "Homebridge Node Alarm Dot Com" plugin, click settings.
  3. Check the box for "Use Two Factor"
  4. Paste the code from earlier in the text box for "2FA Cookie"
  5. Save your config and restart homebridge.

Step 2b: Enable 2FA manually

If you'd prefer not to use the UI, you can enable MFA by editing your config.json.

  1. Open homebridge's config.json using your editor of choise (if you're choosing to do this manually, I assume you know where config.json is and have a strong opinion on your editor of choise)
  2. Add the key useMFA and set it to true.
  3. Add the key mfaCookie and set it to your code from earlier.
  4. Save, then restart homebridge.

After homebridge comes back up, everything should be working as expected.