jmfernandes / robin_stocks

This is a library to use with Robinhood Financial App. It currently supports trading crypto-currencies, options, and stocks. In addition, it can be used to get real time ticker information, assess the performance of your portfolio, and can also get tax documents, total dividends paid, and more. More info at
http://www.robin-stocks.com
MIT License
1.72k stars 464 forks source link

2FA login using QR code #142

Closed iforte closed 4 years ago

iforte commented 4 years ago

Is it possible to pass your QR code as a login parameter so that you don't have to type the MFA in manually? This is possible with the LichAmnesia fork.

unacceptable commented 4 years ago

My dude, just get the time based token string by clicking "Can't scan it?" under the QR code when adding your token. After you have that you can generate the token in python with a library like pyotp.

Obvi I'd recommend scanning it on your phone before clicking that so you have both.

>>> import pyotp
>>> totp = pyotp.TOTP('JBSWY3DPEHPK3PXP')
>>> print("Current OTP:", totp.now())
Current OTP: 928028
>>>

The above example matches what I have on my phone... Now to reset my MFA.

EDIT: I see what you're saying now about the login function not accepting OTP: https://github.com/jmfernandes/robin_stocks/blob/master/robin_stocks/authentication.py#L54 Let's put in a PR to fix this.

unacceptable commented 4 years ago

https://github.com/sanko/Robinhood/blob/master/Authentication.md#multi-factor-authentication-mfa This looks super doable. I will start testing this locally.

unacceptable commented 4 years ago

@iforte I finally got around to putting in a PR for this it was actually much easier than I thought it would be.

iforte commented 4 years ago

That’s great! Thanks for that.

On Fri, Jul 17, 2020 at 6:59 PM Robert J. notifications@github.com wrote:

@iforte https://github.com/iforte I finally got around to putting in a PR for this it was actually much easier than I thought it would be.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jmfernandes/robin_stocks/issues/142#issuecomment-660406240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZA247WAHIUFOB4M7GDPE3R4D6XTANCNFSM4O5EKBKQ .

andresn commented 2 years ago

@unacceptable thank you for this!

Note: from the quick start guide:

... to use this feature, you will have to sign into your robinhood account and turn on two factor authentication. Robinhood will ask you which two factor authorization app you want to use. Select “other”.

There's no "other" option today and RH just presents the QR code. Therefore, it might help new users if the instructions were updated with yours on how to get the alphanumeric code from the QR code.