Login Errors with 2FA (email code)
See original GitHub issueChecklist
- [ x] I am on the latest pyrh version.
- [ x] I have searched the issues of this repo and believe that this is not a duplicate.
Description
Getting an error when trying to log in following instructions on quickstart, prompts for a 2FA email code and I enter the SMS code which fails to work
Steps/Code to Reproduce
import config
robinhood = Robinhood()
robinhood.login(username= config.username, password= config.password)
quote = robinhood.quote_data("TWTR")
print(quote)
Results
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyrh/robinhood.py", line 215, in login
res2.raise_for_status()
File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.robinhood.com/challenge//respond/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "trade.py", line 6, in <module>
robinhood.login(username= config.username, password= config.password)
File "/usr/local/lib/python3.7/site-packages/pyrh/robinhood.py", line 228, in login
raise RH_exception.LoginFailed()
pyrh.exceptions.LoginFailed
Issue Analytics
- State:
- Created 3 years ago
- Comments:30 (2 by maintainers)
Top Results From Across the Web
Problem Solving Login Issues with Two-Factor Authentication
I just logged in to Console site, but now my authentication code isn't working for Author site. General two-factor authentication login issues.
Read more >Fix common issues with 2-Step Verification - Google Support
To enter a code sent to your email address or phone number. This code helps make sure you can access that email address...
Read more >Common problems with two-step verification for a work or ...
If you've mistakenly made many sign-in attempts, wait until you can try again, or use a different MFA method for sign-in. If you...
Read more >What should I do if I've activated 2FA, but lost access to the ...
This is a confirmation code generated by an authentication app, also called an OTP app, on your smartphone or other device. To ensure...
Read more >"Invalid Code. Try Again." error message when trying to login ...
Two-factor authentication (2FA) is a method of securely verifying your identity using two pieces of evidence instead of one.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I think I figured out the issue! 🎉
In the constructor for
Robinhood.login()
there is a keyword argumentchallenge_type
. The default isemail
. Change this to whatever 2FA format you prefer. I’m not sure what all the available options are (not really documented anywhere) but I changed mine tosms
and it worked.Here’s an example below.
You should receive your 2FA code via SMS - enter it and it should return
True
.Note I don’t have 2FA turned on in my Robinhood app settings.
Hope this helps!
Sorry everyone for leaving y’all hanging! I’ve been busy lately with other projects. I’ll do more research into this