-
Notifications
You must be signed in to change notification settings - Fork 603
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
AuthenticationError: Update to the newest version of Robinhood to access this feature. #319
Comments
I took a look at what requests the website front end was sending, and saw they're currently sending this version header:
whereas pyrh/pyrh/models/sessionmanager.py Line 42 in e301e80
Setting |
Hey @cejohnson, how are you setting the header? Thanks! |
You can pass them in as a
I assumed the headers passed in here would be merged with the default headers, and the SessionManager docstring seems to support that, but I'm not seeing this actually happen in the code so it may be a full replacement. However, the above is working for me. |
pyrh/pyrh/models/sessionmanager.py Line 105 in e301e80
Actually, it replaces--if you put up a PR. I can cut a release. We may actually want a better solution here, where users can change the API version on the fly. |
PR created. I thought about adding an |
@cejohnson from pyrh.models.sessionmanager import HEADERS
HEADERS["X-Robinhood-API-Version"] = "1.143.4" # as of today [2024-12-05] this is the version
sm = SessionManager(
username=username,
password=password.get_secret_value(),
mfa=secret.get_secret_value(),
headers=HEADERS
)
sm.login() Error: |
Yeah, it stopped working for me in the last day or two as well. It looks like they're now rejecting the default user-agent with the "update" error, but if I change that I get:
which really isn't an improvement. I don't see any obvious differences from the flow in the browser vs what the code seems to be doing, but apparently something changed somewhere. If I have time I'll try to look into it later. |
The problem is talked about in another RH repo... Looks like they solved it. |
Checklist
Description
Crashes when running
from pyrh import Robinhood rh = Robinhood(username="email", password="password")
This error shows up when you login with correct credentials, however it doesn't ask 2FA.
Steps/Code to Reproduce
Run the program with successful credentials
A different error will pop up if you provide the wrong credential as usual saying that the password or email is incorrect, meaning the connection between the api and robinhood still works.
Results
File "/home/runner/HeftyRedundantElement/main.py", line 4, in <module> rh.login() File "/home/runner/HeftyRedundantElement/.pythonlibs/lib/python3.10/site-packages/pyrh/models/sessionmanager.py", line 162, in login self._login_oauth2() File "/home/runner/HeftyRedundantElement/.pythonlibs/lib/python3.10/site-packages/pyrh/models/sessionmanager.py", line 453, in _login_oauth2 raise AuthenticationError(msg) pyrh.exceptions.AuthenticationError: Update to the newest version of Robinhood to access this feature.
Versions
Linux-6.2.16-x86_64-with-glibc2.39
Python 3.10.14 (main, Mar 19 2024, 21:46:16) [GCC 13.3.0]
pyrh 2.1.2
The text was updated successfully, but these errors were encountered: