mozilla / PyFxA

Python library for interacting with the Firefox Accounts ecosystem
Other
31 stars 20 forks source link

Add support for TOTP #63

Closed kewisch closed 6 years ago

kewisch commented 6 years ago

Uploading this for comment. I've added support for 2fa/totp, but I'm struggling with the test. My understanding was that all I need to do to enable it is to create the token and possibly verify a code, and then it should work.

I'm probably confusing the "verified" state, I'm not sure if that is just for verifying the account after creation, or if it is the state the session is in after the TOTP code was verified.

The tests fail on the verifying step with "A TOTP token not found", so it seems the token creation failed somehow, or did not stick.

Would be delighted for the right hints on how to actually enable 2fa on an account.

kewisch commented 6 years ago

Thanks for the hint, that definitely worked! I made some adaptions to take the current implementation into account. I think this is ready for review now.

rfk commented 6 years ago

This looks great! Thanks, and sorry for the delay, I've been on vacation.