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.69k stars 459 forks source link

login failure #292

Closed madankan closed 3 years ago

madankan commented 3 years ago

I used to login with no issues, but since few mins ago, the API is returning the following error, while I have no problem connecting to the internet:

robinhood_username = os.environ.get("robinhood_username") robinhood_password = os.environ.get("robinhood_password")

rs.login(username=robinhood_username, password=robinhood_password, expiresIn=86400, by_sms=False)


Exception Traceback (most recent call last)

in 5 password=robinhood_password, 6 expiresIn=86400, ----> 7 by_sms=False) /usr/local/lib/python3.7/site-packages/robin_stocks/robinhood/authentication.py in login(username, password, expiresIn, scope, by_sms, store_session, mfa_code) 186 'device_token': device_token}, f) 187 else: --> 188 raise Exception(data['detail']) 189 else: 190 raise Exception('Error: Trouble connecting to robinhood API. Check internet connection.') Exception: Challenge type is invalid
madankan commented 3 years ago

resolved it by changin the by_sms = True for once and then changing it back to by_sms=False and everything worked out.