westonplatter / fast_arrow

(no longer maintained) A simple yet robust (stock+options) API client for Robinhood
MIT License
127 stars 37 forks source link

Login fails #86

Closed viaConBodhi closed 5 years ago

viaConBodhi commented 5 years ago

Everything was working Friday and today was having issues logging in today. Upgraded this morning and still having issues.

1 # log into Fast_Arrow 2 client = Client(username=XXXXX, password=XXXXXX) ----> 3 client.authenticate() 4 #login_oauth2 5 # client = Client.login_oauth2(self,username=XXXXX, password=XXXXX)

~\AppData\Local\Continuum\anaconda3\envs\py3.6\lib\site-packages\fast_arrow\client.py in authenticate(self) 32 ''' 33 if "username" in self.options and "password" in self.options: ---> 34 self.login_oauth2(self.options["username"], self.options["password"], self.options.get('mfa_code')) 35 elif "access_token" in self.options and "refresh_token" in self.options: 36 self.access_token = self.options["access_token"]

~\AppData\Local\Continuum\anaconda3\envs\py3.6\lib\site-packages\fast_arrow\client.py in login_oauth2(self, username, password, mfa_code) 117 data['mfa_code'] = mfa_code 118 url = "https://api.robinhood.com/oauth2/token/" --> 119 res = self.post(url, payload=data, retry=False) 120 121 if res is None:

~\AppData\Local\Continuum\anaconda3\envs\py3.6\lib\site-packages\fast_arrow\client.py in post(self, url, payload, retry) 78 attempts += 1 79 if res.status_code in [400]: ---> 80 raise e 81 elif retry and res.status_code in [403]: 82 self.relogin_oauth2()

~\AppData\Local\Continuum\anaconda3\envs\py3.6\lib\site-packages\fast_arrow\client.py in post(self, url, payload, retry) 70 try: 71 res = requests.post(url, headers=headers, data=payload, timeout=15, verify=self.certs) ---> 72 res.raise_for_status() 73 if res.headers['Content-Length'] == '0': 74 return None

~\AppData\Local\Continuum\anaconda3\envs\py3.6\lib\site-packages\requests\models.py in raise_for_status(self) 938 939 if http_error_msg: --> 940 raise HTTPError(http_error_msg, response=self) 941 942 def close(self):

westonplatter commented 5 years ago

For context, see #85

halessi commented 5 years ago

Same issue as of a few hours ago.

westonplatter commented 5 years ago

@viaConBodhi @halessi I've updated the login/authentication setup. See https://github.com/westonplatter/fast_arrow#note---changes-coming-with-version--10.

Could you try using 1.0.0.rc2 to see if you still run into an issue?

westonplatter commented 5 years ago

@viaConBodhi @halessi circling back on this as I'm grooming the backlog. Are you still experiencing this issue?

viaConBodhi commented 5 years ago

@westonplatter I've been refactoring some other work and haven't had time to hit this up...I ran the same login I've been using yesterday though and had no issues.

westonplatter commented 5 years ago

@viaConBodhi cool. Are there any remaining items on this issue?

viaConBodhi commented 5 years ago

@westonplatter not that I'm aware of...thanks again for maintaining this.

westonplatter commented 5 years ago

@viaConBodhi welcome 😄. Thanks for your help troubleshooting the auth issues!

I'm always trying to learn what works well and what's broken or needs improvement.