Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 2FA #11

Open
Locutus73 opened this issue Sep 5, 2019 · 3 comments
Open

Add support for 2FA #11

Locutus73 opened this issue Sep 5, 2019 · 3 comments

Comments

@Locutus73
Copy link

Arlo just introduced 2 factor authentication.
Old authentication API still works for accounts with 2FA disabled, but enabling 2FA would be a great security improvement.

Thank you in advance.
Regards.

@jensrossbach
Copy link
Contributor

Also Arlo states that everyone has to change to 2FA until end of the year, so this is even more important.

@rogatec
Copy link

rogatec commented Nov 25, 2020

There are plenty discussions in the arlo forum about 2FA is a bad idea (in this content).
I don't think that they will force everyone (account) to use 2FA.

Also in a python implementation they are discussing about how to implement a 2FA, but still seems to be a lot of work to do.

@8bitDesigner
Copy link

8bitDesigner commented Aug 13, 2022

Okay, so I went down the rabbit hole on this, and I think it's possible, but unlikely to be usable for Homebridge. So, the way the Arlo OAuth dance works is this:

  1. POST https://ocapi-app.arlo.com/api/auth with a JSON payload containing the username and password of the user you're logging in ({"email":"EMAIL","password":btoa("PASSWORD")}
  2. Arlo responds with a login payload, with a User ID, a field indicated whether or not we're logged in, and a session token.
  3. From here out, we set the Authorization header as the Base64 encoded token
  4. If the user isn't logged in, we GET https://ocapi-app.arlo.com/api/getFactors to get a list of 2FA methods the user has set up
  5. POST https://ocapi-app.arlo.com/api/startAuth with a 2FA method ID, and user ID, which should send the use a 2FA request. We'll also get back a factorAuthCode.
  6. Now, we simply need to POST https://ocapi-app.arlo.com/api/finishAuth with the factorAuthCode, and the one time password that was emailed or texted to our user.
  7. The API should respond with a new token and an expiry time.

And this is where we get sad. Tokens are only valid for 2 weeks, it looks like. We'd have to go through this process pretty frequently, which would be hell to manage in Homebridge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants